main_2020_show.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. hardwareTypes = null
  5. hardwareHotList = {}
  6. //热点 设备控制
  7. $("#hotPannel .close, #hotPannel .iconquxiao").on('click',()=>{//关闭
  8. $("#hotPannel>div").css("display","");
  9. window.hotNeedUpdatePannel = null;
  10. })
  11. $("#hotPannel input.mui-switch").on('change',(e)=>{//灯
  12. var ifOn = $('#hotPannel input.mui-switch').is(':checked');
  13. window.changeDeviceStatus(window.hotNeedUpdatePannel, '02', ifOn?'1':'0', null, (a)=>{
  14. $("#hotPannel input.mui-switch").prop("checked", !ifOn) //error
  15. })
  16. })
  17. var deviceBtnBind = function($elem, paramCode, paramValue){
  18. $elem.on('click',(e)=>{
  19. paramValue_ = paramValue instanceof Function ? paramValue() : paramValue
  20. window.changeDeviceStatus(window.hotNeedUpdatePannel, paramCode, paramValue_, (a)=>{
  21. hotNeedUpdatePannel.showPannel() //success update
  22. })
  23. })
  24. }
  25. //空调
  26. deviceBtnBind($("#hotPannel .ac-con .iconfengsu31"), '04', '3')// windSpeed
  27. deviceBtnBind($("#hotPannel .ac-con .iconfengsu2"), '04', '2')// windSpeed
  28. deviceBtnBind($("#hotPannel .ac-con .iconfengsu11"), '04', '1')// windSpeed
  29. deviceBtnBind($("#hotPannel .ac-con .minbtn .ac-btn").eq(0), '05', ()=>{return hotNeedUpdatePannel.temperature - 1 + ''})// temperature
  30. deviceBtnBind($("#hotPannel .ac-con .minbtn .ac-btn").eq(1), '05', ()=>{return hotNeedUpdatePannel.temperature + 1 + ''})// temperature
  31. deviceBtnBind($("#hotPannel .ac-con .ac-close"), '02', '0')// close
  32. var getAjax = function(url, success, errorString){
  33. $(".waiting").addClass('showloading')
  34. $.ajax({//获取设备状态
  35. method: "GET",
  36. headers: {
  37. "Content-Type": "application/json",
  38. },
  39. dataType: "json",
  40. contentType: "application/json",
  41. url: url,
  42. success: (data)=> {
  43. success(data)
  44. $(".waiting").removeClass('showloading')
  45. },
  46. error:(e)=>{
  47. alert(errorString)
  48. $(".waiting").removeClass('showloading')
  49. }
  50. })
  51. }
  52. getAjax(g_Prefix+`/api/device/getType`, (data)=>{
  53. if (data.code === 0) {
  54. hardwareTypes = data.data
  55. } else {
  56. console.error('设备类型列表获取失败')
  57. }
  58. },'设备类型列表获取失败')
  59. window.getDeviceInfo = function(deviceId, callback){
  60. var userId = '77547f7af360c5d8e14932866b844d53'
  61. var url = `/api/device/list/${userId}` + (deviceId ? `?deviceId=${deviceId}` : '')
  62. getAjax(url, (data)=>{
  63. if(data.code == 0){
  64. callback(data.data)
  65. }
  66. },'设备列表获取失败')
  67. }
  68. //----------------------------------
  69. var dom = {//许钟文add
  70. getOffset: function(type, element, parent) {
  71. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  72. if (!parent) parent = $("body")[0];
  73. while (element = element.offsetParent) {
  74. if (element == parent) break;
  75. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  76. }
  77. return left;
  78. }
  79. };
  80. !function() {
  81. "use strict";
  82. function t(t, i) {
  83. return typeof t === i
  84. }
  85. function i(t, i) {
  86. return t instanceof i
  87. }
  88. function n(t) {
  89. return t && t.nodeType
  90. }
  91. function e(t) {
  92. return n(t) ? t : i(t, g) ? t[0] : void 0
  93. }
  94. function o(t, i, n) {
  95. return g.each(t, function(t, e) {
  96. n = i.call(e, n, t, e)
  97. }),
  98. n
  99. }
  100. function r(t, i, n) {
  101. var e, o, r;
  102. if (t === i)
  103. return !0;
  104. if (!t || !i || t.constructor !== i.constructor)
  105. return !1;
  106. for (e = 0,
  107. o = n.length; o > e; e += 1) {
  108. if (r = n[e],
  109. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  110. return !1;
  111. if (t[r] !== i[r])
  112. return !1
  113. }
  114. return !0
  115. }
  116. function s(t, i, n, e) {
  117. this.left = E(t),
  118. this.top = E(i),
  119. this.width = E(n),
  120. this.height = E(e),
  121. this.right = this.left + this.width,
  122. this.bottom = this.top + this.height
  123. }
  124. function h(t, i, n, e) {
  125. this.visible = t || 0,
  126. this.viewport = i || 0,
  127. this.possible = n || 0,
  128. this.rects = e && T({}, e) || null
  129. }
  130. function l(t, i) {
  131. this.els = t,
  132. this.viewport = i
  133. }
  134. function c(t, i, n) {
  135. var e;
  136. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  137. e ? e[n] : 0
  138. }
  139. function u(t, i) {
  140. return t.val - i.val
  141. }
  142. function a(t, i) {
  143. return i.val - t.val
  144. }
  145. function f(t) {
  146. var i = s.ofContent(t, !0)
  147. , n = s.ofViewport(t, !0)
  148. , e = i.width - n.width
  149. , o = i.height - n.height;
  150. this.content = i,
  151. this.viewport = n,
  152. this.width = 0 >= e ? null : n.left / e,
  153. this.height = 0 >= o ? null : n.top / o,
  154. this.left = n.left,
  155. this.top = n.top,
  156. this.right = i.right - n.right,
  157. this.bottom = i.bottom - n.bottom
  158. }
  159. function p(t) {
  160. this.el = t || window
  161. }
  162. function d(t, i) {
  163. this.context = t,
  164. this.viewport = i,
  165. this.init()
  166. }
  167. function v(t, i, n, e) {
  168. this.context = new l(t,i),
  169. this.property = n,
  170. this.descending = e,
  171. this.init()
  172. }
  173. function w(t) {
  174. t && t !== window && t !== document ? (this.context = t,
  175. this.$autoTarget = g(t)) : this.context = window,
  176. this.init()
  177. }
  178. var g = jQuery
  179. , m = g(window)
  180. , b = g(document)
  181. , T = g.extend
  182. , y = g.isFunction
  183. , k = Math.max
  184. , V = Math.min
  185. , E = Math.round
  186. , x = function() {
  187. var t = {}
  188. , i = 1;
  189. return function(n) {
  190. return n ? (t[n] || (t[n] = i,
  191. i += 1),
  192. t[n]) : 0
  193. }
  194. }();
  195. T(s.prototype, {
  196. equals: function(t) {
  197. return r(this, t, ["left", "top", "width", "height"])
  198. },
  199. area: function() {
  200. return this.width * this.height
  201. },
  202. relativeTo: function(t) {
  203. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  204. },
  205. intersection: function(t) {
  206. if (!i(t, s))
  207. return null;
  208. var n = k(this.left, t.left)
  209. , e = V(this.right, t.right)
  210. , o = k(this.top, t.top)
  211. , r = V(this.bottom, t.bottom)
  212. , h = e - n
  213. , l = r - o;
  214. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  215. },
  216. envelope: function(t) {
  217. if (!i(t, s))
  218. return this;
  219. var n = V(this.left, t.left)
  220. , e = k(this.right, t.right)
  221. , o = V(this.top, t.top)
  222. , r = k(this.bottom, t.bottom)
  223. , h = e - n
  224. , l = r - o;
  225. return new s(n,o,h,l)
  226. }
  227. }),
  228. T(s, {
  229. ofContent: function(t, i) {
  230. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  231. },
  232. ofViewport: function(t, i) {
  233. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  234. },
  235. ofElement: function(t) {
  236. var i = g(t);
  237. if (!i.is(":visible"))
  238. return null;
  239. var n = i.offset();
  240. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  241. }
  242. }),
  243. T(h.prototype, {
  244. equals: function(t) {
  245. return this.fracsEqual(t) && this.rectsEqual(t)
  246. },
  247. fracsEqual: function(t) {
  248. return r(this, t, ["visible", "viewport", "possible"])
  249. },
  250. rectsEqual: function(t) {
  251. return r(this.rects, t.rects, ["document", "element", "viewport"])
  252. }
  253. }),
  254. T(h, {
  255. of: function(t, i) {
  256. var e, o, r;
  257. return t = n(t) && s.ofElement(t) || t,
  258. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  259. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  260. r = V(t.width, i.width) * V(t.height, i.height),
  261. new h(o / t.area(),o / i.area(),o / r,{
  262. document: e,
  263. element: e.relativeTo(t),
  264. viewport: e.relativeTo(i)
  265. })) : new h
  266. }
  267. });
  268. var q = ["width", "height", "left", "right", "top", "bottom"]
  269. , S = ["possible", "visible", "viewport"];
  270. T(l.prototype, {
  271. sorted: function(t, i) {
  272. var n = this.viewport;
  273. return g.map(this.els, function(i) {
  274. return {
  275. el: i,
  276. val: c(i, n, t)
  277. }
  278. }).sort(i ? a : u)
  279. },
  280. best: function(t, i) {
  281. return this.els.length ? this.sorted(t, i)[0] : null
  282. }
  283. }),
  284. T(f.prototype, {
  285. equals: function(t) {
  286. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  287. }
  288. }),
  289. T(p.prototype, {
  290. equals: function(t) {
  291. return r(this, t, ["el"])
  292. },
  293. scrollState: function() {
  294. return new f(this.el)
  295. },
  296. scrollTo: function(t, i, n) {
  297. var e = g(this.el === window ? "html,body" : this.el);
  298. t = t || 0,
  299. i = i || 0,
  300. n = isNaN(n) ? 1e3 : n,
  301. e.stop(!0).animate({
  302. scrollLeft: t,
  303. scrollTop: i
  304. }, n)
  305. },
  306. scroll: function(t, i, n) {
  307. var e = this.el === window ? m : g(this.el);
  308. t = t || 0,
  309. i = i || 0,
  310. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  311. },
  312. scrollToRect: function(t, i, n, e) {
  313. i = i || 0,
  314. n = n || 0,
  315. this.scrollTo(t.left - i, t.top - n, e)
  316. },
  317. scrollToElement: function(t, i, n, e) {
  318. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  319. this.scrollToRect(o, i, n, e)
  320. }
  321. });
  322. var C = {
  323. init: function() {
  324. this.callbacks = g.Callbacks("memory unique"),
  325. this.currVal = null,
  326. this.prevVal = null,
  327. this.checkProxy = g.proxy(this.check, this),
  328. this.autoCheck()
  329. },
  330. bind: function(t) {
  331. this.callbacks.add(t)
  332. },
  333. unbind: function(t) {
  334. t ? this.callbacks.remove(t) : this.callbacks.empty()
  335. },
  336. trigger: function() {
  337. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  338. },
  339. check: function(t) {
  340. var i = this.updatedValue(t);
  341. return void 0 !== i && (this.prevVal = this.currVal,
  342. this.currVal = i,
  343. this.trigger(),
  344. !0)
  345. },
  346. $autoTarget: m,
  347. autoEvents: "load resize scroll",
  348. autoCheck: function(t) {
  349. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  350. }
  351. };
  352. T(d.prototype, C, {
  353. updatedValue: function() {
  354. var t = h.of(this.context, this.viewport);
  355. return this.currVal && this.currVal.equals(t) ? void 0 : t
  356. }
  357. }),
  358. T(v.prototype, C, {
  359. updatedValue: function() {
  360. var t = this.context.best(this.property, this.descending);
  361. return t && (t = t.val > 0 ? t.el : null,
  362. this.currVal !== t) ? t : void 0
  363. }
  364. }),
  365. T(w.prototype, C, {
  366. updatedValue: function() {
  367. var t = new f(this.context);
  368. return this.currVal && this.currVal.equals(t) ? void 0 : t
  369. }
  370. });
  371. var L = function(t, i) {
  372. var n = [].slice
  373. , e = jQuery
  374. , o = e.extend
  375. , r = e.isFunction
  376. , s = o({}, i)
  377. , h = function(i, n, o, s) {
  378. return o = r(o) ? o.apply(i, n) : o,
  379. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  380. }
  381. , l = function() {
  382. return h(this, n.call(arguments), s.defaultStatic, l)
  383. }
  384. , c = function(t) {
  385. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  386. }
  387. , u = function(t) {
  388. t && (o(l, t.statics),
  389. o(c, t.methods)),
  390. l.modplug = u
  391. };
  392. u.prev = {
  393. statics: e[t],
  394. methods: e.fn[t]
  395. },
  396. u(i),
  397. e[t] = l,
  398. e.fn[t] = c
  399. }
  400. , M = "fracs";
  401. L(M, {
  402. statics: {
  403. version: "0.15.0",
  404. Rect: s,
  405. Fractions: h,
  406. Group: l,
  407. ScrollState: f,
  408. Viewport: p,
  409. FracsCallbacks: d,
  410. GroupCallbacks: v,
  411. ScrollStateCallbacks: w,
  412. fracs: function(t, i) {
  413. return h.of(t, i)
  414. }
  415. },
  416. methods: {
  417. content: function(t) {
  418. return this.length ? s.ofContent(this[0], t) : null
  419. },
  420. envelope: function() {
  421. return o(this, function(t) {
  422. var i = s.ofElement(this);
  423. return t ? t.envelope(i) : i
  424. })
  425. },
  426. fracs: function(i, n, o) {
  427. t(i, "string") || (o = n,
  428. n = i,
  429. i = null),
  430. y(n) || (o = n,
  431. n = null),
  432. o = e(o);
  433. var r = M + ".fracs." + x(o);
  434. return "unbind" === i ? this.each(function() {
  435. var t = g(this).data(r);
  436. t && t.unbind(n)
  437. }) : "check" === i ? this.each(function() {
  438. var t = g(this).data(r);
  439. t && t.check()
  440. }) : y(n) ? this.each(function() {
  441. var t = g(this)
  442. , i = t.data(r);
  443. i || (i = new d(this,o),
  444. t.data(r, i)),
  445. i.bind(n)
  446. }) : this.length ? h.of(this[0], o) : null
  447. },
  448. intersection: function() {
  449. return o(this, function(t) {
  450. var i = s.ofElement(this);
  451. return t ? t.intersection(i) : i
  452. })
  453. },
  454. max: function(t, i, n) {
  455. return y(i) || (n = i,
  456. i = null),
  457. n = e(n),
  458. i ? (new v(this,n,t,!0).bind(i),
  459. this) : this.pushStack(new l(this,n).best(t, !0).el)
  460. },
  461. min: function(t, i, n) {
  462. return y(i) || (n = i,
  463. i = null),
  464. n = e(n),
  465. i ? (new v(this,n,t).bind(i),
  466. this) : this.pushStack(new l(this,n).best(t).el)
  467. },
  468. rect: function() {
  469. return this.length ? s.ofElement(this[0]) : null
  470. },
  471. scrollState: function(i, n) {
  472. var e = M + ".scrollState";
  473. return t(i, "string") || (n = i,
  474. i = null),
  475. "unbind" === i ? this.each(function() {
  476. var t = g(this).data(e);
  477. t && t.unbind(n)
  478. }) : "check" === i ? this.each(function() {
  479. var t = g(this).data(e);
  480. t && t.check()
  481. }) : y(n) ? this.each(function() {
  482. var t = g(this)
  483. , i = t.data(e);
  484. i || (i = new w(this),
  485. t.data(e, i)),
  486. i.bind(n)
  487. }) : this.length ? new f(this[0]) : null
  488. },
  489. scroll: function(t, i, n) {
  490. return this.each(function() {
  491. new p(this).scroll(t, i, n)
  492. })
  493. },
  494. scrollTo: function(t, i, n, o) {
  495. return g.isNumeric(t) && (o = n,
  496. n = i,
  497. i = t,
  498. t = null),
  499. t = e(t),
  500. this.each(function() {
  501. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  502. })
  503. },
  504. scrollToThis: function(t, i, n, o) {
  505. return o = new p(e(o)),
  506. o.scrollToElement(this[0], t, i, n),
  507. this
  508. },
  509. softLink: function(t, i, n, o) {
  510. return o = new p(e(o)),
  511. this.filter("a[href^=#]").each(function() {
  512. var e = g(this);
  513. e.on("click", function() {
  514. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  515. })
  516. })
  517. },
  518. sort: function(i, n, o) {
  519. return t(n, "boolean") || (o = n,
  520. n = null),
  521. o = e(o),
  522. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  523. return t.el
  524. }))
  525. },
  526. viewport: function(t) {
  527. return this.length ? s.ofViewport(this[0], t) : null
  528. }
  529. },
  530. defaultStatic: "fracs",
  531. defaultMethod: "fracs"
  532. })
  533. }();
  534. if ("undefined" == typeof jQuery)
  535. throw new Error("Bootstrap's JavaScript requires jQuery");
  536. +function(t) {
  537. "use strict";
  538. function e(e) {
  539. return this.each(function() {
  540. var o = t(this)
  541. , s = o.data("bs.tooltip")
  542. , n = "object" == typeof e && e;
  543. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  544. "string" == typeof e && s[e]())
  545. })
  546. }
  547. var i = function(t, e) {
  548. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  549. this.init("tooltip", t, e)
  550. };
  551. i.VERSION = "3.2.0",
  552. i.DEFAULTS = {
  553. animation: !0,
  554. placement: "top",
  555. selector: !1,
  556. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  557. trigger: "hover focus",
  558. title: "",
  559. delay: 0,
  560. html: !1,
  561. container: !1,
  562. viewport: {
  563. selector: "body",
  564. padding: 0
  565. }
  566. },
  567. i.prototype.init = function(e, i, o) {
  568. this.enabled = !0,
  569. this.type = e,
  570. this.$element = t(i),
  571. this.options = this.getOptions(o),
  572. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  573. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  574. var r = s[n];
  575. if ("click" == r)
  576. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  577. else if ("manual" != r) {
  578. var a = "hover" == r ? "mouseenter" : "focusin"
  579. , l = "hover" == r ? "mouseleave" : "focusout";
  580. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  581. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  582. }
  583. }
  584. this.options.selector ? this._options = t.extend({}, this.options, {
  585. trigger: "manual",
  586. selector: ""
  587. }) : this.fixTitle()
  588. }
  589. ,
  590. i.prototype.getDefaults = function() {
  591. return i.DEFAULTS
  592. }
  593. ,
  594. i.prototype.getOptions = function(e) {
  595. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  596. e.delay && "number" == typeof e.delay && (e.delay = {
  597. show: e.delay,
  598. hide: e.delay
  599. }),
  600. e
  601. }
  602. ,
  603. i.prototype.getDelegateOptions = function() {
  604. var e = {}
  605. , i = this.getDefaults();
  606. return this._options && t.each(this._options, function(t, o) {
  607. i[t] != o && (e[t] = o)
  608. }),
  609. e
  610. }
  611. ,
  612. i.prototype.enter = function(e) {
  613. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  614. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  615. t(e.currentTarget).data("bs." + this.type, i)),
  616. clearTimeout(i.timeout),
  617. i.hoverState = "in",
  618. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  619. // "in" == i.hoverState && i.show()
  620. }, i.options.delay.show)) : i.show()
  621. }
  622. ,
  623. i.prototype.leave = function(e) {
  624. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  625. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  626. t(e.currentTarget).data("bs." + this.type, i)),
  627. clearTimeout(i.timeout),
  628. i.hoverState = "out",
  629. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  630. "out" == i.hoverState && i.hide()
  631. }, i.options.delay.hide)) : i.hide()
  632. }
  633. ,
  634. i.prototype.show = function() {
  635. var e = t.Event("show.bs." + this.type);
  636. if (this.hasContent() && this.enabled) {
  637. this.$element.trigger(e);
  638. var i = t.contains(document.documentElement, this.$element[0]);
  639. if (e.isDefaultPrevented() || !i)
  640. return;
  641. var o = this
  642. , s = this.tip()
  643. , n = this.getUID(this.type);
  644. this.setContent(),
  645. s.attr("id", n),
  646. this.$element.attr("aria-describedby", n),
  647. this.options.animation && s.addClass("fade");
  648. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  649. , a = /\s?auto?\s?/i
  650. , l = a.test(r);
  651. l && (r = r.replace(a, "") || "top"),
  652. s.detach().css({
  653. top: 0,
  654. left: 0,
  655. display: "block"
  656. }).addClass(r).data("bs." + this.type, this),
  657. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  658. var p = this.getPosition()
  659. , h = s[0].offsetWidth
  660. , f = s[0].offsetHeight;
  661. if (l) {
  662. var u = r
  663. , c = this.$element.parent()
  664. , d = this.getPosition(c);
  665. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  666. s.removeClass(u).addClass(r)
  667. }
  668. var g = this.getCalculatedOffset(r, p, h, f);
  669. this.applyPlacement(g, r);
  670. var y = function() {
  671. o.$element.trigger("shown.bs." + o.type),
  672. o.hoverState = null
  673. };
  674. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  675. }
  676. }
  677. ,
  678. i.prototype.applyPlacement = function(e, i) {
  679. var o = this.tip()
  680. , s = o[0].offsetWidth
  681. , n = o[0].offsetHeight
  682. , r = parseInt(o.css("margin-top"), 10)
  683. , a = parseInt(o.css("margin-left"), 10);
  684. isNaN(r) && (r = 0),
  685. isNaN(a) && (a = 0),
  686. e.top = e.top + r,
  687. e.left = e.left + a,
  688. t.offset.setOffset(o[0], t.extend({
  689. using: function(t) {
  690. o.css({
  691. top: Math.round(t.top),
  692. left: Math.round(t.left)
  693. })
  694. }
  695. }, e), 0),
  696. o.addClass("in");
  697. var l = o[0].offsetWidth
  698. , p = o[0].offsetHeight;
  699. "top" == i && p != n && (e.top = e.top + n - p);
  700. var h = this.getViewportAdjustedDelta(i, e, l, p);
  701. h.left ? e.left += h.left : e.top += h.top;
  702. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  703. , u = h.left ? "left" : "top"
  704. , c = h.left ? "offsetWidth" : "offsetHeight";
  705. o.offset(e),
  706. this.replaceArrow(f, o[0][c], u)
  707. }
  708. ,
  709. i.prototype.replaceArrow = function(t, e, i) {
  710. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  711. }
  712. ,
  713. i.prototype.setContent = function() {
  714. var t = this.tip()
  715. , e = this.getTitle();
  716. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  717. t.removeClass("fade in top bottom left right")
  718. }
  719. ,
  720. i.prototype.hide = function() {
  721. function e() {
  722. "in" != i.hoverState && o.detach(),
  723. i.$element.trigger("hidden.bs." + i.type)
  724. }
  725. var i = this
  726. , o = this.tip()
  727. , s = t.Event("hide.bs." + this.type);
  728. if (this.$element.removeAttr("aria-describedby"),
  729. this.$element.trigger(s),
  730. !s.isDefaultPrevented())
  731. return o.removeClass("in"),
  732. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  733. this.hoverState = null,
  734. this
  735. }
  736. ,
  737. i.prototype.fixTitle = function() {
  738. var t = this.$element;
  739. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  740. }
  741. ,
  742. i.prototype.hasContent = function() {
  743. return this.getTitle()
  744. }
  745. ,
  746. i.prototype.getPosition = function(e) {
  747. e = e || this.$element;
  748. var i = e[0]
  749. , o = "BODY" == i.tagName;
  750. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  751. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  752. width: o ? t(window).width() : e.outerWidth(),
  753. height: o ? t(window).height() : e.outerHeight()
  754. }, o ? {
  755. top: 0,
  756. left: 0
  757. } : e.offset())
  758. }
  759. ,
  760. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  761. return "bottom" == t ? {
  762. top: e.top + e.height,
  763. left: e.left + e.width / 2 - i / 2
  764. } : "top" == t ? {
  765. top: e.top - o,
  766. left: e.left + e.width / 2 - i / 2
  767. } : "left" == t ? {
  768. top: e.top + e.height / 2 - o / 2,
  769. left: e.left - i
  770. } : {
  771. top: e.top + e.height / 2 - o / 2,
  772. left: e.left + e.width
  773. }
  774. }
  775. ,
  776. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  777. var s = {
  778. top: 0,
  779. left: 0
  780. };
  781. if (!this.$viewport)
  782. return s;
  783. var n = this.options.viewport && this.options.viewport.padding || 0
  784. , r = this.getPosition(this.$viewport);
  785. if (/right|left/.test(t)) {
  786. var a = e.top - n - r.scroll
  787. , l = e.top + n - r.scroll + o;
  788. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  789. } else {
  790. var p = e.left - n
  791. , h = e.left + n + i;
  792. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  793. }
  794. return s
  795. }
  796. ,
  797. i.prototype.getTitle = function() {
  798. var t, e = this.$element, i = this.options;
  799. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  800. }
  801. ,
  802. i.prototype.getUID = function(t) {
  803. do
  804. t += ~~(1e6 * Math.random());
  805. while (document.getElementById(t));return t
  806. }
  807. ,
  808. i.prototype.tip = function() {
  809. return this.$tip = this.$tip || t(this.options.template)
  810. }
  811. ,
  812. i.prototype.arrow = function() {
  813. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  814. }
  815. ,
  816. i.prototype.validate = function() {
  817. this.$element[0].parentNode || (this.hide(),
  818. this.$element = null,
  819. this.options = null)
  820. }
  821. ,
  822. i.prototype.enable = function() {
  823. this.enabled = !0
  824. }
  825. ,
  826. i.prototype.disable = function() {
  827. this.enabled = !1
  828. }
  829. ,
  830. i.prototype.toggleEnabled = function() {
  831. this.enabled = !this.enabled
  832. }
  833. ,
  834. i.prototype.toggle = function(e) {
  835. var i = this;
  836. e && (i = t(e.currentTarget).data("bs." + this.type),
  837. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  838. t(e.currentTarget).data("bs." + this.type, i))),
  839. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  840. }
  841. ,
  842. i.prototype.destroy = function() {
  843. clearTimeout(this.timeout),
  844. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  845. }
  846. ;
  847. var o = t.fn.tooltip;
  848. t.fn.tooltip = e,
  849. t.fn.tooltip.Constructor = i,
  850. t.fn.tooltip.noConflict = function() {
  851. return t.fn.tooltip = o,
  852. this
  853. }
  854. }(jQuery);
  855. !function(e, t, n) {
  856. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  857. }("Keen", this, function() {
  858. "use strict";
  859. function Keen() {
  860. return _init.apply(this, arguments)
  861. }
  862. function _init(e) {
  863. if (_isUndefined(e))
  864. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  865. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  866. throw new Error("Please provide a projectId");
  867. this.configure(e)
  868. }
  869. function _extend(e) {
  870. for (var t = 1; t < arguments.length; t++)
  871. for (var n in arguments[t])
  872. e[n] = arguments[t][n];
  873. return e
  874. }
  875. function _isUndefined(e) {
  876. return void 0 === e
  877. }
  878. function _type(e) {
  879. var t = e && e.constructor ? e.constructor.toString() : void 0;
  880. return t ? t.match(/function (.*)\(/)[1] : "Null"
  881. }
  882. function _each(e, t, n) {
  883. var r;
  884. if (!e)
  885. return 0;
  886. if (n = n ? n : e,
  887. "array" === _type(e)) {
  888. for (r = 0; r < e.length; r++)
  889. if (t.call(n, e[r], r, e) === !1)
  890. return 0
  891. } else
  892. for (r in e)
  893. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  894. return 0;
  895. return 1
  896. }
  897. function _parse_params(e) {
  898. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  899. return decodeURIComponent(e.replace(r, " "))
  900. }, a = e.split("?")[1]; t = i.exec(a); )
  901. n[o(t[1])] = o(t[2]);
  902. return n
  903. }
  904. function _set_protocol(e) {
  905. switch (e) {
  906. case "http":
  907. return "http";
  908. case "auto":
  909. return location.protocol.replace(/:/g, "");
  910. case "https":
  911. case void 0:
  912. default:
  913. return "https"
  914. }
  915. }
  916. function _set_request_type(e) {
  917. var t = e || "jsonp"
  918. , n = !1;
  919. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  920. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  921. }
  922. function _build_url(e) {
  923. return this.client.endpoint + "/projects/" + this.client.projectId + e
  924. }
  925. function _uploadEvent(e, t, n, r, i) {
  926. var o = _build_url.apply(this, ["/events/" + e])
  927. , a = {};
  928. n = n !== !1,
  929. this.client.globalProperties && (a = this.client.globalProperties(e));
  930. for (var c in t)
  931. t.hasOwnProperty(c) && (a[c] = t[c]);
  932. switch (this.client.requestType) {
  933. case "xhr":
  934. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  935. break;
  936. case "jsonp":
  937. var s = JSON.stringify(a)
  938. , l = Keen.Base64.encode(s);
  939. o = o + "?api_key=" + this.client.writeKey,
  940. o = o + "&data=" + l,
  941. o = o + "&modified=" + (new Date).getTime(),
  942. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  943. break;
  944. case "beacon":
  945. var s = JSON.stringify(a)
  946. , l = Keen.Base64.encode(s);
  947. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  948. o = o + "&data=" + encodeURIComponent(l),
  949. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  950. o += "&c=clv1",
  951. _request.beacon.apply(this, [o, null, r, i])
  952. }
  953. }
  954. Keen.prototype.configure = function(e) {
  955. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  956. e.protocol = _set_protocol(e.protocol),
  957. e.requestType = _set_request_type(e.requestType),
  958. this.client = {
  959. projectId: e.projectId,
  960. writeKey: e.writeKey,
  961. readKey: e.readKey,
  962. globalProperties: null,
  963. endpoint: e.protocol + "://" + e.host,
  964. requestType: e.requestType
  965. },
  966. Keen.trigger("client", this, e),
  967. this.trigger("ready"),
  968. this
  969. }
  970. ;
  971. var _request = {
  972. xhr: function(e, t, n, r, i, o, a, c) {
  973. if (!i)
  974. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  975. var s = new XMLHttpRequest;
  976. if (s.onreadystatechange = function() {
  977. if (4 == s.readyState)
  978. if (s.status >= 200 && s.status < 300) {
  979. var e;
  980. try {
  981. e = JSON.parse(s.responseText)
  982. } catch (e) {
  983. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  984. c && c(s, e)
  985. }
  986. a && e && a(e)
  987. } else
  988. Keen.log("HTTP request failed."),
  989. c && c(s, null)
  990. }
  991. ,
  992. s.open(e, t, o),
  993. i && s.setRequestHeader("Authorization", i),
  994. r && s.setRequestHeader("Content-Type", "application/json"),
  995. n)
  996. for (var l in n)
  997. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  998. var u = r ? JSON.stringify(r) : null;
  999. s.send(u)
  1000. },
  1001. jsonp: function(e, t, n, r) {
  1002. if (!t)
  1003. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1004. if (t && e.indexOf("api_key") < 0) {
  1005. var i = e.indexOf("?") > 0 ? "&" : "?";
  1006. e = e + i + "api_key=" + t
  1007. }
  1008. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1009. o += "a";
  1010. var a = !1;
  1011. window[o] = function(e) {
  1012. a = !0,
  1013. n && e && n(e),
  1014. window[o] = void 0
  1015. }
  1016. ,
  1017. e = e + "&jsonp=" + o;
  1018. var c = document.createElement("script");
  1019. c.id = "keen-jsonp",
  1020. c.src = e,
  1021. document.getElementsByTagName("head")[0].appendChild(c),
  1022. c.onreadystatechange = function() {
  1023. a === !1 && "loaded" === this.readyState && (a = !0,
  1024. r && r())
  1025. }
  1026. ,
  1027. c.onerror = function() {
  1028. a === !1 && (a = !0,
  1029. r && r())
  1030. }
  1031. },
  1032. beacon: function(e, t, n, r) {
  1033. if (t && e.indexOf("api_key") < 0) {
  1034. var i = e.indexOf("?") > 0 ? "&" : "?";
  1035. e = e + i + "api_key=" + t
  1036. }
  1037. var o = !1
  1038. , a = document.createElement("img");
  1039. a.onload = function() {
  1040. if (o = !0,
  1041. "naturalHeight"in this) {
  1042. if (this.naturalHeight + this.naturalWidth === 0)
  1043. return void this.onerror()
  1044. } else if (this.width + this.height === 0)
  1045. return void this.onerror();
  1046. n && n({
  1047. created: !0
  1048. })
  1049. }
  1050. ,
  1051. a.onerror = function() {
  1052. o = !0,
  1053. r && r()
  1054. }
  1055. ,
  1056. a.src = e
  1057. }
  1058. }
  1059. , Events = Keen.Events = {
  1060. on: function(e, t) {
  1061. this.listeners || (this.listeners = {});
  1062. var n = this.listeners[e] || (this.listeners[e] = []);
  1063. return n.push({
  1064. callback: t
  1065. }),
  1066. this
  1067. },
  1068. off: function(e, t) {
  1069. if (!e && !t)
  1070. return this.listeners = void 0,
  1071. delete this.listeners,
  1072. this;
  1073. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1074. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1075. t && 0 != n.length || (this.listeners[e] = void 0,
  1076. delete this.listeners[e]);
  1077. return this
  1078. },
  1079. trigger: function(e) {
  1080. if (!this.listeners)
  1081. return this;
  1082. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1083. n[r].callback.apply(this, t);
  1084. return this
  1085. }
  1086. };
  1087. _extend(Keen.prototype, Events),
  1088. _extend(Keen, Events),
  1089. Keen.loaded = !0,
  1090. Keen.utils = {
  1091. each: _each,
  1092. extend: _extend,
  1093. parseParams: _parse_params
  1094. },
  1095. Keen.ready = function(e) {
  1096. Keen.loaded ? e() : Keen.on("ready", e)
  1097. }
  1098. ,
  1099. Keen.log = function(e) {
  1100. "object" == typeof console && console.log("[Keen IO]", e)
  1101. }
  1102. ;
  1103. var Plugins = Keen.Plugins = {};
  1104. Keen.prototype.addEvent = function() {
  1105. _uploadEvent.apply(this, arguments)
  1106. }
  1107. ,
  1108. Keen.prototype.addEventSync = function(e, t, n, r) {
  1109. _uploadEvent.apply(this, [e, t, !1, n, r])
  1110. }
  1111. ,
  1112. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1113. var o = e
  1114. , a = o.metaKey
  1115. , c = o.target
  1116. , s = !1
  1117. , l = function() {};
  1118. return void 0 === r && (r = 500),
  1119. "A" === c.nodeName ? l = function() {
  1120. a || s || (s = !0,
  1121. window.location = c.href)
  1122. }
  1123. : "FORM" === c.nodeName && (l = function() {
  1124. s || (s = !0,
  1125. c.submit())
  1126. }
  1127. ),
  1128. i && (l = function() {
  1129. s || (s = !0,
  1130. i())
  1131. }
  1132. ),
  1133. _uploadEvent.call(this, t, n, l, l),
  1134. setTimeout(function() {
  1135. l()
  1136. }, r),
  1137. !!a && void 0
  1138. }
  1139. ,
  1140. Keen.prototype.setGlobalProperties = function(e) {
  1141. if (!this.client)
  1142. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1143. if (!e || "function" != typeof e)
  1144. throw new Error("Invalid value for global properties: " + e);
  1145. this.client.globalProperties = e
  1146. }
  1147. ,
  1148. Keen.Base64 = {
  1149. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1150. encode: function(e) {
  1151. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1152. for (e = this.utf8.encode(e); l < e.length; )
  1153. t = e.charCodeAt(l++),
  1154. n = e.charCodeAt(l++),
  1155. r = e.charCodeAt(l++),
  1156. i = t >> 2,
  1157. o = (3 & t) << 4 | n >> 4,
  1158. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1159. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1160. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1161. return s
  1162. },
  1163. decode: function(e) {
  1164. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1165. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1166. t = u.indexOf(e.charAt(l++)),
  1167. n = u.indexOf(e.charAt(l++)),
  1168. r = u.indexOf(e.charAt(l++)),
  1169. i = u.indexOf(e.charAt(l++)),
  1170. o = t << 2 | n >> 4,
  1171. a = (15 & n) << 4 | r >> 2,
  1172. c = (3 & r) << 6 | i,
  1173. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1174. return this.utf8.decode(s)
  1175. },
  1176. utf8: {
  1177. encode: function(e) {
  1178. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1179. t = e.charCodeAt(r++),
  1180. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1181. return n
  1182. },
  1183. decode: function(e) {
  1184. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1185. n = e.charCodeAt(i),
  1186. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1187. return r
  1188. }
  1189. }
  1190. },
  1191. "object" != typeof JSON && (JSON = {}),
  1192. function() {
  1193. function f(e) {
  1194. return 10 > e ? "0" + e : e
  1195. }
  1196. function quote(e) {
  1197. return escapable.lastIndex = 0,
  1198. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1199. var t = meta[e];
  1200. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1201. }) + '"' : '"' + e + '"'
  1202. }
  1203. function str(e, t) {
  1204. var n, r, i, o, a, c = gap, s = t[e];
  1205. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1206. "function" == typeof rep && (s = rep.call(t, e, s)),
  1207. typeof s) {
  1208. case "string":
  1209. return quote(s);
  1210. case "number":
  1211. return isFinite(s) ? String(s) : "null";
  1212. case "boolean":
  1213. case "null":
  1214. return String(s);
  1215. case "object":
  1216. if (!s)
  1217. return "null";
  1218. if (gap += indent,
  1219. a = [],
  1220. "[object Array]" === Object.prototype.toString.apply(s)) {
  1221. for (o = s.length,
  1222. n = 0; o > n; n += 1)
  1223. a[n] = str(n, s) || "null";
  1224. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1225. gap = c,
  1226. i
  1227. }
  1228. if (rep && "object" == typeof rep)
  1229. for (o = rep.length,
  1230. n = 0; o > n; n += 1)
  1231. "string" == typeof rep[n] && (r = rep[n],
  1232. i = str(r, s),
  1233. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1234. else
  1235. for (r in s)
  1236. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1237. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1238. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1239. gap = c,
  1240. i
  1241. }
  1242. }
  1243. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1244. 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
  1245. }
  1246. ,
  1247. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1248. return this.valueOf()
  1249. }
  1250. );
  1251. 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 = {
  1252. "\b": "\\b",
  1253. "\t": "\\t",
  1254. "\n": "\\n",
  1255. "\f": "\\f",
  1256. "\r": "\\r",
  1257. '"': '\\"',
  1258. "\\": "\\\\"
  1259. }, rep;
  1260. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1261. var r;
  1262. if (gap = "",
  1263. indent = "",
  1264. "number" == typeof n)
  1265. for (r = 0; n > r; r += 1)
  1266. indent += " ";
  1267. else
  1268. "string" == typeof n && (indent = n);
  1269. if (rep = t,
  1270. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1271. throw new Error("JSON.stringify");
  1272. return str("", {
  1273. "": e
  1274. })
  1275. }
  1276. ),
  1277. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1278. function walk(e, t) {
  1279. var n, r, i = e[t];
  1280. if (i && "object" == typeof i)
  1281. for (n in i)
  1282. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1283. void 0 !== r ? i[n] = r : delete i[n]);
  1284. return reviver.call(e, t, i)
  1285. }
  1286. var j;
  1287. if (text = String(text),
  1288. cx.lastIndex = 0,
  1289. cx.test(text) && (text = text.replace(cx, function(e) {
  1290. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1291. })),
  1292. /^[\],:{}\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, "")))
  1293. return j = eval("(" + text + ")"),
  1294. "function" == typeof reviver ? walk({
  1295. "": j
  1296. }, "") : j;
  1297. throw new SyntaxError("JSON.parse")
  1298. }
  1299. )
  1300. }(),
  1301. !function(e, t, n) {
  1302. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1303. }("domready", Keen.utils, function(e) {
  1304. function t(e) {
  1305. for (d = 1; e = r.shift(); )
  1306. e()
  1307. }
  1308. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1309. return o[l] && o[l](s, n = function() {
  1310. o.removeEventListener(s, n, i),
  1311. t()
  1312. }
  1313. , i),
  1314. c && o.attachEvent(u, n = function() {
  1315. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1316. t())
  1317. }
  1318. ),
  1319. e = c ? function(t) {
  1320. self != top ? d ? t() : r.push(t) : function() {
  1321. try {
  1322. a.doScroll("left")
  1323. } catch (n) {
  1324. return setTimeout(function() {
  1325. e(t)
  1326. }, 50)
  1327. }
  1328. t()
  1329. }()
  1330. }
  1331. : function(e) {
  1332. d ? e() : r.push(e)
  1333. }
  1334. });
  1335. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1336. if (loaded && cached) {
  1337. clients = cached.clients || {},
  1338. ready = cached.ready || [];
  1339. for (var instance in clients)
  1340. if (clients.hasOwnProperty(instance)) {
  1341. var client = clients[instance];
  1342. for (var method in Keen.prototype)
  1343. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1344. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1345. ,
  1346. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1347. ,
  1348. client._config && (client.configure.call(client, client._config),
  1349. delete client._config),
  1350. client._setGlobalProperties) {
  1351. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1352. client.setGlobalProperties.apply(client, globals[i]);
  1353. delete client._setGlobalProperties
  1354. }
  1355. if (client._addEvent) {
  1356. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1357. client.addEvent.apply(client, queue[i]);
  1358. delete client._addEvent
  1359. }
  1360. var callback = client._on || [];
  1361. if (client._on) {
  1362. for (var i = 0; i < callback.length; i++)
  1363. client.on.apply(client, callback[i]);
  1364. client.trigger("ready"),
  1365. delete client._on
  1366. }
  1367. }
  1368. for (var i = 0; i < ready.length; i++) {
  1369. var callback = ready[i];
  1370. Keen.on("ready", function() {
  1371. callback()
  1372. })
  1373. }
  1374. }
  1375. return Keen.loaded && setTimeout(function() {
  1376. Keen.utils.domready(function() {
  1377. Keen.trigger("ready")
  1378. })
  1379. }, 0),
  1380. Keen
  1381. });
  1382. !function() {
  1383. var t = window.analytics = window.analytics || [];
  1384. if (!t.initialize) {
  1385. if (t.invoked)
  1386. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1387. t.invoked = !0,
  1388. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1389. t.factory = function(e) {
  1390. return function() {
  1391. var n = Array.prototype.slice.call(arguments);
  1392. return n.unshift(e),
  1393. t.push(n),
  1394. t
  1395. }
  1396. }
  1397. ;
  1398. for (var e = 0; e < t.methods.length; e++) {
  1399. var n = t.methods[e];
  1400. t[n] = t.factory(n)
  1401. }
  1402. t.load = function(t) {
  1403. var e = document.createElement("script");
  1404. e.type = "text/javascript",
  1405. e.async = !0,
  1406. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1407. var n = document.getElementsByTagName("script")[0];
  1408. n.parentNode.insertBefore(e, n)
  1409. }
  1410. ,
  1411. t.SNIPPET_VERSION = "4.0.0"
  1412. }
  1413. }();
  1414. !function(i, e) {
  1415. "use strict";
  1416. var s = ""
  1417. , r = "?"
  1418. , o = "function"
  1419. , a = "undefined"
  1420. , n = "object"
  1421. , t = "major"
  1422. , d = "model"
  1423. , w = "name"
  1424. , l = "type"
  1425. , p = "vendor"
  1426. , m = "version"
  1427. , c = "architecture"
  1428. , u = "console"
  1429. , g = "mobile"
  1430. , f = "tablet"
  1431. , h = "smarttv"
  1432. , b = {
  1433. has: function(i, e) {
  1434. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1435. },
  1436. lowerize: function(i) {
  1437. return i.toLowerCase()
  1438. }
  1439. }
  1440. , y = {
  1441. rgx: function() {
  1442. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1443. var c = m[p]
  1444. , u = m[p + 1];
  1445. if (typeof i === a) {
  1446. i = {};
  1447. for (t in u)
  1448. d = u[t],
  1449. typeof d === n ? i[d[0]] = e : i[d] = e
  1450. }
  1451. for (s = r = 0; s < c.length; s++)
  1452. if (w = c[s].exec(this.getUA())) {
  1453. for (t = 0; t < u.length; t++)
  1454. l = w[++r],
  1455. d = u[t],
  1456. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1457. break
  1458. }
  1459. if (w)
  1460. break
  1461. }
  1462. return i
  1463. },
  1464. str: function(i, s) {
  1465. for (var o in s)
  1466. if (typeof s[o] === n && s[o].length > 0) {
  1467. for (var a = 0; a < s[o].length; a++)
  1468. if (b.has(s[o][a], i))
  1469. return o === r ? e : o
  1470. } else if (b.has(s[o], i))
  1471. return o === r ? e : o;
  1472. return i
  1473. }
  1474. }
  1475. , v = {
  1476. browser: {
  1477. oldsafari: {
  1478. major: {
  1479. 1: ["/8", "/1", "/3"],
  1480. 2: "/4",
  1481. "?": "/"
  1482. },
  1483. version: {
  1484. "1.0": "/8",
  1485. 1.2: "/1",
  1486. 1.3: "/3",
  1487. "2.0": "/412",
  1488. "2.0.2": "/416",
  1489. "2.0.3": "/417",
  1490. "2.0.4": "/419",
  1491. "?": "/"
  1492. }
  1493. }
  1494. },
  1495. device: {
  1496. sprint: {
  1497. model: {
  1498. "Evo Shift 4G": "7373KT"
  1499. },
  1500. vendor: {
  1501. HTC: "APA",
  1502. Sprint: "Sprint"
  1503. }
  1504. }
  1505. },
  1506. os: {
  1507. windows: {
  1508. version: {
  1509. ME: "4.90",
  1510. "NT 3.11": "NT3.51",
  1511. "NT 4.0": "NT4.0",
  1512. 2e3: "NT 5.0",
  1513. XP: ["NT 5.1", "NT 5.2"],
  1514. Vista: "NT 6.0",
  1515. 7: "NT 6.1",
  1516. 8: "NT 6.2",
  1517. 8.1: "NT 6.3",
  1518. RT: "ARM"
  1519. }
  1520. }
  1521. }
  1522. }
  1523. , k = {
  1524. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(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], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(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], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(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], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(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], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1525. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1526. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(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], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1527. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1528. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(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], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/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], [w, m]]
  1529. }
  1530. , x = function(e) {
  1531. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1532. return this instanceof x ? (this.getBrowser = function() {
  1533. return y.rgx.apply(this, k.browser)
  1534. }
  1535. ,
  1536. this.getCPU = function() {
  1537. return y.rgx.apply(this, k.cpu)
  1538. }
  1539. ,
  1540. this.getDevice = function() {
  1541. return y.rgx.apply(this, k.device)
  1542. }
  1543. ,
  1544. this.getEngine = function() {
  1545. return y.rgx.apply(this, k.engine)
  1546. }
  1547. ,
  1548. this.getOS = function() {
  1549. return y.rgx.apply(this, k.os)
  1550. }
  1551. ,
  1552. this.getResult = function() {
  1553. return {
  1554. ua: this.getUA(),
  1555. browser: this.getBrowser(),
  1556. engine: this.getEngine(),
  1557. os: this.getOS(),
  1558. device: this.getDevice(),
  1559. cpu: this.getCPU()
  1560. }
  1561. }
  1562. ,
  1563. this.getUA = function() {
  1564. return r
  1565. }
  1566. ,
  1567. this.setUA = function(i) {
  1568. return r = i,
  1569. this
  1570. }
  1571. ,
  1572. void this.setUA(r)) : new x(e).getResult()
  1573. };
  1574. if (typeof exports !== a)
  1575. typeof module !== a && module.exports && (exports = module.exports = x),
  1576. exports.UAParser = x;
  1577. else if (i.UAParser = x,
  1578. typeof define === o && define.amd && define(function() {
  1579. return x
  1580. }),
  1581. typeof i.jQuery !== a) {
  1582. var A = i.jQuery
  1583. , _ = new x;
  1584. A.ua = _.getResult(),
  1585. A.ua.get = function() {
  1586. return _.getUA()
  1587. }
  1588. ,
  1589. A.ua.set = function(i) {
  1590. _.setUA(i);
  1591. var e = _.getResult();
  1592. for (var s in e)
  1593. A.ua[s] = e[s]
  1594. }
  1595. }
  1596. }(this);
  1597. window.Modernizr = function(n, e, t) {
  1598. function o(n) {
  1599. d.cssText = n
  1600. }
  1601. function r(n, e) {
  1602. return typeof n === e
  1603. }
  1604. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1605. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1606. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1607. return e in n && r(n.constructor.prototype[e], "undefined")
  1608. }
  1609. : function(n, e) {
  1610. return v.call(n, e)
  1611. }
  1612. ,
  1613. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1614. var e = this;
  1615. if ("function" != typeof e)
  1616. throw new TypeError;
  1617. var t = b.call(arguments, 1)
  1618. , o = function() {
  1619. if (this instanceof o) {
  1620. var r = function() {};
  1621. r.prototype = e.prototype;
  1622. var i = new r
  1623. , c = e.apply(i, t.concat(b.call(arguments)));
  1624. return Object(c) === c ? c : i
  1625. }
  1626. return e.apply(n, t.concat(b.call(arguments)))
  1627. };
  1628. return o
  1629. }
  1630. ),
  1631. y.webgl = function() {
  1632. return !!n.WebGLRenderingContext
  1633. }
  1634. ;
  1635. for (var h in y)
  1636. u(y, h) && (c = h.toLowerCase(),
  1637. f[c] = y[h](),
  1638. w.push((f[c] ? "" : "no-") + c));
  1639. return f.addTest = function(n, e) {
  1640. if ("object" == typeof n)
  1641. for (var o in n)
  1642. u(n, o) && f.addTest(o, n[o]);
  1643. else {
  1644. if (n = n.toLowerCase(),
  1645. f[n] !== t)
  1646. return f;
  1647. e = "function" == typeof e ? e() : e,
  1648. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1649. f[n] = e
  1650. }
  1651. return f
  1652. }
  1653. ,
  1654. o(""),
  1655. p = i = null,
  1656. f._version = a,
  1657. f
  1658. }(this, this.document);
  1659. !function(e, t, a) {
  1660. "use strict";
  1661. function n(t, h, m) {
  1662. function H(a) {
  1663. var n = 0
  1664. , i = Ee.length;
  1665. if (Ce.old = e.extend({}, Ce),
  1666. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1667. ke = Be[ge.horizontal ? "width" : "height"](),
  1668. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1669. Ee.length = 0,
  1670. Ce.start = 0,
  1671. Ce.end = q(ze - Ie, 0),
  1672. Re) {
  1673. n = Ne.length,
  1674. qe = Pe.children(ge.itemSelector),
  1675. Ne.length = 0;
  1676. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1677. ze = 0,
  1678. qe.each(function(t, a) {
  1679. var n = e(a)
  1680. , i = a.getBoundingClientRect()
  1681. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1682. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1683. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1684. , h = l + d + p
  1685. , m = !d || !p
  1686. , g = {};
  1687. g.el = a,
  1688. g.size = m ? l : h,
  1689. g.half = g.size / 2,
  1690. g.start = ze + (m ? d : 0),
  1691. g.center = g.start - E(Ie / 2 - g.size / 2),
  1692. g.end = g.start - Ie + g.size,
  1693. t || (ze += s),
  1694. ze += h,
  1695. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1696. t === v && (g.end += o,
  1697. ze += o,
  1698. f = m ? p : 0),
  1699. Ne.push(g),
  1700. r = g
  1701. }),
  1702. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1703. ze -= f,
  1704. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1705. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1706. }
  1707. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1708. Q(),
  1709. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1710. Te = d(Te, ge.minHandleSize, ke),
  1711. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1712. xe.end = ke - Te,
  1713. it || j()),
  1714. !we && Ie > 0) {
  1715. var p = Ce.start
  1716. , h = "";
  1717. if (Re)
  1718. e.each(Ne, function(e, t) {
  1719. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1720. Ee.push(p),
  1721. p += Ie,
  1722. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1723. });
  1724. else
  1725. for (; p - Ie < Ce.end; )
  1726. Ee.push(p),
  1727. p += Ie;
  1728. if (De[0] && i !== Ee.length) {
  1729. for (var m = 0; m < Ee.length; m++)
  1730. h += ge.pageBuilder.call(ye, m);
  1731. Ae = De.html(h).children(),
  1732. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1733. }
  1734. }
  1735. if (Oe.slideeSize = ze,
  1736. Oe.frameSize = Ie,
  1737. Oe.sbSize = ke,
  1738. Oe.handleSize = Te,
  1739. Re) {
  1740. a && null != ge.startAt && (W(ge.startAt),
  1741. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1742. var g = Ne[Oe.activeItem];
  1743. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1744. } else
  1745. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1746. pe("load")
  1747. }
  1748. function X(e, t, a) {
  1749. if (Re && at.released && !a) {
  1750. var n = $(e)
  1751. , i = e > Ce.start && e < Ce.end;
  1752. Le ? (i && (e = Ne[n.centerItem].center),
  1753. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1754. }
  1755. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1756. et.start = +new Date,
  1757. et.time = 0,
  1758. et.from = Ce.cur,
  1759. et.to = e,
  1760. et.delta = e - Ce.cur,
  1761. et.tweesing = at.tweese || at.init && !at.slidee,
  1762. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1763. at.tweese = 0,
  1764. e !== Ce.dest && (Ce.dest = e,
  1765. pe("change"),
  1766. it || Y()),
  1767. K(),
  1768. Q(),
  1769. Z(),
  1770. F()
  1771. }
  1772. function Y() {
  1773. if (ye.initialized) {
  1774. if (!it)
  1775. return it = w(Y),
  1776. void (at.released && pe("moveStart"));
  1777. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1778. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1779. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1780. et.to === Ce.cur ? (Ce.cur = et.to,
  1781. at.tweese = it = 0) : it = w(Y),
  1782. pe("move"),
  1783. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1784. !it && at.released && pe("moveEnd"),
  1785. j()
  1786. }
  1787. }
  1788. function j() {
  1789. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1790. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1791. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1792. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1793. }
  1794. function F() {
  1795. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1796. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1797. pe("activePage", _e.page))
  1798. }
  1799. function M() {
  1800. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1801. ot = at.init ? w(M) : 0,
  1802. tt.now = +new Date,
  1803. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1804. X(at.init ? tt.pos : E(tt.pos)),
  1805. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1806. tt.lastTime = tt.now
  1807. }
  1808. function L(e, t, n) {
  1809. if ("boolean" === i(t) && (n = t,
  1810. t = a),
  1811. t === a)
  1812. X(Ce[e], n);
  1813. else {
  1814. if (Le && "center" !== e)
  1815. return;
  1816. var r = ye.getPos(t);
  1817. r && X(r[e], n, !Le)
  1818. }
  1819. }
  1820. function R(e) {
  1821. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1822. }
  1823. function U(e) {
  1824. return R(l(e) && 0 > e ? e + Ne.length : e)
  1825. }
  1826. function W(e, t) {
  1827. var a = R(e);
  1828. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1829. qe.eq(a).addClass(ge.activeClass),
  1830. _e.active = Oe.activeItem = a,
  1831. Z(),
  1832. pe("active", a)),
  1833. a)
  1834. }
  1835. function $(e) {
  1836. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1837. var t = {}
  1838. , a = Me ? 0 : Ie / 2;
  1839. if (!we)
  1840. for (var n = 0, i = Ee.length; i > n; n++) {
  1841. if (e >= Ce.end || n === Ee.length - 1) {
  1842. t.activePage = Ee.length - 1;
  1843. break
  1844. }
  1845. if (e <= Ee[n] + a) {
  1846. t.activePage = n;
  1847. break
  1848. }
  1849. }
  1850. if (Re) {
  1851. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1852. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1853. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1854. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1855. s = c;
  1856. break
  1857. }
  1858. t.firstItem = l(r) ? r : 0,
  1859. t.centerItem = l(o) ? o : t.firstItem,
  1860. t.lastItem = l(s) ? s : t.centerItem
  1861. }
  1862. return t
  1863. }
  1864. function Q(t) {
  1865. e.extend(Oe, $(t))
  1866. }
  1867. function Z() {
  1868. var e = Ce.dest <= Ce.start
  1869. , t = Ce.dest >= Ce.end
  1870. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1871. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1872. Je.is("button,input") && Je.prop("disabled", e),
  1873. Ke.is("button,input") && Ke.prop("disabled", t),
  1874. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1875. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1876. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1877. Qe.is("button,input") && Qe.prop("disabled", e),
  1878. $e.is("button,input") && $e.prop("disabled", t)),
  1879. Re && null != Oe.activeItem) {
  1880. var n = 0 === Oe.activeItem
  1881. , i = Oe.activeItem >= Ne.length - 1
  1882. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1883. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1884. Ze.is("button,input") && Ze.prop("disabled", n),
  1885. Ge.is("button,input") && Ge.prop("disabled", i),
  1886. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1887. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1888. }
  1889. }
  1890. function G(e, t, a) {
  1891. if (e = U(e),
  1892. t = U(t),
  1893. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1894. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1895. var n = t > e ? e : a ? t : t - 1
  1896. , i = e > t ? e : a ? t + 1 : t
  1897. , r = e > t;
  1898. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1899. H()
  1900. }
  1901. }
  1902. function J(e, t) {
  1903. for (var a = 0, n = Ve[e].length; n > a; a++)
  1904. if (Ve[e][a] === t)
  1905. return a;
  1906. return -1
  1907. }
  1908. function K() {
  1909. at.released && !ye.isPaused && ye.resume()
  1910. }
  1911. function V(e) {
  1912. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1913. }
  1914. function _() {
  1915. at.history[0] = at.history[1],
  1916. at.history[1] = at.history[2],
  1917. at.history[2] = at.history[3],
  1918. at.history[3] = at.delta
  1919. }
  1920. function ee(e) {
  1921. at.released = 0,
  1922. at.source = e,
  1923. at.slidee = "slidee" === e
  1924. }
  1925. function te(t) {
  1926. var a = "touchstart" === t.type
  1927. , n = t.data.source
  1928. , i = "slidee" === n;
  1929. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1930. ee(n),
  1931. at.init = 0,
  1932. at.$source = e(t.target),
  1933. at.touch = a,
  1934. at.pointer = a ? t.originalEvent.touches[0] : t,
  1935. at.initX = at.pointer.pageX,
  1936. at.initY = at.pointer.pageY,
  1937. at.initPos = i ? Ce.cur : xe.cur,
  1938. at.start = +new Date,
  1939. at.time = 0,
  1940. at.path = 0,
  1941. at.delta = 0,
  1942. at.locked = 0,
  1943. at.history = [0, 0, 0, 0],
  1944. at.pathToLock = i ? a ? 30 : 10 : 0,
  1945. b.on(a ? z : I, ae),
  1946. ye.pause(1),
  1947. (i ? Pe : Se).addClass(ge.draggedClass),
  1948. pe("moveStart"),
  1949. i && (rt = setInterval(_, 10)))
  1950. }
  1951. function ae(e) {
  1952. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1953. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1954. at.pathX = at.pointer.pageX - at.initX,
  1955. at.pathY = at.pointer.pageY - at.initY,
  1956. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1957. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1958. at.released || !(at.path < 1)) {
  1959. if (!at.init) {
  1960. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1961. return ne();
  1962. at.init = 1
  1963. }
  1964. r(e),
  1965. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1966. at.$source.on(B, s)),
  1967. at.released && (ne(),
  1968. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1969. at.delta += at.swing,
  1970. at.tweese = x(at.swing) > 10)),
  1971. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1972. }
  1973. }
  1974. function ne() {
  1975. clearInterval(rt),
  1976. at.released = !0,
  1977. b.off(at.touch ? z : I, ae),
  1978. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1979. setTimeout(function() {
  1980. at.$source.off(B, s)
  1981. }),
  1982. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1983. ye.resume(1),
  1984. at.init = 0
  1985. }
  1986. function ie(t) {
  1987. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1988. }
  1989. function re() {
  1990. ye.stop(),
  1991. b.off("mouseup", re)
  1992. }
  1993. function se(e) {
  1994. switch (r(e),
  1995. this) {
  1996. case $e[0]:
  1997. case Qe[0]:
  1998. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1999. b.on("mouseup", re);
  2000. break;
  2001. case Ze[0]:
  2002. ye.prev();
  2003. break;
  2004. case Ge[0]:
  2005. ye.next();
  2006. break;
  2007. case Je[0]:
  2008. ye.prevPage();
  2009. break;
  2010. case Ke[0]:
  2011. ye.nextPage()
  2012. }
  2013. }
  2014. function oe(e) {
  2015. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2016. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2017. Re ? (p = +new Date,
  2018. nt.last < p - nt.resetTime && (nt.delta = 0),
  2019. nt.last = p,
  2020. nt.delta += nt.curDelta,
  2021. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  2022. nt.delta %= 1),
  2023. nt.finalDelta) : nt.curDelta
  2024. }
  2025. function le(e) {
  2026. e.originalEvent[g] = ye;
  2027. var t = +new Date;
  2028. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2029. return void (O = t);
  2030. if (ge.scrollBy && Ce.start !== Ce.end) {
  2031. var a = oe(e.originalEvent);
  2032. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  2033. ye.slideBy(ge.scrollBy * a)
  2034. }
  2035. }
  2036. function ce(e) {
  2037. ge.clickBar && e.target === Be[0] && (r(e),
  2038. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2039. }
  2040. function de(e) {
  2041. if (ge.keyboardNavBy)
  2042. switch (e.which) {
  2043. case ge.horizontal ? 37 : 38:
  2044. r(e),
  2045. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2046. break;
  2047. case ge.horizontal ? 39 : 40:
  2048. r(e),
  2049. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  2050. }
  2051. }
  2052. function ue(e) {
  2053. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  2054. }
  2055. function fe() {
  2056. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2057. }
  2058. function ve(e) {
  2059. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  2060. }
  2061. function pe(e, t) {
  2062. if (Ve[e]) {
  2063. for (me = Ve[e].length,
  2064. T.length = 0,
  2065. he = 0; me > he; he++)
  2066. T.push(Ve[e][he]);
  2067. for (he = 0; me > he; he++)
  2068. T[he].call(ye, e, t)
  2069. }
  2070. }
  2071. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  2072. start: 0,
  2073. center: 0,
  2074. end: 0,
  2075. cur: 0,
  2076. dest: 0
  2077. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2078. start: 0,
  2079. end: 0,
  2080. cur: 0
  2081. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2082. firstItem: 0,
  2083. lastItem: 0,
  2084. centerItem: 0,
  2085. activeItem: null,
  2086. activePage: 0
  2087. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2088. released: 1
  2089. }, nt = {
  2090. last: 0,
  2091. delta: 0,
  2092. resetTime: 200
  2093. }, it = 0, rt = 0, st = 0, ot = 0;
  2094. we || (t = be[0]),
  2095. ye.initialized = 0,
  2096. ye.frame = t,
  2097. ye.slidee = Pe[0],
  2098. ye.pos = Ce,
  2099. ye.rel = Oe,
  2100. ye.items = Ne,
  2101. ye.pages = Ee,
  2102. ye.isPaused = 0,
  2103. ye.options = ge,
  2104. ye.dragging = at,
  2105. ye.reload = function() {
  2106. H()
  2107. }
  2108. ,
  2109. ye.getPos = function(e) {
  2110. if (Re) {
  2111. var t = R(e);
  2112. return -1 !== t && Ne[t]
  2113. }
  2114. var a = Pe.find(e).eq(0);
  2115. if (a[0]) {
  2116. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2117. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2118. return {
  2119. start: n,
  2120. center: n - Ie / 2 + i / 2,
  2121. end: n - Ie + i,
  2122. size: i
  2123. }
  2124. }
  2125. return !1
  2126. }
  2127. ,
  2128. ye.moveBy = function(e) {
  2129. tt.speed = e,
  2130. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2131. tt.startPos = Ce.cur,
  2132. ee("button"),
  2133. at.init = 1,
  2134. pe("moveStart"),
  2135. y(ot),
  2136. M())
  2137. }
  2138. ,
  2139. ye.stop = function() {
  2140. "button" === at.source && (at.init = 0,
  2141. at.released = 1)
  2142. }
  2143. ,
  2144. ye.prev = function() {
  2145. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2146. }
  2147. ,
  2148. ye.next = function() {
  2149. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2150. }
  2151. ,
  2152. ye.prevPage = function() {
  2153. ye.activatePage(Oe.activePage - 1)
  2154. }
  2155. ,
  2156. ye.nextPage = function() {
  2157. ye.activatePage(Oe.activePage + 1)
  2158. }
  2159. ,
  2160. ye.slideBy = function(e, t) {
  2161. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2162. }
  2163. ,
  2164. ye.slideTo = function(e, t) {
  2165. X(e, t)
  2166. }
  2167. ,
  2168. ye.toStart = function(e, t) {
  2169. L("start", e, t)
  2170. }
  2171. ,
  2172. ye.toEnd = function(e, t) {
  2173. L("end", e, t)
  2174. }
  2175. ,
  2176. ye.toCenter = function(e, t) {
  2177. L("center", e, t)
  2178. }
  2179. ,
  2180. ye.getIndex = R,
  2181. ye.activate = function(e, t) {
  2182. var a = W(e);
  2183. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2184. }
  2185. ,
  2186. ye.activatePage = function(e, t) {
  2187. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2188. }
  2189. ,
  2190. ye.resume = function(e) {
  2191. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2192. st ? st = clearTimeout(st) : pe("resume"),
  2193. st = setTimeout(function() {
  2194. switch (pe("cycle"),
  2195. ge.cycleBy) {
  2196. case "items":
  2197. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2198. break;
  2199. case "pages":
  2200. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2201. }
  2202. }, ge.cycleInterval))
  2203. }
  2204. ,
  2205. ye.pause = function(e) {
  2206. e < ye.isPaused || (ye.isPaused = e || 100,
  2207. st && (st = clearTimeout(st),
  2208. pe("pause")))
  2209. }
  2210. ,
  2211. ye.toggle = function() {
  2212. ye[st ? "pause" : "resume"]()
  2213. }
  2214. ,
  2215. ye.set = function(t, a) {
  2216. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2217. }
  2218. ,
  2219. ye.add = function(t, a) {
  2220. var n = e(t);
  2221. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2222. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2223. H()
  2224. }
  2225. ,
  2226. ye.remove = function(t) {
  2227. if (Re) {
  2228. var a = U(t);
  2229. if (a > -1) {
  2230. qe.eq(a).remove();
  2231. var n = a === Oe.activeItem;
  2232. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2233. H(),
  2234. n && (_e.active = null,
  2235. ye.activate(Oe.activeItem))
  2236. }
  2237. } else
  2238. e(t).remove(),
  2239. H()
  2240. }
  2241. ,
  2242. ye.moveAfter = function(e, t) {
  2243. G(e, t, 1)
  2244. }
  2245. ,
  2246. ye.moveBefore = function(e, t) {
  2247. G(e, t)
  2248. }
  2249. ,
  2250. ye.on = function(e, t) {
  2251. if ("object" === i(e))
  2252. for (var a in e)
  2253. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2254. else if ("function" === i(t))
  2255. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2256. Ve[n[r]] = Ve[n[r]] || [],
  2257. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2258. else if ("array" === i(t))
  2259. for (var o = 0, l = t.length; l > o; o++)
  2260. ye.on(e, t[o])
  2261. }
  2262. ,
  2263. ye.one = function(e, t) {
  2264. function a() {
  2265. t.apply(ye, arguments),
  2266. ye.off(e, a)
  2267. }
  2268. ye.on(e, a)
  2269. }
  2270. ,
  2271. ye.off = function(e, t) {
  2272. if (t instanceof Array)
  2273. for (var a = 0, n = t.length; n > a; a++)
  2274. ye.off(e, t[a]);
  2275. else
  2276. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2277. if (Ve[i[r]] = Ve[i[r]] || [],
  2278. null == t)
  2279. Ve[i[r]].length = 0;
  2280. else {
  2281. var o = J(i[r], t);
  2282. -1 !== o && Ve[i[r]].splice(o, 1)
  2283. }
  2284. }
  2285. ,
  2286. ye.destroy = function() {
  2287. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2288. b.off("keydown", de),
  2289. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2290. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2291. De.empty(),
  2292. we || (be.off("." + g),
  2293. He.restore(),
  2294. Xe.restore(),
  2295. Ye.restore(),
  2296. je.restore(),
  2297. e.removeData(t, g)),
  2298. Ne.length = Ee.length = 0,
  2299. _e = {},
  2300. ye.initialized = 0,
  2301. ye
  2302. }
  2303. ,
  2304. ye.init = function() {
  2305. if (!ye.initialized) {
  2306. ye.on(m);
  2307. var e = ["overflow", "position"]
  2308. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2309. He.save.apply(He, e),
  2310. Ye.save.apply(Ye, e),
  2311. Xe.save.apply(Xe, t),
  2312. je.save.apply(je, t);
  2313. var a = Se;
  2314. return we || (a = a.add(Pe),
  2315. be.css("overflow", "hidden"),
  2316. f || "static" !== be.css("position") || be.css("position", "relative")),
  2317. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2318. a.css({
  2319. position: "absolute"
  2320. })),
  2321. ge.forward && $e.on(S, se),
  2322. ge.backward && Qe.on(S, se),
  2323. ge.prev && Ze.on(B, se),
  2324. ge.next && Ge.on(B, se),
  2325. ge.prevPage && Je.on(B, se),
  2326. ge.nextPage && Ke.on(B, se),
  2327. Ue.on(C, le),
  2328. Be[0] && Be.on(B, ce),
  2329. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2330. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2331. We.on(P, {
  2332. source: "slidee"
  2333. }, te),
  2334. Se && Se.on(P, {
  2335. source: "handle"
  2336. }, te),
  2337. b.on("keydown", de),
  2338. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2339. be.on("scroll." + g, o)),
  2340. ye.initialized = 1,
  2341. H(!0),
  2342. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2343. ye
  2344. }
  2345. }
  2346. }
  2347. function i(e) {
  2348. 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
  2349. }
  2350. function r(e, t) {
  2351. e.preventDefault(),
  2352. t && e.stopPropagation()
  2353. }
  2354. function s(t) {
  2355. r(t, 1),
  2356. e(this).off(t.type, s)
  2357. }
  2358. function o() {
  2359. this.scrollLeft = 0,
  2360. this.scrollTop = 0
  2361. }
  2362. function l(e) {
  2363. return !isNaN(parseFloat(e)) && isFinite(e)
  2364. }
  2365. function c(e, t) {
  2366. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2367. }
  2368. function d(e, t, a) {
  2369. return t > e ? t : e > a ? a : e
  2370. }
  2371. function u(e) {
  2372. var t = {};
  2373. return t.style = {},
  2374. t.save = function() {
  2375. if (e && e.nodeType) {
  2376. for (var a = 0; a < arguments.length; a++)
  2377. t.style[arguments[a]] = e.style[arguments[a]];
  2378. return t
  2379. }
  2380. }
  2381. ,
  2382. t.restore = function() {
  2383. if (e && e.nodeType) {
  2384. for (var a in t.style)
  2385. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2386. return t
  2387. }
  2388. }
  2389. ,
  2390. t
  2391. }
  2392. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2393. b.on(C, function(e) {
  2394. var t = e.originalEvent[g]
  2395. , a = +new Date;
  2396. (!t || t.options.scrollHijack < a - O) && (O = a)
  2397. }),
  2398. function(e) {
  2399. function t(e) {
  2400. var t = (new Date).getTime()
  2401. , n = Math.max(0, 16 - (t - a))
  2402. , i = setTimeout(e, n);
  2403. return a = t,
  2404. i
  2405. }
  2406. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2407. var a = (new Date).getTime()
  2408. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2409. y = function(t) {
  2410. n.call(e, t)
  2411. }
  2412. }(window),
  2413. function() {
  2414. function e(e) {
  2415. for (var n = 0, i = t.length; i > n; n++) {
  2416. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2417. if (null != a.style[r])
  2418. return r
  2419. }
  2420. }
  2421. var t = ["", "webkit", "moz", "ms", "o"]
  2422. , a = document.createElement("div");
  2423. f = e("transform"),
  2424. v = e("perspective") ? "translateZ(0) " : ""
  2425. }(),
  2426. t[m] = n,
  2427. e.fn[h] = function(t, a) {
  2428. var r, s;
  2429. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2430. s = Array.prototype.slice.call(arguments, 1)),
  2431. t = {}),
  2432. this.each(function(i, o) {
  2433. var l = e.data(o, g);
  2434. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2435. })
  2436. }
  2437. ,
  2438. n.defaults = {
  2439. slidee: null,
  2440. horizontal: !1,
  2441. itemNav: null,
  2442. itemSelector: null,
  2443. smart: !1,
  2444. activateOn: null,
  2445. activateMiddle: !1,
  2446. scrollSource: null,
  2447. scrollBy: 0,
  2448. scrollHijack: 300,
  2449. scrollTrap: !1,
  2450. dragSource: null,
  2451. mouseDragging: !1,
  2452. touchDragging: !1,
  2453. releaseSwing: !1,
  2454. swingSpeed: .2,
  2455. elasticBounds: !1,
  2456. interactive: null,
  2457. scrollBar: null,
  2458. dragHandle: !1,
  2459. dynamicHandle: !1,
  2460. minHandleSize: 50,
  2461. clickBar: !1,
  2462. syncSpeed: .5,
  2463. pagesBar: null,
  2464. activatePageOn: null,
  2465. pageBuilder: function(e) {
  2466. return "<li>" + (e + 1) + "</li>"
  2467. },
  2468. forward: null,
  2469. backward: null,
  2470. prev: null,
  2471. next: null,
  2472. prevPage: null,
  2473. nextPage: null,
  2474. cycleBy: null,
  2475. cycleInterval: 5e3,
  2476. pauseOnHover: !1,
  2477. startPaused: !1,
  2478. moveBy: 300,
  2479. speed: 0,
  2480. easing: "swing",
  2481. startAt: null,
  2482. keyboardNavBy: null,
  2483. draggedClass: "dragged",
  2484. activeClass: "active",
  2485. disabledClass: "disabled"
  2486. }
  2487. }(jQuery, window);
  2488. !function e(t, i, n) {
  2489. function r(a, s) {
  2490. if (!i[a]) {
  2491. if (!t[a]) {
  2492. var l = "function" == typeof require && require;
  2493. if (!s && l)
  2494. return l(a, !0);
  2495. if (o)
  2496. return o(a, !0);
  2497. var c = new Error("Cannot find module '" + a + "'");
  2498. throw c.code = "MODULE_NOT_FOUND",
  2499. c
  2500. }
  2501. var h = i[a] = {
  2502. exports: {}
  2503. };
  2504. t[a][0].call(h.exports, function(e) {
  2505. var i = t[a][1][e];
  2506. return r(i ? i : e)
  2507. }, h, h.exports, e, t, i, n)
  2508. }
  2509. return i[a].exports
  2510. }
  2511. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2512. r(n[a]);
  2513. return r
  2514. }({
  2515. 1: [function(e, t, i) {
  2516. (function(i) {
  2517. "use strict";
  2518. function n(e) {
  2519. this.player = null,
  2520. this.director = null,
  2521. this.modelManager = null,
  2522. this.container = null,
  2523. this.tagManager = null,
  2524. this.fadeInSpeed = e,
  2525. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2526. }
  2527. var r = e("three")
  2528. , o = e("./util/logger")
  2529. , a = (e("./util/common"),
  2530. e("./enum/PlayerEvents"))
  2531. , s = e("./enum/DirectorEvents")
  2532. , l = e("./settings")
  2533. , c = e("./enum/Viewmode")
  2534. , h = (e("./enum/WarpStyle"),
  2535. e("./enum/BlackoutStyle"),
  2536. e("./enum/ModelManagerEvents"))
  2537. , u = e("./enum/tagEvents")
  2538. , d = e("./util/transitions")
  2539. , p = e("./util/lerp")
  2540. , f = new o(i);
  2541. window.THREE = r;
  2542. n.prototype.init = function(e, t, i, n, r) {
  2543. window.app = this;
  2544. this.player = t,
  2545. this.director = e,
  2546. this.modelManager = i,
  2547. this.tagManager = n,
  2548. this.container = r,
  2549. this.updateModel(),
  2550. this.bindEvents()
  2551. }
  2552. ,
  2553. n.prototype.bindEvents = function() {
  2554. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2555. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2556. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2557. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2558. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2559. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2560. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2561. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2562. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2563. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2564. }
  2565. ,
  2566. n.prototype.updateModel = function() {
  2567. //模型this.model
  2568. this.model = this.modelManager.getActiveModel()
  2569. }
  2570. ,
  2571. n.prototype.handleWarpStarted = function() {
  2572. this.hidePlayerReticule()
  2573. }
  2574. ,
  2575. n.prototype.ontagActivated = function() {
  2576. this.hidePlayerReticule()
  2577. }
  2578. ,
  2579. n.prototype.onNavigationTotag = function() {
  2580. this.hidePlayerReticule()
  2581. }
  2582. ,
  2583. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2584. var n = this.modelManager.getActiveModel()
  2585. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2586. n.fadePanoMarkers(r),
  2587. n.setMode(t)
  2588. }
  2589. ,
  2590. n.prototype.handlePlayerModeChanged = function(e, t) {
  2591. var i = this.modelManager.getActiveModel()
  2592. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2593. i.setSide(n),
  2594. i.setMode(t)
  2595. }
  2596. ,
  2597. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2598. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2599. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2600. }
  2601. ,
  2602. n.prototype.handleActionInterruption = function() {}
  2603. ,
  2604. n.prototype.handleStartInside = function(e) {
  2605. var t = l[this.player.mode]
  2606. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2607. this.fadeIn(this.fadeInSpeed),
  2608. this.model.alpha = 0,
  2609. this.model.skybox.material.uniforms.opacity.value = 1,
  2610. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2611. var n = this.player.reticule;
  2612. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2613. }
  2614. ,
  2615. n.prototype.handleStartOutside = function(e) {
  2616. this.fadeIn(e)
  2617. }
  2618. ,
  2619. n.prototype.fadeIn = function(e) {
  2620. null !== e && void 0 !== e || (e = 2e3,
  2621. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2622. $(this.container).fadeIn(e)
  2623. }
  2624. ,
  2625. n.prototype.hidePlayerReticule = function() {
  2626. this.player.reticule.hide()
  2627. }
  2628. ,
  2629. t.exports = n
  2630. }
  2631. ).call(this, "/js/DisplayController.js")
  2632. }
  2633. , {
  2634. "./enum/BlackoutStyle": 18,
  2635. "./enum/DirectorEvents": 23,
  2636. "./enum/tagEvents": 32,
  2637. "./enum/ModelManagerEvents": 33,
  2638. "./enum/PlayerEvents": 40,
  2639. "./enum/Viewmode": 51,
  2640. "./enum/WarpStyle": 52,
  2641. "./settings": 166,
  2642. "./util/common": 185,
  2643. "./util/lerp": 188,
  2644. "./util/logger": 189,
  2645. "./util/transitions": 195,
  2646. three: 217
  2647. }],
  2648. 2: [function(e, t, i) {
  2649. "use strict";
  2650. function n() {
  2651. this.baseStartTime = performance.timing.navigationStart,
  2652. this.loadingStartTime = null,
  2653. this.waitingStartTime = null,
  2654. this.appReadyTime = null
  2655. }
  2656. n.prototype.setBaseStartTime = function(e) {
  2657. this.baseStartTime = e || Date.now()
  2658. }
  2659. ,
  2660. n.prototype.setWaitingStartTime = function(e) {
  2661. this.waitingStartTime = e || Date.now()
  2662. }
  2663. ,
  2664. n.prototype.setLoadingStartTime = function(e) {
  2665. this.loadingStartTime = e || Date.now()
  2666. }
  2667. ,
  2668. n.prototype.setAppReadyTime = function(e) {
  2669. this.appReadyTime = e || Date.now()
  2670. }
  2671. ,
  2672. n.prototype.calcFullLoadingTime = function() {
  2673. var e = this.appReadyTime - this.baseStartTime;
  2674. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2675. e
  2676. }
  2677. ,
  2678. t.exports = n
  2679. }
  2680. , {}],
  2681. 3: [function(e, t, i) {
  2682. (function(i) {
  2683. "use strict";
  2684. function n() {
  2685. return 100 * Math.random()
  2686. }
  2687. var r = e("./util/logger")
  2688. , o = e("./util/browser")
  2689. , a = new r(i)
  2690. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2691. initialized: !1,
  2692. init: function(e, t) {
  2693. if (t = t || {},
  2694. !this.initialized) {
  2695. this.initialized = !0,
  2696. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2697. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2698. for (var i in e) {
  2699. var r = i.match("^sc_tilegen_([0-9]+)$");
  2700. r && (s.tilegen = n() < parseInt(r[1]));
  2701. var l = i.match("^sc_imgopt_([0-9]+)$");
  2702. l && (s.imgopt = n() < parseInt(l[1]))
  2703. }
  2704. for (var c in t)
  2705. s[c] = t[c],
  2706. a.debug("A/B override:", c, s[c])
  2707. }
  2708. },
  2709. changeIfTileGenerating: function(e) {
  2710. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2711. e += ""),
  2712. e
  2713. },
  2714. changeIfImageOptimzing: function(e) {
  2715. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2716. e += ""),
  2717. e
  2718. },
  2719. tilegen: !1,
  2720. imgopt: !1
  2721. };
  2722. t.exports = s
  2723. }
  2724. ).call(this, "/js/ab.js")
  2725. }
  2726. , {
  2727. "./util/browser": 182,
  2728. "./util/logger": 189
  2729. }],
  2730. 4: [function(e, t, i) {
  2731. (function(i) {
  2732. "use strict";
  2733. function n() {
  2734. return {
  2735. addons: [{
  2736. name: "keen:ua_parser",
  2737. input: {
  2738. ua_string: "user_agent"
  2739. },
  2740. output: "parsed_user_agent"
  2741. }]
  2742. }
  2743. }
  2744. function r(e, t, i, n) {
  2745. function r(t) {
  2746. l[t.sid] = !0;
  2747. var i = t.billboard.media && t.billboard.media.type
  2748. , n = {
  2749. tag_id: t.sid,
  2750. tags_visited: Object.keys(l).length,
  2751. tag_count: Object.keys(e.tags).length,
  2752. tag_view_count: ++E,
  2753. has_media: !!i
  2754. };
  2755. i && (n.media_type = i),
  2756. u("tag_opened", n)
  2757. }
  2758. var l = {}
  2759. , h = Date.now() - N
  2760. , f = null;
  2761. n && (f = Date.now() - window.navigationStart);
  2762. var g;
  2763. try {
  2764. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2765. } catch (e) {
  2766. g = !1
  2767. }
  2768. var v, A = e.supportsVR;
  2769. A || (v = "VR disabled at the model/account level",
  2770. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2771. u("model_loaded", {
  2772. duration: h,
  2773. duration_from_navigation_start: f,
  2774. has_hlr: g,
  2775. has_vr: A,
  2776. vr_reason: v
  2777. });
  2778. var I = 0;
  2779. e.panos.forEach(function(e) {
  2780. e.on("enter", function() {
  2781. c("pano_viewed", {
  2782. pano_id: e.id,
  2783. pano_view_count: ++I,
  2784. alignment_type: e.alignmentType,
  2785. interaction_source: O,
  2786. navigation_source: p
  2787. })
  2788. })
  2789. });
  2790. var E = 0;
  2791. for (var T in e.tags)
  2792. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2793. t.on("tour_auto", function(e) {
  2794. p = "tour_" + e
  2795. }),
  2796. t.on("tour_manual", function(e) {
  2797. O = "gui-" + e,
  2798. p = "tour_manual"
  2799. }),
  2800. i.on(C.InteractionKey, function() {
  2801. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2802. }),
  2803. i.on(C.InteractionDirect, function() {
  2804. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2805. }),
  2806. o(t),
  2807. a(),
  2808. s()
  2809. }
  2810. function o(e) {
  2811. I.on(T.OPENED, function() {
  2812. c("showcase_share_intent", {
  2813. pano_id: e.currentPano && e.currentPano.id
  2814. })
  2815. }),
  2816. I.on(T.LINK_CLICKED, function(t) {
  2817. c("showcase_share_action", {
  2818. channel: t.channel,
  2819. pano_id: e.currentPano && e.currentPano.id
  2820. })
  2821. }),
  2822. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2823. c("showcase_share_origin_link_clicked")
  2824. })
  2825. }
  2826. function a() {}
  2827. function s() {
  2828. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2829. gui_action: "click_vr_button"
  2830. })),
  2831. b.on(S.LAUNCH, function(e) {
  2832. c("showcase_gui", {
  2833. gui_action: "launch_vr",
  2834. vr_platform: e.vr_platform,
  2835. vr_app: e.vr_app
  2836. })
  2837. }),
  2838. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2839. gui_action: "vr_modal_prev"
  2840. })),
  2841. b.on(S.NEXT, function(e) {
  2842. c("showcase_gui", {
  2843. gui_action: e.nextAction
  2844. })
  2845. }),
  2846. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2847. gui_action: "vr_modal_close"
  2848. })),
  2849. b.on(S.falseICECHOSEN, function(e) {
  2850. c("showcase_gui", {
  2851. gui_action: e.name + " "
  2852. })
  2853. }),
  2854. b.on(S.STORE, function(e) {
  2855. c("showcase_gui", {
  2856. gui_action: "launch_store",
  2857. store: e
  2858. })
  2859. })
  2860. }
  2861. function l(e, t) {
  2862. if (f)
  2863. try {
  2864. f.addEvent(e, v.extendObject({
  2865. host: window.location.host,
  2866. keen: n(),
  2867. user_agent: "${keen.user_agent}",
  2868. referrer: {
  2869. url: v.normalizeUrl(document.referrer),
  2870. domain: v.domainFromUrl(document.referrer),
  2871. url_original: document.referrer
  2872. },
  2873. embedded: m.inIframe(),
  2874. is_mobile: m.isMobile(),
  2875. version: "2.25.6-0-gd87e5b1"
  2876. }, t))
  2877. } catch (e) {
  2878. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2879. }
  2880. }
  2881. function c(e, t) {
  2882. if (t = t || {},
  2883. L)
  2884. try {
  2885. window.analytics.track(e, v.extendObject(t, B), {
  2886. context: {
  2887. app: {
  2888. name: "showcase",
  2889. version: "2.25.6-0-gd87e5b1"
  2890. },
  2891. screen: {
  2892. width: window.screen.width,
  2893. height: window.screen.height,
  2894. density: window.devicePixelRatio
  2895. }
  2896. }
  2897. })
  2898. } catch (t) {
  2899. console.warn("Failed to send data to segment for " + e)
  2900. }
  2901. }
  2902. function h(e, t) {
  2903. if (t = t || {},
  2904. navigator.sendBeacon && L)
  2905. try {
  2906. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2907. event: e,
  2908. anonymousId: window.analytics.user().anonymousId(),
  2909. properties: v.extendObject(t, B),
  2910. writeKey: L,
  2911. sentAt: Date.now(),
  2912. type: "track",
  2913. context: {
  2914. userAgent: m.userAgent(),
  2915. library: {
  2916. name: "showcase-beacon",
  2917. version: "2.25.6-0-gd87e5b1"
  2918. },
  2919. app: {
  2920. name: "showcase",
  2921. version: "2.25.6-0-gd87e5b1"
  2922. }
  2923. }
  2924. }))
  2925. } catch (e) {
  2926. console.warn("Failed to send async segment request")
  2927. }
  2928. }
  2929. function u(e, t) {
  2930. t = t || {},
  2931. c(e, t)
  2932. }
  2933. function d(e, t) {
  2934. O = e === C.InteractionGui ? "gui-" + t : e,
  2935. p = "self_guided"
  2936. }
  2937. var p, f, g = (e("three"),
  2938. e("./util/ajax"),
  2939. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2940. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2941. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2942. t.exports = {
  2943. report: function(e, t, i, n) {
  2944. l("Session starts", {
  2945. model: e,
  2946. status: t,
  2947. loadtime: Date.now() - (N || Date.now()),
  2948. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2949. autoplay: i,
  2950. quickstart: n,
  2951. ab_tilegen: g.tilegen,
  2952. ab_imgopt: g.imgopt
  2953. })
  2954. },
  2955. impression: function(e) {
  2956. e = e || {};
  2957. var t = void 0 === e.isVisible || e.isVisible
  2958. , i = (void 0 !== e.immediate && e.immediate,
  2959. window.location.search.substr(1).split("&"));
  2960. u("impression", {
  2961. visible: t,
  2962. url_params: i
  2963. })
  2964. },
  2965. initKeen: function(e) {
  2966. return e.token && e.appId ? void (f = new Keen({
  2967. projectId: e.appId,
  2968. writeKey: e.token,
  2969. readKey: "",
  2970. requestType: "xhr"
  2971. })) : void P.warn("no keen token/appId")
  2972. },
  2973. initSegment: function(e) {
  2974. return e.token ? (L = e.token,
  2975. window.analytics.load(e.token),
  2976. B = {
  2977. model_id: e.model,
  2978. start_source: e.startSource,
  2979. autoplay: e.autoplay,
  2980. quickstart: e.quickstart,
  2981. language_tag: A.languageTag,
  2982. is_mobile: m.isMobile(),
  2983. iframe: m.inIframe(),
  2984. aspect_ratio: m.aspectRatio(),
  2985. session_id: F,
  2986. window: {
  2987. width: $("#player").width(),
  2988. height: $("#player").height()
  2989. },
  2990. platform: {
  2991. browser: {
  2992. name: $.ua.browser.name,
  2993. major: $.ua.browser.major,
  2994. version: $.ua.browser.version
  2995. },
  2996. os: {
  2997. name: $.ua.os.name,
  2998. version: $.ua.os.version
  2999. },
  3000. device: {
  3001. vendor: $.ua.device.vendor,
  3002. model: $.ua.device.model,
  3003. type: $.ua.device.type
  3004. }
  3005. }
  3006. },
  3007. D = Math.random() < A.analytics.sessionTrackingRate,
  3008. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  3009. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  3010. },
  3011. sessionStart: function(e) {
  3012. P.debug("analytics user_session_start"),
  3013. c("session_started"),
  3014. N = Date.now(),
  3015. window.addEventListener("unload", function() {
  3016. h("session_ended", {
  3017. duration: Date.now() - N
  3018. })
  3019. })
  3020. },
  3021. modelLoaded: function(e, t, i, n) {
  3022. r(e, t, i, n)
  3023. },
  3024. loadComplete: function(e) {
  3025. var t = {
  3026. time_to_app_start: e
  3027. };
  3028. c("load_times", t)
  3029. },
  3030. track: function(e, t) {
  3031. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3032. c(e, t))
  3033. },
  3034. trackAlways: function(e, t) {
  3035. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3036. c(e, t)
  3037. },
  3038. getSessionId: function() {
  3039. return F
  3040. },
  3041. updateInteraction: d
  3042. }
  3043. }
  3044. ).call(this, "/js/analytics.js")
  3045. }
  3046. , {
  3047. "./ab": 3,
  3048. "./enum/ControlEvents": 21,
  3049. "./enum/PlayerEvents": 40,
  3050. "./enum/VROption": 47,
  3051. "./enum/VRPlatforms": 49,
  3052. "./enum/Viewmode": 51,
  3053. "./gui/sharing/ShareEvents": 76,
  3054. "./gui/sharing/modal": 77,
  3055. "./gui/title/TitleEvents": 80,
  3056. "./gui/title/titleBar": 82,
  3057. "./gui/vr/vrEvent": 85,
  3058. "./gui/vr/vrModal": 87,
  3059. "./localization/localize": 108,
  3060. "./tag/Billboard/BillboardEvent": 120,
  3061. "./settings": 166,
  3062. "./util/ajax": 181,
  3063. "./util/browser": 182,
  3064. "./util/common": 185,
  3065. "./util/logger": 189,
  3066. three: 217
  3067. }],
  3068. 5: [function(e, t, i) {
  3069. "use strict";
  3070. function n() {
  3071. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3072. this.controls = null
  3073. }
  3074. var r = e("three")
  3075. , o = e("../constants")
  3076. , a = e("../util/cameraLight");
  3077. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3078. n.prototype.updateAspect = function(e) {
  3079. this.aspect = e,
  3080. this.updateProjectionMatrix()
  3081. }
  3082. ,
  3083. t.exports = n
  3084. }
  3085. , {
  3086. "../constants": 8,
  3087. "../util/cameraLight": 184,
  3088. three: 217
  3089. }],
  3090. 6: [function(e, t, i) {
  3091. "use strict";
  3092. function n() {
  3093. var e = $("#player").width() / $("#player").height();
  3094. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3095. this.controls = null,
  3096. this.updateAspect(e)
  3097. }
  3098. var r = e("three")
  3099. , o = e("../constants");
  3100. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3101. n.prototype.updateAspect = function(e) {
  3102. this.aspect = e,
  3103. this.top = o.orthoBase / e,
  3104. this.bottom = -o.orthoBase / e,
  3105. this.updateProjectionMatrix()
  3106. }
  3107. ,
  3108. t.exports = n
  3109. }
  3110. , {
  3111. "../constants": 8,
  3112. three: 217
  3113. }],
  3114. 7: [function(e, t, i) {
  3115. "use strict";
  3116. function n() {
  3117. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3118. this.controls = null
  3119. }
  3120. var r = e("three")
  3121. , o = e("../settings")
  3122. , a = e("../util/cameraLight");
  3123. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3124. n.prototype.updateAspect = function(e) {
  3125. this.aspect = e,
  3126. this.updateProjectionMatrix()
  3127. }
  3128. ,
  3129. t.exports = n
  3130. }
  3131. , {
  3132. "../settings": 166,
  3133. "../util/cameraLight": 184,
  3134. three: 217
  3135. }],
  3136. 8: [function(e, t, i) {
  3137. "use strict";
  3138. t.exports = {
  3139. signedUrlDefaultExpireTime: 24e4,
  3140. signedUrlCheckInterval: 1e4,
  3141. signedUrlRefreshBuffer: 15e3,
  3142. dollhouseFOV: 70,
  3143. dollhouseNear: 1,
  3144. dollhouseFar: 5e3,
  3145. insideFOV: 70,
  3146. insideFOVMax: 120,
  3147. insideNear: .1,
  3148. insideFar: 5e3,
  3149. insideLookSpeed: .12,
  3150. insideLookLimitUp: 40,
  3151. insideLookLimitDown: -40,
  3152. orthoNear: 1,
  3153. orthoFar: 5e3,
  3154. orthoBase: 10,
  3155. narrowLandscapeHeight: 290,
  3156. reallyNarrowLandscapeHeight: 250,
  3157. visionTilingStartDate: new Date("8/26/2016"),
  3158. visionTilingStartVersion: "1.1.407.13667",
  3159. windowHeightHighQualityThreshold: 900,
  3160. tourStepDelayDefault: 3500,
  3161. tourStepDelaySlideShow: 5e3,
  3162. workshopApsect: 9 / 16,
  3163. highQualityMaxZoom: 2,
  3164. ultraHighQualityMaxZoom: 3
  3165. }
  3166. }
  3167. , {}],
  3168. 9: [function(e, t, i) {
  3169. "use strict";
  3170. function n() {
  3171. this.activeControl = null,
  3172. this.controls = {},
  3173. this.cameras = {}
  3174. }
  3175. var r = e("./PanoramaControls")
  3176. , o = e("./DollhouseControls")
  3177. , a = e("./FloorplanControls")
  3178. , s = e("../cameras/PanoramaCamera")
  3179. , l = e("../cameras/DollhouseCamera")
  3180. , c = e("../cameras/FloorplanCamera")
  3181. , h = e("events").EventEmitter
  3182. , u = e("../enum/ControlEvents")
  3183. , d = e("../enum/ModelManagerEvents")
  3184. , p = e("../enum/Viewmode")
  3185. , f = e("../settings");
  3186. n.prototype = Object.create(h.prototype),
  3187. n.prototype.init = function(e, t) {
  3188. this.setUpControls(),
  3189. this.bindEvents(e, t)
  3190. }
  3191. ,
  3192. n.prototype.activateControls = function(e) {
  3193. this.activeControl && (this.activeControl.reset(),
  3194. this.activeControl.enabled = !1),
  3195. this.controls[e] && (this.controls[e].enabled = !0),
  3196. this.activeControl = this.controls[e]
  3197. }
  3198. ,
  3199. n.prototype.setUpControls = function() {
  3200. var e = {}
  3201. , t = {}
  3202. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3203. , n = [s, l, c]
  3204. , h = [r, o, a];
  3205. i.forEach(function(i, r) {
  3206. e[i] = new n[r],
  3207. t[i] = new h[r](e[i]),
  3208. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3209. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3210. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3211. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3212. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3213. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3214. }
  3215. .bind(this)),
  3216. this.controls = t,
  3217. this.cameras = e
  3218. }
  3219. ,
  3220. n.prototype.bindEvents = function(e, t) {
  3221. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3222. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3223. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3224. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3225. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3226. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3227. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3228. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3229. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3230. e.addEventListener("contextmenu", function(e) {
  3231. e.preventDefault()
  3232. }),
  3233. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3234. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3235. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3236. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3237. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3238. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3239. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3240. t.on(d.ActiveModelChanged, function(e) {
  3241. this.setModelForControls(e.model)
  3242. }
  3243. .bind(this))
  3244. }
  3245. ,
  3246. n.prototype.setModelForControls = function(e) {
  3247. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3248. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3249. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3250. this.controls[e].setBounds(t)
  3251. }
  3252. .bind(this))
  3253. }
  3254. ,
  3255. n.prototype.onMouseDown = function(e) {
  3256. e.preventDefault(),
  3257. this.activeControl && this.activeControl.onMouseDown(e)
  3258. }
  3259. ,
  3260. n.prototype.onMouseMove = function(e) {
  3261. e.preventDefault(),
  3262. this.activeControl && this.activeControl.onMouseMove(e)
  3263. }
  3264. ,
  3265. n.prototype.onMouseUp = function(e) {
  3266. e.preventDefault(),
  3267. this.activeControl && this.activeControl.onMouseUp(e)
  3268. }
  3269. ,
  3270. n.prototype.onMouseOver = function(e) {
  3271. e.preventDefault(),
  3272. this.activeControl && this.activeControl.onMouseOver(e)
  3273. }
  3274. ,
  3275. n.prototype.onMouseWheel = function(e) {
  3276. e.preventDefault(),
  3277. this.activeControl && this.activeControl.onMouseWheel(e)
  3278. }
  3279. ,
  3280. n.prototype.onTouchStart = function(e) {
  3281. e.preventDefault(),
  3282. this.activeControl && this.activeControl.onTouchStart(e);
  3283. var hotList = $('#hotListWrap')[0];
  3284. hotList.classList.remove('hotListActive');
  3285. $('#hotListContent ul .active').removeClass('active');
  3286. $('#hotList')[0].classList.remove('active')
  3287. }
  3288. ,
  3289. n.prototype.onTouchMove = function(e) {
  3290. e.preventDefault(),
  3291. this.activeControl && this.activeControl.onTouchMove(e)
  3292. }
  3293. ,
  3294. n.prototype.onTouchEnd = function(e) {
  3295. e.preventDefault(),
  3296. this.activeControl && this.activeControl.onTouchEnd(e)
  3297. }
  3298. ,
  3299. n.prototype.onPointerDown = function(e) {
  3300. if (e.preventDefault(),
  3301. this.activeControl)
  3302. switch (e.pointerType) {
  3303. case "mouse":
  3304. this.activeControl.onMouseDown(e);
  3305. break;
  3306. default:
  3307. this.activeControl.onPointerDown(e)
  3308. }
  3309. }
  3310. ,
  3311. n.prototype.onPointerMove = function(e) {
  3312. if (e.preventDefault(),
  3313. this.activeControl)
  3314. switch (e.pointerType) {
  3315. case "mouse":
  3316. this.activeControl.onMouseMove(e);
  3317. break;
  3318. default:
  3319. this.activeControl.onPointerMove(e)
  3320. }
  3321. }
  3322. ,
  3323. n.prototype.onPointerUp = function(e) {
  3324. if (e.preventDefault(),
  3325. this.activeControl)
  3326. switch (e.pointerType) {
  3327. case "mouse":
  3328. this.activeControl.onMouseUp(e);
  3329. break;
  3330. default:
  3331. this.activeControl.onPointerUp(e)
  3332. }
  3333. }
  3334. ,
  3335. n.prototype.onPointerCancel = function(e) {
  3336. e.preventDefault(),
  3337. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3338. }
  3339. ,
  3340. n.prototype.onKeyDown = function(e) {
  3341. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3342. this.activeControl && this.activeControl.onKeyDown(e))
  3343. }
  3344. ,
  3345. n.prototype.onKeyUp = function(e) {
  3346. e.preventDefault(),
  3347. this.activeControl && this.activeControl.onKeyUp(e)
  3348. }
  3349. ,
  3350. t.exports = n
  3351. }
  3352. , {
  3353. "../cameras/DollhouseCamera": 5,
  3354. "../cameras/FloorplanCamera": 6,
  3355. "../cameras/PanoramaCamera": 7,
  3356. "../enum/ControlEvents": 21,
  3357. "../enum/ModelManagerEvents": 33,
  3358. "../enum/Viewmode": 51,
  3359. "../settings": 166,
  3360. "./DollhouseControls": 10,
  3361. "./FloorplanControls": 11,
  3362. "./PanoramaControls": 13,
  3363. events: 202
  3364. }],
  3365. 10: [function(e, t, i) {
  3366. "use strict";
  3367. function n(e) {
  3368. a.call(this, e),
  3369. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3370. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3371. this.minDistance = o.dollhouseDefault.minDistance,
  3372. this.maxDistance = o.dollhouseDefault.maxDistance,
  3373. this.adjustedMinDistance = this.minDistance,
  3374. this.adjustedMaxDistance = this.maxDistance
  3375. }
  3376. var r = e("three")
  3377. , o = e("../settings")
  3378. , a = e("./OutsideControls");
  3379. n.prototype = Object.create(a.prototype),
  3380. n.prototype.pan = function(e, t) {
  3381. this.camera.updateMatrix();
  3382. var i = this.camera.position.clone().sub(this.target).length();
  3383. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3384. this.panLeft(2 * e * i / $("#player").height()),
  3385. this.panUp(-2 * t * i / $("#player").height())
  3386. }
  3387. ,
  3388. n.prototype.updateZoom = function() {
  3389. var e = this.offset.length();
  3390. return e * this.scale
  3391. }
  3392. ,
  3393. n.prototype.setZoomBounds = function(e) {
  3394. var t = e.min.distanceTo(e.max);
  3395. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3396. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3397. this.minDistance = this.adjustedMinDistance,
  3398. this.maxDistance = this.adjustedMaxDistance
  3399. }
  3400. ,
  3401. n.prototype.resetRanges = function(e, t) {
  3402. e ? (this.minDistance = Math.min(e, this.minDistance),
  3403. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3404. this.maxDistance = this.adjustedMaxDistance),
  3405. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3406. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3407. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3408. }
  3409. ,
  3410. n.prototype.toJSON = function() {
  3411. return a.prototype.toJSON.call(this)
  3412. }
  3413. ,
  3414. t.exports = n
  3415. }
  3416. , {
  3417. "../settings": 166,
  3418. "./OutsideControls": 12,
  3419. three: 217
  3420. }],
  3421. 11: [function(e, t, i) {
  3422. "use strict";
  3423. function n(e) {
  3424. a.call(this, e),
  3425. this.minDistance = 15,
  3426. this.maxDistance = 50,
  3427. this.noRotateUpDown = !0,
  3428. this.minPolarAngle = 0,
  3429. this.maxPolarAngle = 0,
  3430. this.mouseActions[l.LEFT] = s.PAN,
  3431. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3432. this.mouseActions[l.RIGHT] = s.ROTATE,
  3433. this.touchActions[1] = s.PAN,
  3434. this.touchActions[2] = s.ROTATE_DOLLY,
  3435. this.absoluteScale = 1,
  3436. this.currentScale = 1
  3437. }
  3438. var r = e("three")
  3439. , o = e("../settings")
  3440. , a = e("./OutsideControls")
  3441. , s = e("../enum/ControlActions")
  3442. , l = e("../enum/MouseButton")
  3443. , c = e("../util/math")
  3444. , h = e("../util/browser");
  3445. n.prototype = Object.create(a.prototype),
  3446. n.prototype.zoomToContain = function(e) {
  3447. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3448. this.currentScale = this.absoluteScale
  3449. }
  3450. ,
  3451. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3452. var t = Math.max(modelSize.x, modelSize.z)
  3453. , i = Math.min(modelSize.x, modelSize.z)
  3454. , n = Math.max(t, i * this.camera.aspect)
  3455. , r = Math.max(i, t * this.camera.aspect);
  3456. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3457. return absoluteScale
  3458. },
  3459. n.prototype.rotateToView = function(e, t) {
  3460. var i = 0
  3461. , n = h.aspectRatio() < 1
  3462. , r = e.x < e.z;
  3463. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3464. this.rotateLeft(i),
  3465. this.update(0)
  3466. }
  3467. ,
  3468. n.prototype.pan = function(e, t) {
  3469. this.camera.updateMatrix(),
  3470. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3471. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3472. }
  3473. ,
  3474. n.prototype.updateZoom = function() {
  3475. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3476. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3477. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3478. this.camera.left = -o.orthoBase * this.currentScale,
  3479. this.camera.right = o.orthoBase * this.currentScale,
  3480. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3481. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3482. this.camera.updateProjectionMatrix(),
  3483. this.offset.length()
  3484. }
  3485. ,
  3486. n.prototype.toJSON = function() {
  3487. var e = new r.Quaternion
  3488. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3489. , i = new r.Quaternion;
  3490. return function() {
  3491. var n = a.prototype.toJSON.call(this);
  3492. return e.copy(n.camera_quaternion),
  3493. i.copy(t),
  3494. i.multiply(e),
  3495. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3496. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3497. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3498. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3499. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3500. n
  3501. }
  3502. }(),
  3503. t.exports = n
  3504. }
  3505. , {
  3506. "../enum/ControlActions": 20,
  3507. "../enum/MouseButton": 34,
  3508. "../settings": 166,
  3509. "../util/browser": 182,
  3510. "../util/math": 190,
  3511. "./OutsideControls": 12,
  3512. three: 217
  3513. }],
  3514. 12: [function(e, t, i) {
  3515. "use strict";
  3516. function n(e) {
  3517. this.camera = e,
  3518. this.camera.controls = this,
  3519. this.enabled = !1,
  3520. this.target = new r.Vector3,
  3521. this.targetBounds = new r.Box3,
  3522. this.zoomSpeed = 1,
  3523. this.minDistance = 0,
  3524. this.maxDistance = 1 / 0,
  3525. this.noRotateUpDown = !1,
  3526. this.rotateSpeed = 1,
  3527. this.keyboardZoomSpeed = 0,
  3528. this.keyPanSpeed = 7,
  3529. this.autoRotate = !1,
  3530. this.autoRotateSpeed = 2,
  3531. this.autoPan = !1,
  3532. this.autoPanPosition = new r.Vector3,
  3533. this.minPolarAngle = r.Math.degToRad(25),
  3534. this.maxPolarAngle = r.Math.degToRad(65),
  3535. this.rotationAcceleration = new r.Vector2,
  3536. this.rotationSpeed = new r.Vector2,
  3537. this.panAcceleration = new r.Vector2,
  3538. this.panSpeed = new r.Vector2,
  3539. this.rotateStart = new r.Vector2,
  3540. this.rotateEnd = new r.Vector2,
  3541. this.rotateDelta = new r.Vector2,
  3542. this.panStart = new r.Vector2,
  3543. this.panEnd = new r.Vector2,
  3544. this.panDelta = new r.Vector2,
  3545. this.panOffset = new r.Vector3,
  3546. this.offset = new r.Vector3,
  3547. this.dollyStart = new r.Vector2,
  3548. this.dollyEnd = new r.Vector2,
  3549. this.dollyDelta = new r.Vector2,
  3550. this.phiDelta = 0,
  3551. this.thetaDelta = 0,
  3552. this.scale = 1,
  3553. this.panVector = new r.Vector3,
  3554. this.lastPosition = new r.Vector3,
  3555. this.state = c.NONE,
  3556. this.mouseActions = {},
  3557. this.mouseActions[h.LEFT] = c.ROTATE,
  3558. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3559. this.mouseActions[h.RIGHT] = c.PAN,
  3560. this.touchActions = {},
  3561. this.touchActions[1] = c.ROTATE,
  3562. this.touchActions[2] = c.PAN_DOLLY,
  3563. this.lastMoveTime = 0,
  3564. this.pointersLimit = 2,
  3565. this.pointers = []
  3566. }
  3567. var r = e("three")
  3568. , o = e("../settings")
  3569. , a = e("../util/common")
  3570. , s = e("../util/math")
  3571. , l = e("../enum/Vectors")
  3572. , c = e("../enum/ControlActions")
  3573. , h = e("../enum/MouseButton")
  3574. , u = e("../enum/Keys")
  3575. , d = e("../enum/ControlEvents")
  3576. , p = e("events").EventEmitter
  3577. , f = 1e-6;
  3578. n.prototype = Object.create(p.prototype),
  3579. n.prototype.setBounds = function(e) {
  3580. this.targetBounds = e
  3581. }
  3582. ,
  3583. n.prototype.isEngaged = function() {
  3584. return this.state !== c.NONE
  3585. }
  3586. ,
  3587. n.prototype.rotateLeft = function(e) {
  3588. void 0 === e && (e = this.getAutoRotationAngle()),
  3589. this.thetaDelta -= e
  3590. }
  3591. ,
  3592. n.prototype.rotateUp = function(e) {
  3593. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3594. this.phiDelta -= e)
  3595. }
  3596. ,
  3597. n.prototype.panLeft = function(e) {
  3598. var t = this.camera.matrix.elements;
  3599. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3600. this.panOffset.multiplyScalar(-e),
  3601. this.panVector.add(this.panOffset)
  3602. }
  3603. ,
  3604. n.prototype.panUp = function(e) {
  3605. var t = this.camera.matrix.elements;
  3606. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3607. this.panOffset.multiplyScalar(-e),
  3608. this.panVector.add(this.panOffset)
  3609. }
  3610. ,
  3611. n.prototype.startRotating = function(e, t) {
  3612. e && this.navRotationAcc("x", e),
  3613. t && this.navRotationAcc("y", t)
  3614. }
  3615. ,
  3616. n.prototype.stopRotating = function(e) {
  3617. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3618. this.navRotationAcc("x", 0),
  3619. this.navRotationAcc("y", 0)
  3620. }
  3621. ,
  3622. n.prototype.setAutoPanPosition = function(e, t) {
  3623. var i = new r.Vector3
  3624. , n = new r.Vector3;
  3625. return function(e, t) {
  3626. i.copy(this.camera.position),
  3627. void 0 === e && null === e || i.setX(e),
  3628. void 0 === t && null === t || i.setZ(t);
  3629. var r = this.camera.position.distanceTo(this.target)
  3630. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3631. this.targetClamped = !1,
  3632. n.copy(i).addScaledVector(o, r),
  3633. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3634. i.copy(n).addScaledVector(o, -r),
  3635. this.targetClamped = !0),
  3636. this.autoPanPosition.x = i.x,
  3637. this.autoPanPosition.z = i.z,
  3638. this.autoPan && this.stopAutoPanning()
  3639. }
  3640. }(),
  3641. n.prototype.stopAutoPanning = function() {
  3642. var e = this.autoPan;
  3643. this.autoPan = !1,
  3644. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3645. }
  3646. ,
  3647. n.prototype.dollyIn = function(e) {
  3648. void 0 === e && (e = this.getZoomScale()),
  3649. this.scale /= e
  3650. }
  3651. ,
  3652. n.prototype.dollyOut = function(e) {
  3653. void 0 === e && (e = this.getZoomScale()),
  3654. this.scale *= e
  3655. }
  3656. ,
  3657. n.prototype.updatePan = function(e) {
  3658. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3659. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3660. this.autoPan) {
  3661. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3662. t.setY(0).clampLength(0, 50 * e),
  3663. this.target.add(t),
  3664. this.camera.position.add(t),
  3665. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3666. this.stopAutoPanning())
  3667. }
  3668. }
  3669. ,
  3670. n.prototype.update = function(e) {
  3671. e || (e = 1 / 60),
  3672. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3673. this.rotateLeft(-this.rotationSpeed.x),
  3674. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3675. this.updatePan(e);
  3676. var t = this.camera.position;
  3677. this.offset.copy(t).sub(this.target);
  3678. var i = Math.atan2(this.offset.x, this.offset.z)
  3679. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3680. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3681. i += this.thetaDelta,
  3682. n += this.phiDelta,
  3683. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3684. n = Math.max(f, Math.min(Math.PI - f, n));
  3685. var r = this.updateZoom();
  3686. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3687. this.target.add(this.panVector),
  3688. this.targetBounds.clampPoint(this.target, this.target),
  3689. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3690. this.offset.y = r * Math.cos(n),
  3691. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3692. t.copy(this.target).add(this.offset),
  3693. this.camera.lookAt(this.target),
  3694. this.thetaDelta = 0,
  3695. this.phiDelta = 0,
  3696. this.scale = 1,
  3697. this.panVector.set(0, 0, 0),
  3698. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3699. }
  3700. ,
  3701. n.prototype.getAutoRotationAngle = function() {
  3702. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3703. }
  3704. ,
  3705. n.prototype.getZoomScale = function() {
  3706. return Math.pow(.95, this.zoomSpeed)
  3707. }
  3708. ,
  3709. n.prototype.onMouseDown = function(e) {
  3710. if (this.enabled) {
  3711. switch (e.preventDefault(),
  3712. this.stopAutoPanning(),
  3713. this.mouseDown = !0,
  3714. this.state = this.mouseActions[e.button],
  3715. this.state) {
  3716. case c.ROTATE:
  3717. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3718. this.rotationSpeed.set(0, 0);
  3719. break;
  3720. case c.DOLLY:
  3721. this.dollyStart.set(e.clientX, e.clientY);
  3722. break;
  3723. case c.PAN:
  3724. this.panStart.set(e.clientX, e.clientY)
  3725. }
  3726. this.emit(d.InputStart, "mouse")
  3727. }
  3728. }
  3729. ,
  3730. n.prototype.onMouseMove = function(e) {
  3731. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3732. switch (e.preventDefault(),
  3733. this.state) {
  3734. case c.ROTATE:
  3735. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3736. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3737. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3738. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3739. this.rotateStart.copy(this.rotateEnd);
  3740. break;
  3741. case c.DOLLY:
  3742. this.dollyEnd.set(e.clientX, e.clientY),
  3743. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3744. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3745. t.call(this),
  3746. this.dollyStart.copy(this.dollyEnd);
  3747. break;
  3748. case c.PAN:
  3749. this.panEnd.set(e.clientX, e.clientY),
  3750. this.panDelta.subVectors(this.panEnd, this.panStart),
  3751. this.pan(this.panDelta.x, this.panDelta.y),
  3752. this.panStart.copy(this.panEnd)
  3753. }
  3754. this.emit(d.Move, "mouse"),
  3755. this.lastMoveTime = e.timeStamp,
  3756. this.update()
  3757. }
  3758. }
  3759. ,
  3760. n.prototype.onMouseUp = function(e) {
  3761. this.enabled && (this.mouseDown = !1,
  3762. this.state = c.NONE,
  3763. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3764. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3765. this.update(),
  3766. this.rotationAcceleration.set(0, 0),
  3767. this.rotateDelta.set(0, 0)))
  3768. }
  3769. ,
  3770. n.prototype.onMouseOver = function(e) {
  3771. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3772. }
  3773. ,
  3774. n.prototype.onMouseWheel = function(e) {
  3775. if (this.enabled && o.useWheel) {
  3776. this.emit(d.Move, "wheel");
  3777. var t = e.wheelDelta || -e.detail
  3778. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3779. i.call(this),
  3780. this.update()
  3781. }
  3782. }
  3783. ,
  3784. n.prototype.onKeyDown = function(e) {
  3785. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3786. this.handleKeyDown(e.which)))
  3787. }
  3788. ,
  3789. n.prototype.navRotationAcc = function(e, t) {
  3790. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3791. }
  3792. ,
  3793. n.prototype.navPanAcc = function(e, t) {
  3794. this.stopAutoPanning(),
  3795. this.panAcceleration[e] = t
  3796. }
  3797. ,
  3798. n.prototype.handleKeyDown = function(e) {
  3799. var t = !0;
  3800. switch (e) {
  3801. case u.UPARROW:
  3802. case u.I:
  3803. this.navRotationAcc("y", 1);
  3804. break;
  3805. case u.DOWNARROW:
  3806. case u.K:
  3807. this.navRotationAcc("y", -1);
  3808. break;
  3809. case u.LEFTARROW:
  3810. case u.J:
  3811. this.navRotationAcc("x", -1);
  3812. break;
  3813. case u.RIGHTARROW:
  3814. case u.L:
  3815. this.navRotationAcc("x", 1);
  3816. break;
  3817. case u.W:
  3818. this.navPanAcc("y", 1);
  3819. break;
  3820. case u.S:
  3821. this.navPanAcc("y", -1);
  3822. break;
  3823. case u.A:
  3824. this.navPanAcc("x", -1);
  3825. break;
  3826. case u.D:
  3827. this.navPanAcc("x", 1);
  3828. break;
  3829. default:
  3830. t = !1
  3831. }
  3832. t && this.emit(d.Move, "key")
  3833. }
  3834. ,
  3835. n.prototype.onKeyUp = function(e) {
  3836. this.enabled && (e.preventDefault(),
  3837. e.stopPropagation(),
  3838. this.handleKeyUp(e.which))
  3839. }
  3840. ,
  3841. n.prototype.handleKeyUp = function(e) {
  3842. switch (e) {
  3843. case u.I:
  3844. case u.K:
  3845. case u.UPARROW:
  3846. case u.DOWNARROW:
  3847. this.keyboardZoomSpeed = 0,
  3848. this.rotationAcceleration.y = 0;
  3849. break;
  3850. case u.J:
  3851. case u.L:
  3852. case u.LEFTARROW:
  3853. case u.RIGHTARROW:
  3854. this.rotationAcceleration.x = 0;
  3855. break;
  3856. case u.S:
  3857. case u.W:
  3858. this.panAcceleration.y = 0;
  3859. break;
  3860. case u.A:
  3861. case u.D:
  3862. this.panAcceleration.x = 0
  3863. }
  3864. }
  3865. ,
  3866. n.prototype.onTouchStart = function(e) {
  3867. if (this.enabled || this.state === c.NONE) {
  3868. e.preventDefault(),
  3869. e.stopPropagation(),
  3870. this.stopAutoPanning();
  3871. var t = function() {
  3872. if (2 === e.touches.length) {
  3873. var t = e.touches[0].pageX - e.touches[1].pageX
  3874. , i = e.touches[0].pageY - e.touches[1].pageY;
  3875. this.dollyStart.set(t, i)
  3876. }
  3877. }
  3878. .bind(this)
  3879. , i = function() {
  3880. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3881. }
  3882. .bind(this)
  3883. , n = function() {
  3884. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3885. }
  3886. .bind(this);
  3887. switch (this.state = this.touchActions[e.touches.length],
  3888. this.state) {
  3889. case c.PAN_DOLLY:
  3890. t();
  3891. case c.PAN:
  3892. i();
  3893. break;
  3894. case c.ROTATE_DOLLY:
  3895. t();
  3896. case c.ROTATE:
  3897. n()
  3898. }
  3899. this.rotationSpeed.set(0, 0),
  3900. this.emit(d.InputStart, "touch")
  3901. }
  3902. }
  3903. ,
  3904. n.prototype.onTouchMove = function(e) {
  3905. if (this.enabled && this.state !== c.NONE) {
  3906. e.preventDefault(),
  3907. e.stopPropagation();
  3908. var t = function() {
  3909. var t = e.touches[0].pageX - e.touches[1].pageX
  3910. , i = e.touches[0].pageY - e.touches[1].pageY;
  3911. this.dollyEnd.set(t, i);
  3912. var n = this.dollyStart.length() - this.dollyEnd.length();
  3913. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3914. this.dollyStart.copy(this.dollyEnd)
  3915. }
  3916. .bind(this)
  3917. , i = function() {
  3918. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3919. this.panDelta.subVectors(this.panEnd, this.panStart),
  3920. this.pan(this.panDelta.x, this.panDelta.y),
  3921. this.panStart.copy(this.panEnd),
  3922. this.rotateDelta.set(0, 0)
  3923. }
  3924. .bind(this)
  3925. , n = function() {
  3926. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3927. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3928. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3929. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3930. this.rotateStart.copy(this.rotateEnd)
  3931. }
  3932. .bind(this)
  3933. , r = function() {
  3934. if (2 === e.touches.length) {
  3935. var i = window.devicePixelRatio || 1
  3936. , r = e.touches[1].pageX - e.touches[0].pageX
  3937. , s = e.touches[1].pageY - e.touches[0].pageY
  3938. , l = Math.sqrt(r * r + s * s)
  3939. , h = Math.abs(this.dollyStart.length() - l);
  3940. if (h > o.input.touchMoveThreshold * i)
  3941. this.state = c.DOLLY,
  3942. t();
  3943. else {
  3944. var u = a.average(e.touches, "pageX")
  3945. , d = a.average(e.touches, "pageY")
  3946. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3947. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3948. this.rotateStart.set(u, d),
  3949. n())
  3950. }
  3951. }
  3952. }
  3953. .bind(this);
  3954. switch (this.state) {
  3955. case c.PAN_DOLLY:
  3956. t();
  3957. case c.PAN:
  3958. i();
  3959. break;
  3960. case c.ROTATE_DOLLY:
  3961. r();
  3962. break;
  3963. case c.DOLLY:
  3964. t();
  3965. break;
  3966. case c.ROTATE:
  3967. n();
  3968. break;
  3969. default:
  3970. this.state = c.NONE
  3971. }
  3972. this.lastMoveTime = e.timeStamp,
  3973. this.emit(d.Move, "touch")
  3974. }
  3975. }
  3976. ,
  3977. n.prototype.onTouchEnd = function(e) {
  3978. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3979. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3980. this.state = c.NONE,
  3981. this.update(),
  3982. this.rotationAcceleration.set(0, 0),
  3983. this.rotateDelta.set(0, 0))
  3984. }
  3985. ,
  3986. n.prototype.onPointerDown = function(e) {
  3987. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3988. id: e.pointerId,
  3989. pageX: e.pageX,
  3990. pageY: e.pageY
  3991. }),
  3992. e.touches = this.pointers,
  3993. this.onTouchStart(e)),
  3994. this.emit(d.InputStart, "pointer"))
  3995. }
  3996. ,
  3997. n.prototype.onPointerMove = function(e) {
  3998. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3999. e.pointerId === t.id && (t.pageX = e.pageX,
  4000. t.pageY = e.pageY)
  4001. }),
  4002. e.touches = this.pointers,
  4003. this.onTouchMove(e))
  4004. }
  4005. ,
  4006. n.prototype.onPointerUp = function(e) {
  4007. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4008. e.pointerId === t.id && this.pointers.splice(i, 1)
  4009. }
  4010. .bind(this)),
  4011. e.touches = this.pointers,
  4012. this.onTouchEnd(e))
  4013. }
  4014. ,
  4015. n.prototype.reset = function() {
  4016. this.state = c.NONE,
  4017. this.stopAutoPanning(),
  4018. this.rotationSpeed.set(0, 0),
  4019. this.rotationAcceleration.set(0, 0),
  4020. this.panSpeed.set(0, 0),
  4021. this.panAcceleration.set(0, 0)
  4022. }
  4023. ,
  4024. n.prototype.toJSON = function() {
  4025. var e = {
  4026. camera_position: {
  4027. x: s.toPrecision(this.camera.position.x, 4),
  4028. y: s.toPrecision(this.camera.position.y, 4),
  4029. z: s.toPrecision(this.camera.position.z, 4)
  4030. },
  4031. camera_quaternion: {
  4032. x: s.toPrecision(this.camera.quaternion.x, 4),
  4033. y: s.toPrecision(this.camera.quaternion.y, 4),
  4034. z: s.toPrecision(this.camera.quaternion.z, 4),
  4035. w: s.toPrecision(this.camera.quaternion.w, 4)
  4036. }
  4037. };
  4038. return e
  4039. }
  4040. ,
  4041. t.exports = n
  4042. }
  4043. , {
  4044. "../enum/ControlActions": 20,
  4045. "../enum/ControlEvents": 21,
  4046. "../enum/Keys": 30,
  4047. "../enum/MouseButton": 34,
  4048. "../enum/Vectors": 50,
  4049. "../settings": 166,
  4050. "../util/common": 185,
  4051. "../util/math": 190,
  4052. events: 202,
  4053. three: 217
  4054. }],
  4055. 13: [function(e, t, i) {
  4056. (function(i) {
  4057. "use strict";
  4058. function n(e) {
  4059. this.camera = e,
  4060. this.camera.controls = this,
  4061. this.target = new r.Vector3(0,0,0),
  4062. this.lookVector = new r.Vector3,
  4063. this.lookSpeed = .05,
  4064. this.rotationAcc = new r.Vector2,
  4065. this.rotationSpeed = new r.Vector2,
  4066. this.lat = 0,
  4067. this.lon = 0,
  4068. this.phi = 0,
  4069. this.theta = 0,
  4070. this.enabled = !1,
  4071. this.locked = !1,
  4072. this.pointer = new r.Vector2(0,0),
  4073. this.rotationHistory = [],
  4074. this.rotationDifference = new r.Vector2,
  4075. this.pointerDragOn = !1,
  4076. this.pointerDragStart = new r.Vector2(0,0),
  4077. this.pinchDistance = 0,
  4078. this.moveStart = new r.Vector2,
  4079. this.moveTolerance = .01,
  4080. this.pointersLimit = 2,
  4081. this.pointers = []
  4082. }
  4083. var r = e("three")
  4084. , o = e("../util/logger")
  4085. , a = e("../settings")
  4086. , s = e("../util/common")
  4087. , l = e("../util/math")
  4088. , c = (e("../enum/Vectors"),
  4089. e("../enum/MouseButton"))
  4090. , h = e("../enum/Keys")
  4091. , u = e("../enum/ControlEvents")
  4092. , d = e("events").EventEmitter;
  4093. new o(i);
  4094. n.prototype = Object.create(d.prototype),
  4095. n.prototype.usable = function() {
  4096. return this.enabled && !this.locked
  4097. }
  4098. ,
  4099. n.prototype.lookAt = function(e) {
  4100. var t = this.camera.position.clone().sub(e)
  4101. , i = Math.atan(t.z / t.x);
  4102. i += t.x < 0 ? Math.PI : 0,
  4103. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4104. this.lon = r.Math.radToDeg(i) + 180;
  4105. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4106. , o = Math.atan(t.y / n);
  4107. this.lat = -r.Math.radToDeg(o)
  4108. }
  4109. ,
  4110. n.prototype.startRotationFrom = function(e, t) {
  4111. l.convertScreenPositionToNDC(e, t, this.pointer),
  4112. this.pointerDragOn = !0,
  4113. this.pointerDragStart.copy(this.pointer),
  4114. this.moveStart.copy(this.pointer),
  4115. this.rotationHistory = [],
  4116. this.rotationSpeed.set(0, 0)
  4117. }
  4118. ,
  4119. n.prototype.onMouseOver = function(e) {
  4120. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4121. }
  4122. ,
  4123. n.prototype.onTouchStart = function(e) {
  4124. if (this.usable()) {
  4125. switch (e.preventDefault(),
  4126. e.stopPropagation(),
  4127. e.touches.length) {
  4128. case 1:
  4129. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4130. break;
  4131. case 2:
  4132. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4133. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4134. this.pinchDistance = Math.sqrt(t * t + i * i)
  4135. }
  4136. this.emit(u.InputStart, "touch")
  4137. }
  4138. }
  4139. ,
  4140. n.prototype.onPointerDown = function(e) {
  4141. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4142. id: e.pointerId,
  4143. clientX: e.clientX,
  4144. clientY: e.clientY
  4145. }),
  4146. e.touches = this.pointers,
  4147. this.onTouchStart(e),
  4148. this.emit(u.InputStart, "pointer"))
  4149. }
  4150. ,
  4151. n.prototype.onMouseDown = function(e) {
  4152. if (this.usable()) {
  4153. switch (e.preventDefault(),
  4154. e.stopPropagation(),
  4155. e.button) {
  4156. case c.LEFT:
  4157. this.startRotationFrom(e.clientX, e.clientY)
  4158. }
  4159. this.emit(u.InputStart, "mouse")
  4160. }
  4161. }
  4162. ,
  4163. n.prototype.updateRotation = function() {
  4164. if (this.usable() && this.pointerDragOn) {
  4165. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4166. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4167. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4168. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4169. , o = Math.atan2(e.y, i)
  4170. , a = Math.atan2(t.y, n);
  4171. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4172. e.y = 0,
  4173. t.y = 0;
  4174. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4175. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4176. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4177. this.pointerDragStart.copy(this.pointer)
  4178. }
  4179. }
  4180. ,
  4181. n.prototype.onMouseMove = function(e) {
  4182. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4183. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4184. }
  4185. ,
  4186. n.prototype.onTouchMove = function(e) {
  4187. if (this.usable())
  4188. switch (this.emit(u.Move, "touch"),
  4189. e.touches.length) {
  4190. case 1:
  4191. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4192. break;
  4193. case 2:
  4194. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4195. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4196. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4197. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4198. this.emit(u.Pinch, n),
  4199. this.pinchDistance -= n)
  4200. }
  4201. }
  4202. ,
  4203. n.prototype.onPointerMove = function(e) {
  4204. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4205. e.pointerId === t.id && (t.clientX = e.clientX,
  4206. t.clientY = e.clientY)
  4207. }),
  4208. e.touches = this.pointers,
  4209. this.onTouchMove(e))
  4210. }
  4211. ,
  4212. n.prototype.endRotation = function() {
  4213. this.pointerDragOn = !1;
  4214. var e = s.averageVectors(this.rotationHistory);
  4215. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4216. }
  4217. ,
  4218. n.prototype.onTouchEnd = function(e) {
  4219. this.usable() && (e.preventDefault(),
  4220. e.stopPropagation(),
  4221. this.endRotation())
  4222. }
  4223. ,
  4224. n.prototype.onMouseUp = function(e) {
  4225. this.usable() && (e.preventDefault(),
  4226. e.stopPropagation(),
  4227. this.endRotation())
  4228. }
  4229. ,
  4230. n.prototype.onPointerUp = function(e) {
  4231. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4232. e.pointerId === t.id && this.pointers.splice(i, 1)
  4233. }
  4234. .bind(this)),
  4235. e.touches = this.pointers,
  4236. this.onTouchEnd(e))
  4237. }
  4238. ,
  4239. n.prototype.update = function(e) {
  4240. this.lon,
  4241. this.lat;
  4242. for (this.updateRotation(),
  4243. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4244. this.rotationHistory.shift();
  4245. this.lon += this.rotationDifference.x,
  4246. this.lat += this.rotationDifference.y,
  4247. this.rotationDifference.set(0, 0),
  4248. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4249. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4250. this.lon += this.rotationSpeed.x * e,
  4251. this.lat += this.rotationSpeed.y * e,
  4252. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4253. this.phi = r.Math.degToRad(90 - this.lat),
  4254. this.theta = r.Math.degToRad(this.lon),
  4255. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4256. this.lookVector.y = Math.cos(this.phi),
  4257. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4258. this.target.copy(this.lookVector).add(this.camera.position),
  4259. this.camera.lookAt(this.target)
  4260. }
  4261. ,
  4262. n.prototype.onMouseWheel = function(e) {
  4263. if (this.usable()) {
  4264. var t = e.wheelDelta || -e.detail;
  4265. this.emit(u.InteractionDirect),
  4266. this.emit(u.Scroll, t)
  4267. }
  4268. }
  4269. ,
  4270. n.prototype.onKeyDown = function(e) {
  4271. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4272. this.handleKeyDown(e.which)))
  4273. }
  4274. ,
  4275. n.prototype.handleKeyDown = function(e) {
  4276. var t = function(e, t) {
  4277. this.rotationAcc[e] = t
  4278. }
  4279. .bind(this);
  4280. this.emit(u.InteractionKey);
  4281. var i = !0;
  4282. switch (e) {
  4283. case h.LEFTARROW:
  4284. case h.J:
  4285. t("x", -1);
  4286. break;
  4287. case h.RIGHTARROW:
  4288. case h.L:
  4289. t("x", 1);
  4290. break;
  4291. case h.I:
  4292. t("y", 1);
  4293. break;
  4294. case h.K:
  4295. t("y", -1);
  4296. break;
  4297. default:
  4298. i = !1
  4299. }
  4300. i && this.emit(u.Move, "key")
  4301. }
  4302. ,
  4303. n.prototype.onKeyUp = function(e) {
  4304. this.usable() && (e.preventDefault(),
  4305. e.stopPropagation(),
  4306. this.handleKeyUp(e.which))
  4307. }
  4308. ,
  4309. n.prototype.handleKeyUp = function(e) {
  4310. switch (e) {
  4311. case h.LEFTARROW:
  4312. case h.J:
  4313. case h.RIGHTARROW:
  4314. case h.L:
  4315. this.rotationAcc.x = 0;
  4316. break;
  4317. case h.I:
  4318. case h.K:
  4319. this.rotationAcc.y = 0
  4320. }
  4321. }
  4322. ,
  4323. n.prototype.startRotating = function(e, t) {
  4324. e && (this.rotationAcc.x = e),
  4325. t && (this.rotationAcc.y = t)
  4326. }
  4327. ,
  4328. n.prototype.stopRotating = function(e) {
  4329. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4330. this.rotationAcc.set(0, 0)
  4331. }
  4332. ,
  4333. n.prototype.reset = function() {
  4334. this.pointerDragOn = !1,
  4335. this.rotationAcc.set(0, 0),
  4336. this.rotationSpeed.set(0, 0),
  4337. this.pointers = []
  4338. }
  4339. ,
  4340. n.prototype.toJSON = function() {
  4341. var e = {
  4342. camera_position: {
  4343. x: l.toPrecision(this.camera.position.x, 4),
  4344. y: l.toPrecision(this.camera.position.y, 4),
  4345. z: l.toPrecision(this.camera.position.z, 4)
  4346. },
  4347. camera_quaternion: {
  4348. x: l.toPrecision(this.camera.quaternion.x, 4),
  4349. y: l.toPrecision(this.camera.quaternion.y, 4),
  4350. z: l.toPrecision(this.camera.quaternion.z, 4),
  4351. w: l.toPrecision(this.camera.quaternion.w, 4)
  4352. }
  4353. };
  4354. return e
  4355. }
  4356. ,
  4357. n.prototype.setStateFromJSON = function(e) {
  4358. this.camera.position.copy(e.camera_position),
  4359. this.camera.quaternion.copy(e.camera_quaternion)
  4360. }
  4361. ,
  4362. t.exports = n
  4363. }
  4364. ).call(this, "/js/controls/PanoramaControls.js")
  4365. }
  4366. , {
  4367. "../enum/ControlEvents": 21,
  4368. "../enum/Keys": 30,
  4369. "../enum/MouseButton": 34,
  4370. "../enum/Vectors": 50,
  4371. "../settings": 166,
  4372. "../util/common": 185,
  4373. "../util/logger": 189,
  4374. "../util/math": 190,
  4375. events: 202,
  4376. three: 217
  4377. }],
  4378. 14: [function(e, t, i) {
  4379. (function(i) {
  4380. "use strict";
  4381. var n = e("three")
  4382. , r = e("../enum/Viewmode")
  4383. , o = e("../util/logger")
  4384. , a = new o(i);
  4385. t.exports = {
  4386. serialize: function(e) {
  4387. return encodeURI(JSON.stringify(e))
  4388. },
  4389. deserialize: function(e) {
  4390. function t(e) {
  4391. function t(e, t) {
  4392. return e && "number" == typeof t && !isNaN(t)
  4393. }
  4394. return e.reduce(t, !0)
  4395. }
  4396. try {
  4397. var i = JSON.parse(decodeURI(e))
  4398. , o = {
  4399. mode: r.fromInt(i.camera_mode),
  4400. panoId: i.scan_id,
  4401. position: (new n.Vector3).copy(i.camera_position),
  4402. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4403. zoom: i.ortho_zoom,
  4404. floorVisibility: i.floor_visibility
  4405. }
  4406. , s = o.position;
  4407. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4408. var l = o.quaternion;
  4409. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4410. o
  4411. } catch (i) {
  4412. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4413. try {
  4414. var c = e.split(",")
  4415. , h = {
  4416. x: parseFloat(c[2]),
  4417. y: parseFloat(c[3]),
  4418. z: parseFloat(c[4])
  4419. }
  4420. , u = {
  4421. x: parseFloat(c[5]),
  4422. y: parseFloat(c[6]),
  4423. z: parseFloat(c[7]),
  4424. w: parseFloat(c[8])
  4425. };
  4426. return t([h.x, h.y, h.z]) || (h.x = 0,
  4427. h.y = 0,
  4428. h.z = 0),
  4429. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4430. u.y = 0,
  4431. u.z = 0,
  4432. u.w = 1),
  4433. {
  4434. mode: r.fromInt(c[0]),
  4435. panoId: c[1],
  4436. position: (new n.Vector3).copy(h),
  4437. quaternion: (new n.Quaternion).copy(u)
  4438. }
  4439. } catch (t) {
  4440. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4441. }
  4442. }
  4443. return null
  4444. }
  4445. }
  4446. }
  4447. ).call(this, "/js/controls/serializer.js")
  4448. }
  4449. , {
  4450. "../enum/Viewmode": 51,
  4451. "../util/logger": 189,
  4452. three: 217
  4453. }],
  4454. 15: [function(e, t, i) {
  4455. (function(i) {
  4456. "use strict";
  4457. function n() {
  4458. this.endlessLoop = a.warp.loop,
  4459. this.clock = new r.Clock(!0),
  4460. this.model = null,
  4461. this.player = null,
  4462. this.currentItem = null,
  4463. this.destinationItem = null,
  4464. this.tourIsPlaying = !1,
  4465. this.transitionStage = y.None,
  4466. this.nextFunc = null,
  4467. this.onTheBus = !1,
  4468. this.tourInProgress = !1,
  4469. this.reachSource = null,
  4470. this.interrupted = !1,
  4471. this.nItems = 0,
  4472. this.walkingSectionPaused = !1
  4473. }
  4474. var r = e("three")
  4475. , o = e("./util/logger")
  4476. , a = e("./settings")
  4477. , s = e("./util/transitions")
  4478. , l = e("events").EventEmitter
  4479. , c = e("./enum/Viewmode")
  4480. , h = e("./analytics")
  4481. , u = e("./enum/WarpStyle")
  4482. , s = e("./util/transitions")
  4483. , d = (e("./model/ModelManager"),
  4484. e("./enum/ModelManagerEvents"))
  4485. , p = e("./enum/DirectorEvents")
  4486. , f = e("./enum/PlayerEvents")
  4487. , g = (e("./enum/ControlEvents"),
  4488. e("./enum/BlackoutStyle"))
  4489. , m = e("./enum/PathDiscardMode")
  4490. , v = e("./enum/PathDisplayMode")
  4491. , A = (e("./player"),
  4492. new o(i))
  4493. , y = Object.freeze({
  4494. None: 0,
  4495. Moving: 1,
  4496. Aiming: 2,
  4497. Interlude: 3
  4498. })
  4499. , C = Object.freeze({
  4500. Forward: 1,
  4501. NoChange: 0,
  4502. Backwards: -1
  4503. })
  4504. , I = s.getUniqueId();
  4505. n.prototype = Object.create(l.prototype),
  4506. n.prototype.init = function(e, t) {
  4507. this.player = e,
  4508. this.modelManager = t,
  4509. this.updateModel(),
  4510. this.resetAll(),
  4511. this.bindEvents()
  4512. }
  4513. ,
  4514. n.prototype.resetAll = function() {
  4515. if (this.currentItem = null,
  4516. this.destinationItem = null,
  4517. this.tourIsPlaying = !1,
  4518. this.bgmReplay(),//xzw
  4519. this.transitionStage = y.None,
  4520. this.nextFunc = null,
  4521. this.onTheBus = !1,
  4522. this.reachSource = null,
  4523. this.interrupted = !1,
  4524. this.model) {
  4525. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4526. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4527. } else
  4528. this.defaultWarpStyle = u.BLACK,
  4529. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4530. this.resetSpecialTransition()
  4531. }
  4532. ,
  4533. n.prototype.updateModel = function() {
  4534. this.model = this.modelManager.getActiveModel(),
  4535. this.nItems = this.model.heroLocations.length
  4536. }
  4537. ,
  4538. n.prototype.bindEvents = function() {
  4539. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4540. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4541. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4542. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4543. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4544. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4545. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4546. this.player.once(f.Move, function() {
  4547. s.cancelById(I)
  4548. })
  4549. }
  4550. ,
  4551. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4552. return e === u.WALK && (this.interrupt(g.NONE),
  4553. this.pauseWalkingSection(),
  4554. this.player.fastForwardActivePanoFlight(),
  4555. !0)
  4556. }
  4557. ,
  4558. n.prototype.handlePlayerMove = function(e) {
  4559. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4560. this.emit("update.controls")
  4561. }
  4562. ,
  4563. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4564. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4565. this.emit("update.controls"))
  4566. }
  4567. ,
  4568. n.prototype.handlePlayerModeChanged = function(e, t) {
  4569. this.intermediateState() || e === t || (this.onTheBus = !1,
  4570. this.emit("update.controls"))
  4571. }
  4572. ,
  4573. n.prototype.handlePlayerInputStart = function(e) {
  4574. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4575. }
  4576. ,
  4577. n.prototype.handlePlayerFlyingStarted = function() {
  4578. this.clearWalkingSectionPaused()
  4579. }
  4580. ,
  4581. n.prototype.describe = function() {
  4582. return {
  4583. nItems: this.nItems,
  4584. currentItem: this.currentItem,
  4585. destinationItem: this.destinationItem,
  4586. tourIsPlaying: this.tourIsPlaying,
  4587. onTheBus: this.onTheBus,
  4588. endlessLoop: this.endlessLoop,
  4589. viewMode: this.player.mode,
  4590. inTransition: this._inTransition(),
  4591. transitionStage: this.transitionStage,
  4592. tourInProgress: this.tourInProgress
  4593. }
  4594. }
  4595. ,
  4596. n.prototype._inTransition = function() {
  4597. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4598. }
  4599. ,
  4600. n.prototype.bounceable = function() {
  4601. var e = this.clock.getDelta();
  4602. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4603. }
  4604. ,
  4605. n.prototype.currentMoveDirection = function() {
  4606. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4607. }
  4608. ,
  4609. n.prototype.clearPath = function() {
  4610. this._inTransition() || this.player.path.discardPathObject()
  4611. }
  4612. ,
  4613. n.prototype.allFloors = function() {
  4614. this.model.toggleAllFloors()
  4615. }
  4616. ,
  4617. n.prototype.actionComplete = function(e) {
  4618. if (this.interrupted = !1,
  4619. this.transitionStage = y.None,
  4620. this.resetSpecialTransition(),
  4621. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4622. this.tourIsPlaying || (this.player.disablePreRendering(),
  4623. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4624. this.emit("update.controls"),
  4625. this.nextFunc) {
  4626. var t = this.nextFunc;
  4627. this.nextFunc = null,
  4628. t()
  4629. }
  4630. }
  4631. ,
  4632. n.prototype.awaitCompletion = function(e, t) {
  4633. this.nextFunc = t,
  4634. e()
  4635. }
  4636. ,
  4637. n.prototype.updateSuccessFunction = function(e) {
  4638. this.nextFunc = e
  4639. }
  4640. ,
  4641. n.prototype.interrupt = function(e, t) {
  4642. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4643. this.tourIsPlaying = !1,
  4644. this.bgmReplay(),//xzw
  4645. this.interrupted = !0,
  4646. this.nextFunc = null,
  4647. this.emit(p.ActionInterrupted),
  4648. null !== e && void 0 !== e || (e = g.BEGINNING),
  4649. this.player.interruptAndFastForward(e, t),
  4650. !0)
  4651. }
  4652. ,
  4653. n.prototype.wouldInterrupt = function() {
  4654. return this.transitionStage !== y.None
  4655. }
  4656. ,
  4657. n.prototype.intermediateState = function() {
  4658. return this.transitionStage !== y.None
  4659. }
  4660. ,
  4661. n.prototype.isInterrupted = function() {
  4662. return this.interrupted
  4663. }
  4664. ,
  4665. n.prototype.pauseWalkingSection = function() {
  4666. this.walkingSectionPaused = !0
  4667. }
  4668. ,
  4669. n.prototype.clearWalkingSectionPaused = function() {
  4670. this.walkingSectionPaused = !1
  4671. }
  4672. ,
  4673. n.prototype.autoTour = function() {
  4674. var e = Date.now();
  4675. this.model.auxDataPromise.then(function() {
  4676. e = Date.now() - e;
  4677. var t = a.warp.auto
  4678. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4679. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4680. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4681. done: function() {
  4682. this.playTour()
  4683. }
  4684. .bind(this),
  4685. name: "_atr",
  4686. id: I
  4687. })
  4688. }
  4689. .bind(this))
  4690. }
  4691. ,
  4692. n.prototype.atDestinationPano = function() {
  4693. if (!this.player.currentPano || null === this.destinationItem)
  4694. return !1;
  4695. var e = this.player.currentPano.id;
  4696. if (void 0 === e)
  4697. return !1;
  4698. var t = this.model.heroLocations;
  4699. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4700. }
  4701. ,
  4702. n.prototype.redirectToItem = function(e, t) {
  4703. if (null === e || void 0 === e)
  4704. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4705. if (!this.wouldInterrupt())
  4706. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4707. if (this.player.mode === c.TRANSITIONING)
  4708. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4709. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4710. var i = function() {
  4711. s.setTimeout(function() {
  4712. this.setDestinationItem(e),
  4713. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4714. }
  4715. .bind(this), 0)
  4716. }
  4717. .bind(this);
  4718. this.interrupt(g.END, 0),
  4719. this.updateSuccessFunction(i)
  4720. }
  4721. ,
  4722. n.prototype.useSpecialTransition = function(e) {
  4723. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4724. this.nextWarpStyle = u.BLACK
  4725. }
  4726. ,
  4727. n.prototype.resetSpecialTransition = function() {
  4728. this.nextWarpStyle = this.defaultWarpStyle
  4729. }
  4730. ,
  4731. n.prototype.arrivedAtDestination = function(e) {
  4732. if (this.player.flying || this.player.isWarping())
  4733. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4734. else {
  4735. this.transitionStage = y.Aiming;
  4736. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4737. this.player.model.fadePanoMarkers(0),
  4738. this.awaitCompletion(function() {
  4739. this.resetSpecialTransition(),
  4740. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4741. }
  4742. .bind(this), t)
  4743. }
  4744. }
  4745. ,
  4746. n.prototype.goToDestination = function(e, t, i, n) {
  4747. if(typeof g_data2.tourAudio !== 'undefined' && g_data2.tourAudio !== null){
  4748. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4749. if(tM && tM.music.length > 0){
  4750. var s = tM.music.includes(g_Prefix.slice(-10)) ? tM.music : g_Prefix + tM.music;
  4751. g_tourAudio.src = manage.dealURL(s);
  4752. g_tourAudio.load();
  4753. g_tourAudio.crossOrigin = "anonymous"
  4754. g_tourAudio.oncanplaythrough = function() {
  4755. g_tourAudio.play();
  4756. //$("#volume").addClass("unable")
  4757. if(g_bgAudio && !g_bgAudio.paused){
  4758. manage.switchBgmState(false);
  4759. g_bgAudio.pauseByTour = true
  4760. }
  4761. g_playAudio = g_tourAudio;
  4762. }
  4763. }
  4764. };
  4765. if (this.onTheBus = !0,
  4766. this.emit("update.controls"),
  4767. this.player.updateLastView(),
  4768. !n && this.atDestinationPano())
  4769. return void this.arrivedAtDestination(!0);
  4770. if (this.player.flying || this.player.isWarping())
  4771. A.warn("Cannot go to new destination while player is flying or warping.");
  4772. else {
  4773. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4774. , o = null
  4775. , a = null;
  4776. if (r.isPano()) {
  4777. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4778. //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  4779. var s = window.MP_PREFETCHED_MODELDATA.momentTour || 'walk';
  4780. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4781. o = this.arrivedAtDestination.bind(this, !0)
  4782. } else
  4783. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4784. o = this.arrivedAtDestination.bind(this, !1);
  4785. this.transitionStage = y.Moving,
  4786. this.model.fadePanoMarkers(0),
  4787. this.awaitCompletion(function() {
  4788. a();
  4789. }
  4790. .bind(this), o),
  4791. this.emit("update.controls")
  4792. }
  4793. }
  4794. ,
  4795. n.prototype.tourInterlude = function() {
  4796. if (h.trackAlways("reach_highlight", {
  4797. reach_source: this.reachSource
  4798. }),
  4799. this.model.fadePanoMarkers(0),
  4800. this.emit("update.controls"),
  4801. this.tourIsPlaying)
  4802. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4803. this.stopTour(true),
  4804. this.emit(p.TourEnd),
  4805. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4806. this.transitionStage = y.Interlude,
  4807. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4808. }
  4809. .bind(this), this.goNext.bind(this))
  4810. }
  4811. ,
  4812. n.prototype.playTour = function() {
  4813. if (!this.bounceable())
  4814. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4815. this.tourInProgress = !0,
  4816. this.reachSource = "play",
  4817. this.tourIsPlaying = !0,
  4818. this.wasZoomEnabled = this.player.zoomEnabled,
  4819. this.player.zoomEnabled = !1,
  4820. this.resetSpecialTransition(),
  4821. this.emit("update.controls"),
  4822. this.emit(p.TourStart),
  4823. this.player.enablePreRendering(),
  4824. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4825. this.goToDestination()) : this.goNext()))
  4826. }
  4827. ,
  4828. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4829. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4830. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4831. g_playAudio = g_bgAudio;
  4832. g_tourAudio && g_tourAudio.pause();
  4833. //window.tourAudio && window.tourAudio.pause();
  4834. manage.switchBgmState(true);
  4835. }
  4836. }
  4837. ,
  4838. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4839. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4840. this.tourIsPlaying = !1,
  4841. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4842. this.interrupt(),
  4843. this.clearWalkingSectionPaused(),
  4844. this.resetSpecialTransition(),
  4845. this.emit("update.controls"))
  4846. //window.tourAudio && window.tourAudio.pause();
  4847. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4848. {
  4849. g_tourAudio.pause();
  4850. g_tourAudio.src = ""
  4851. }
  4852. }
  4853. ,
  4854. n.prototype.endTourProgress = function() {
  4855. this.tourInProgress = !1,
  4856. this.emit("update.controls"),
  4857. this.emit(p.TourEnd)
  4858. }
  4859. ,
  4860. n.prototype.goToHighlight = function(e) {
  4861. if (this.wouldInterrupt())
  4862. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4863. else {
  4864. if (A.debug("<tour.goto " + e + ">"),
  4865. this.isInterrupted())
  4866. return;
  4867. this.clearWalkingSectionPaused(),
  4868. this.setDestinationItem(e),
  4869. this.useSpecialTransition("Hilight"),
  4870. this.goToDestination(),
  4871. h.trackAlways("reach_highlight", {
  4872. reach_source: "thumb"
  4873. })
  4874. }
  4875. }
  4876. ,
  4877. n.prototype.prevHighlight = function() {
  4878. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4879. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4880. this.reachSource = "prev",
  4881. this.goPrev()))
  4882. }
  4883. ,
  4884. n.prototype.nextHighlight = function() {
  4885. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4886. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4887. this.reachSource = "next",
  4888. this.goNext()))
  4889. }
  4890. ,
  4891. n.prototype.changeMode = function(e) {
  4892. var t = $.Deferred()
  4893. , i = t.resolve.bind(t)
  4894. , n = t.reject.bind(t);
  4895. this.emit(p.StartModeChange);
  4896. var r = function() {
  4897. return this.clearWalkingSectionPaused(),
  4898. !!this.wouldInterrupt() && (this.interrupt(),
  4899. !0)
  4900. }
  4901. .bind(this);
  4902. if (!r()) {
  4903. switch (e) {
  4904. case c.PANORAMA:
  4905. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4906. break;
  4907. case c.DOLLHOUSE:
  4908. case c.FLOORPLAN:
  4909. this.player.flyToNewMode({
  4910. mode: e
  4911. }).done(i).fail(n);
  4912. break;
  4913. case c.OUTDOOR:
  4914. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4915. }
  4916. return t.promise()
  4917. }
  4918. }
  4919. ,
  4920. n.prototype.atEndOfTour = function() {
  4921. var e = this.currentItem >= this.nItems - 1;
  4922. return e
  4923. }
  4924. ,
  4925. n.prototype.firstDestination = function() {
  4926. return this.nItems > 0 ? 0 : null
  4927. }
  4928. ,
  4929. n.prototype.finalDestination = function() {
  4930. return this.nItems > 0 ? this.nItems - 1 : null
  4931. }
  4932. ,
  4933. n.prototype.goPrev = function() {
  4934. this.tourAdvance(-1)
  4935. }
  4936. ,
  4937. n.prototype.goNext = function() {
  4938. this.tourAdvance(1)
  4939. }
  4940. ,
  4941. n.prototype.setDestinationItem = function(e) {
  4942. this.destinationItem = e,
  4943. this.emit("update.controls")
  4944. }
  4945. ,
  4946. n.prototype.setCurrentItem = function(e) {
  4947. this.currentItem = e,
  4948. this.emit("update.controls")
  4949. }
  4950. ,
  4951. n.prototype.nextItem = function(e) {
  4952. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4953. }
  4954. ,
  4955. n.prototype.prevItem = function(e) {
  4956. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4957. }
  4958. ,
  4959. n.prototype.tourAdvance = function(e) {
  4960. A.debug("tourAdvance(" + e + ")"),
  4961. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4962. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4963. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4964. this.useSpecialTransition("looping back to start"));
  4965. // 方奕卓 瞬间过渡, 相机缩放至1
  4966. if(window.MP_PREFETCHED_MODELDATA.momentTour === 'black') {
  4967. var zoomLevel = this.player.zoomLevel;
  4968. this.player.zoomEnabled = true;
  4969. var zoom = function(e, d) {
  4970. this.player.zoomTo((1-e)*zoomLevel, true)
  4971. }.bind(this)
  4972. s.start(zoom, 1500, function(){
  4973. }, 0, d.easeOutQuad, "zoom")
  4974. }
  4975. this.goToDestination()
  4976. }
  4977. ,
  4978. t.exports = n
  4979. }
  4980. ).call(this, "/js/director.js")
  4981. }
  4982. , {
  4983. "./analytics": 4,
  4984. "./enum/BlackoutStyle": 18,
  4985. "./enum/ControlEvents": 21,
  4986. "./enum/DirectorEvents": 23,
  4987. "./enum/ModelManagerEvents": 33,
  4988. "./enum/PathDiscardMode": 38,
  4989. "./enum/PathDisplayMode": 39,
  4990. "./enum/PlayerEvents": 40,
  4991. "./enum/Viewmode": 51,
  4992. "./enum/WarpStyle": 52,
  4993. "./model/ModelManager": 140,
  4994. "./player": 155,
  4995. "./settings": 166,
  4996. "./util/logger": 189,
  4997. "./util/transitions": 195,
  4998. events: 202,
  4999. three: 217
  5000. }],
  5001. 16: [function(e, t, i) {
  5002. "use strict";
  5003. var n = e("three")
  5004. , r = e("./enum/Viewmode")
  5005. , o = (e("./settings"),
  5006. e("./util/transitions"))
  5007. , a = e("./enum/PlayerEvents")
  5008. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5009. , l = new n.ShaderPass(n.VerticalBlurShader);
  5010. l.renderToScreen = !0;
  5011. var c = $("#player").width() / $("#player").height();
  5012. isNaN(c) && (c = 1);
  5013. var h = {
  5014. currentBlur: 0,
  5015. aspect: c,
  5016. blurStrength: 1,
  5017. hblurPass: s,
  5018. vblurPass: l,
  5019. bindEvents: function(e) {
  5020. e.on(a.ModeChanged, function(e, t) {
  5021. e === r.PANORAMA && (o.cancel(h.blur),
  5022. o.cancel(h.addBlur),
  5023. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5024. })
  5025. },
  5026. blur: function(e) {
  5027. h.currentBlur = e;
  5028. var t = e * h.blurStrength;
  5029. l.uniforms.v.value = t / 512 * h.aspect,
  5030. s.uniforms.h.value = t / 512
  5031. },
  5032. addBlur: function(e) {
  5033. e = Math.max(e, h.currentBlur),
  5034. h.blur(e)
  5035. },
  5036. removeBlur: function(e) {
  5037. e = Math.min(1 - e, h.currentBlur),
  5038. h.blur(e)
  5039. }
  5040. };
  5041. h.blur(0),
  5042. t.exports = h
  5043. }
  5044. , {
  5045. "./enum/PlayerEvents": 40,
  5046. "./enum/Viewmode": 51,
  5047. "./settings": 166,
  5048. "./util/transitions": 195,
  5049. three: 217
  5050. }],
  5051. 17: [function(e, t, i) {
  5052. "use strict";
  5053. t.exports = {
  5054. UNKNOWN: 0,
  5055. ALIGNED: 1,
  5056. UNALIGNED: 2,
  5057. PLACED: 3
  5058. }
  5059. }
  5060. , {}],
  5061. 18: [function(e, t, i) {
  5062. "use strict";
  5063. t.exports = {
  5064. NONE: 0,
  5065. MIDDLE: 1,
  5066. END: 2,
  5067. BEGINNING: 3,
  5068. FADEIN: 4
  5069. }
  5070. }
  5071. , {}],
  5072. 19: [function(e, t, i) {
  5073. "use strict";
  5074. var n = e("three");
  5075. t.exports = {
  5076. newBlue: new n.Color(4967932),
  5077. altBlue: new n.Color(47355),
  5078. tagDefault: new n.Color(223357),
  5079. classicBlue: new n.Color(53759),
  5080. mpYellow: new n.Color(16502016),
  5081. mpOrange: new n.Color(16428055),
  5082. mpBlue: new n.Color(12096),
  5083. mpLtGrey: new n.Color(13751252),
  5084. mpDkGrey: new n.Color(10000019),
  5085. mpRed: new n.Color(12525854),
  5086. mpOrangeDesat: new n.Color(16764529),
  5087. mpBlueDesat: new n.Color(4034734),
  5088. mpRedDesat: new n.Color(14705505),
  5089. white: new n.Color(16777215),
  5090. black: new n.Color(0),
  5091. _desat: function(e, t) {
  5092. var i = t || .3
  5093. , r = (new n.Color).copy(e).getHSL();
  5094. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5095. },
  5096. _darken: function(e, t) {
  5097. var i = t || .2
  5098. , r = e.getHSL();
  5099. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5100. }
  5101. }
  5102. }
  5103. , {
  5104. three: 217
  5105. }],
  5106. 20: [function(e, t, i) {
  5107. "use strict";
  5108. t.exports = {
  5109. NONE: -1,
  5110. ROTATE: 0,
  5111. DOLLY: 1,
  5112. PAN: 2,
  5113. ROTATE_DOLLY: 3,
  5114. PAN_DOLLY: 4
  5115. }
  5116. }
  5117. , {}],
  5118. 21: [function(e, t, i) {
  5119. "use strict";
  5120. t.exports = {
  5121. Move: "move",
  5122. InteractionDirect: "interaction.direct",
  5123. InteractionKey: "interaction.key",
  5124. InteractionGui: "interaction.gui",
  5125. FlyInDirection: "fly.direction",
  5126. InputStart: "input.start",
  5127. Pinch: "input.pinch",
  5128. Scroll: "input.scroll",
  5129. AutoPanInterrupt: "autopan.interrupt",
  5130. AutoPanComplete: "autopan.complete",
  5131. AutoPanClamped: "autopan.clamped",
  5132. LongTap: "longtap"
  5133. }
  5134. }
  5135. , {}],
  5136. 22: [function(e, t, i) {
  5137. "use strict";
  5138. t.exports = Object.freeze({
  5139. FORWARD: "FORWARD",
  5140. LEFT: "LEFT",
  5141. RIGHT: "RIGHT",
  5142. BACK: "BACK",
  5143. UP: "UP",
  5144. DOWN: "DOWN"
  5145. })
  5146. }
  5147. , {}],
  5148. 23: [function(e, t, i) {
  5149. "use strict";
  5150. t.exports = {
  5151. ActionInterrupted: "action.interrupted",
  5152. TourStart: "tour.start",
  5153. TourEnd: "tour.end",
  5154. StartModeChange: "mode.startChange"
  5155. }
  5156. }
  5157. , {}],
  5158. 24: [function(e, t, i) {
  5159. "use strict";
  5160. t.exports = Object.freeze({
  5161. None: 0,
  5162. Queued: 1,
  5163. ForceQueued: 2,
  5164. Downloading: 3,
  5165. Downloaded: 4,
  5166. DownloadFailed: 5
  5167. })
  5168. }
  5169. , {}],
  5170. 25: [function(e, t, i) {
  5171. "use strict";
  5172. t.exports = {
  5173. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5174. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5175. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5176. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5177. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5178. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5179. }
  5180. }
  5181. , {}],
  5182. 26: [function(e, t, i) {
  5183. "use strict";
  5184. t.exports = {
  5185. Texture2D: 0,
  5186. TextureCube: 1
  5187. }
  5188. }
  5189. , {}],
  5190. 27: [function(e, t, i) {
  5191. "use strict";
  5192. t.exports = {
  5193. SMALL: "small",
  5194. LARGE: "large"
  5195. }
  5196. }
  5197. , {}],
  5198. 28: [function(e, t, i) {
  5199. "use strict";
  5200. var n = e("./Viewmode")
  5201. , r = {
  5202. LANDING: {},
  5203. NAVIGATION: "navigation",
  5204. MORE_HELP: "moreHelp",
  5205. TOUR_INTERACTION: {}
  5206. };
  5207. r.LANDING[n.PANORAMA] = "panorama.landing",
  5208. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5209. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5210. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5211. r.TOUR_INTERACTION.standard = "standard.tour",
  5212. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5213. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5214. t.exports = r
  5215. }
  5216. , {
  5217. "./Viewmode": 51
  5218. }],
  5219. 29: [function(e, t, i) {
  5220. "use strict";
  5221. var n = {
  5222. UP: 1,
  5223. DOWN: -1,
  5224. LEFT: "L",
  5225. RIGHT: "R",
  5226. FORWARD: "F",
  5227. BACK: "B",
  5228. reverse: {},
  5229. opposite: function(e) {
  5230. return this.reverse[e.toString()]
  5231. }
  5232. };
  5233. !function() {
  5234. n.reverse[n.UP] = n.DOWN,
  5235. n.reverse[n.DOWN] = n.UP,
  5236. n.reverse[n.LEFT] = n.RIGHT,
  5237. n.reverse[n.RIGHT] = n.LEFT,
  5238. n.reverse[n.FORWARD] = n.BACK,
  5239. n.reverse[n.BACK] = n.FORWARD
  5240. }(),
  5241. t.exports = n
  5242. }
  5243. , {}],
  5244. 30: [function(e, t, i) {
  5245. "use strict";
  5246. var n = e("../util/browser")
  5247. , r = {
  5248. ZERO: 48,
  5249. ONE: 49,
  5250. TWO: 50,
  5251. THREE: 51,
  5252. FOUR: 52,
  5253. FIVE: 53,
  5254. SIX: 54,
  5255. SEVEN: 55,
  5256. EIGHT: 56,
  5257. NINE: 57,
  5258. LEFTARROW: 37,
  5259. UPARROW: 38,
  5260. RIGHTARROW: 39,
  5261. DOWNARROW: 40,
  5262. A: 65,
  5263. B: 66,
  5264. C: 67,
  5265. D: 68,
  5266. E: 69,
  5267. F: 70,
  5268. G: 71,
  5269. H: 72,
  5270. I: 73,
  5271. J: 74,
  5272. K: 75,
  5273. L: 76,
  5274. M: 77,
  5275. N: 78,
  5276. O: 79,
  5277. P: 80,
  5278. Q: 81,
  5279. R: 82,
  5280. S: 83,
  5281. T: 84,
  5282. U: 85,
  5283. V: 86,
  5284. W: 87,
  5285. X: 88,
  5286. Y: 89,
  5287. Z: 90,
  5288. SPACE: 32,
  5289. RETURN: 13,
  5290. SEMICOLON: 186,
  5291. PLUSEQUALS: 187,
  5292. DASHUNDERSCORE: 189,
  5293. OPENBRACKET: 219
  5294. };
  5295. n.detectFirefox() && (r.SEMICOLON = 59,
  5296. r.PLUSEQUALS = 61,
  5297. r.DASHUNDERSCORE = 173),
  5298. t.exports = r
  5299. }
  5300. , {
  5301. "../util/browser": 182
  5302. }],
  5303. 31: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. EN_US: "en-US",
  5307. ES_MX: "es-MX",
  5308. FR_FR: "fr-FR",
  5309. DE_DE: "de-DE",
  5310. RU_RU: "ru-RU",
  5311. CN_CN: "cn-CN",
  5312. JP_JP: "jp-JP"
  5313. }
  5314. }
  5315. , {}],
  5316. 32: [function(e, t, i) {
  5317. "use strict";
  5318. t.exports = {
  5319. TagActivated: "tag.activated",
  5320. TagDismissed: "tag.dismissed",
  5321. TagNavigation: "tag.navigation"
  5322. }
  5323. }
  5324. , {}],
  5325. 33: [function(e, t, i) {
  5326. "use strict";
  5327. t.exports = {
  5328. ModelAdded: "model-added",
  5329. ActiveModelChanged: "active-model-changed"
  5330. }
  5331. }
  5332. , {}],
  5333. 34: [function(e, t, i) {
  5334. "use strict";
  5335. t.exports = {
  5336. LEFT: 0,
  5337. MIDDLE: 1,
  5338. RIGHT: 2
  5339. }
  5340. }
  5341. , {}],
  5342. 35: [function(e, t, i) {
  5343. "use strict";
  5344. t.exports = {
  5345. PanoRenderComplete: "panorama.render.complete",
  5346. TileRenderFailure: "panorama.tile.render.failed",
  5347. TileRenderSuccess: "panorama.tile.render.success",
  5348. TileUploadAttempted: "panorama.tile.upload.attempted",
  5349. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5350. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5351. }
  5352. }
  5353. , {}],
  5354. 36: [function(e, t, i) {
  5355. "use strict";
  5356. t.exports = {
  5357. BASE: 1,
  5358. STANDARD: 2,
  5359. HIGH: 3,
  5360. ULTRAHIGH: 4
  5361. }
  5362. }
  5363. , {}],
  5364. 37: [function(e, t, i) {
  5365. "use strict";
  5366. t.exports = {
  5367. LoadComplete: "panorama.load.complete",
  5368. LoadFailed: "panorama.load.failed",
  5369. TileLoaded: "panorama.tile.loaded"
  5370. }
  5371. }
  5372. , {}],
  5373. 38: [function(e, t, i) {
  5374. "use strict";
  5375. t.exports = Object.freeze({
  5376. Standard: 0,
  5377. Slow: 1,
  5378. Retain: 2
  5379. })
  5380. }
  5381. , {}],
  5382. 39: [function(e, t, i) {
  5383. "use strict";
  5384. t.exports = Object.freeze({
  5385. Show: 0,
  5386. Hide: 1,
  5387. Retain: 2
  5388. })
  5389. }
  5390. , {}],
  5391. 40: [function(e, t, i) {
  5392. "use strict";
  5393. t.exports = {
  5394. Move: "move",
  5395. MoveComplete: "move.complete",
  5396. ModeChanged: "mode.changed",
  5397. ModeChanging: "mode.changing",
  5398. PanoChosen: "pano.chosen",
  5399. ClosestPanoChanging: "closest.pano.changing",
  5400. WarpStarted: "warp.started",
  5401. WarpInterrupted: "warp.interrupted",
  5402. WarpEnded: "warp.ended",
  5403. FlyinFinished: "flyin.finished",
  5404. FlyingStarted: "flying.started",
  5405. FlyingInterrupted: "flying.interrupted",
  5406. FlyingEnded: "flying.ended",
  5407. Ready: "ready",
  5408. StartInside: "start.inside",
  5409. StartOutside: "start.outside",
  5410. ViewChanged: "view.changed",
  5411. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5412. InputStart: "input.start"
  5413. }
  5414. }
  5415. , {}],
  5416. 41: [function(e, t, i) {
  5417. "use strict";
  5418. t.exports = Object.freeze({
  5419. DEFAULT: 0,
  5420. PANOMARKERS: 1,
  5421. RETICULE: 2,
  5422. TAG: 3
  5423. })
  5424. }
  5425. , {}],
  5426. 42: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. visibleFloor: 1,
  5430. ghostFloor: 3,
  5431. boundingSkybox: 1,
  5432. panoMarker: 2,
  5433. reticule: 3,
  5434. tagStem: 4,
  5435. tagDisc: 5,
  5436. ribbon: 100
  5437. }
  5438. }
  5439. , {}],
  5440. 43: [function(e, t, i) {
  5441. "use strict";
  5442. t.exports = {
  5443. ContextCreated: "scene-renderer-context-created",
  5444. AfterRender: "after-render",
  5445. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5446. }
  5447. }
  5448. , {}],
  5449. 44: [function(e, t, i) {
  5450. "use strict";
  5451. t.exports = {
  5452. IDLE: "idle",
  5453. BROWSE: "browse",
  5454. EXAMINE: "examine"
  5455. }
  5456. }
  5457. , {}],
  5458. 45: [function(e, t, i) {
  5459. "use strict";
  5460. t.exports = {
  5461. TileDownloadSuccess: "tiledownloader.download.success",
  5462. TileDownloadFailure: "tiledownloader.download.failure",
  5463. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5464. }
  5465. }
  5466. , {}],
  5467. 46: [function(e, t, i) {
  5468. "use strict";
  5469. t.exports = {
  5470. CardboardAndroid: "googlevr",
  5471. GearVR: "gearvr",
  5472. CardboardIOS: "googlevrios",
  5473. Cardboard: "googlevr"
  5474. }
  5475. }
  5476. , {}],
  5477. 47: [function(e, t, i) {
  5478. "use strict";
  5479. t.exports = {
  5480. NONE: 0,
  5481. CONTEXTUAL: 1,
  5482. ANDROID: 2
  5483. }
  5484. }
  5485. , {}],
  5486. 48: [function(e, t, i) {
  5487. "use strict";
  5488. var n = {
  5489. Title: 0,
  5490. Cardboard: 1
  5491. }
  5492. , r = {
  5493. Title: 0,
  5494. Cardboard: 1,
  5495. Gear: 2
  5496. };
  5497. !function() {
  5498. [n, r].forEach(function(e) {
  5499. e.pageCount = Object.keys(e).length
  5500. })
  5501. }(),
  5502. t.exports.ios = n,
  5503. t.exports.standard = r
  5504. }
  5505. , {}],
  5506. 49: [function(e, t, i) {
  5507. "use strict";
  5508. t.exports = {
  5509. Android: "android",
  5510. IOS: "ios",
  5511. Desktop: "desktop",
  5512. UnsupportedAndroid: "android-unsupported"
  5513. }
  5514. }
  5515. , {}],
  5516. 50: [function(e, t, i) {
  5517. "use strict";
  5518. var n = e("three");
  5519. t.exports = {
  5520. UP: new n.Vector3(0,1,0),
  5521. DOWN: new n.Vector3(0,-1,0),
  5522. LEFT: new n.Vector3(-1,0,0),
  5523. RIGHT: new n.Vector3(1,0,0),
  5524. FORWARD: new n.Vector3(0,0,-1),
  5525. BACK: new n.Vector3(0,0,1)
  5526. }
  5527. }
  5528. , {
  5529. three: 217
  5530. }],
  5531. 51: [function(e, t, i) {
  5532. "use strict";
  5533. var n = e("../exception/ViewmodeConvertException")
  5534. , r = e("./coreViewmodes")
  5535. , o = e("../util/common")
  5536. , a = {
  5537. MESH: "mesh",
  5538. OUTDOOR: "outdoor",
  5539. TRANSITIONING: "transitioning",
  5540. toInt: function(e) {
  5541. switch (e) {
  5542. case this.PANORAMA:
  5543. return 1;
  5544. case this.DOLLHOUSE:
  5545. return 2;
  5546. case this.FLOORPLAN:
  5547. return 3;
  5548. case this.OUTDOOR:
  5549. return 4;
  5550. case this.TRANSITIONING:
  5551. return -1
  5552. }
  5553. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5554. },
  5555. fromInt: function(e) {
  5556. switch (e) {
  5557. case "1":
  5558. case 1:
  5559. return this.PANORAMA;
  5560. case "2":
  5561. case 2:
  5562. return this.DOLLHOUSE;
  5563. case "3":
  5564. case 3:
  5565. return this.FLOORPLAN;
  5566. case "4":
  5567. case 4:
  5568. return this.OUTDOOR
  5569. }
  5570. throw new n("No known conversion for int to viewmode for int: " + e)
  5571. },
  5572. convertWorkshopModeInt: function(e) {
  5573. switch (e) {
  5574. case "0":
  5575. case 0:
  5576. case undefined: //xzw add
  5577. return this.PANORAMA;
  5578. case "1":
  5579. case 1:
  5580. return this.FLOORPLAN;
  5581. case "2":
  5582. case 2:
  5583. return this.DOLLHOUSE;
  5584. case "3":
  5585. case 3:
  5586. return this.MESH
  5587. }
  5588. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5589. }
  5590. };
  5591. o.extendObject(a, r),
  5592. t.exports = a
  5593. }
  5594. , {
  5595. "../exception/ViewmodeConvertException": 58,
  5596. "../util/common": 185,
  5597. "./coreViewmodes": 54
  5598. }],
  5599. 52: [function(e, t, i) {
  5600. "use strict";
  5601. t.exports = {
  5602. BLACK: "black",
  5603. STD: "std",
  5604. WALK: "walk"
  5605. }
  5606. }
  5607. , {}],
  5608. 53: [function(e, t, i) {
  5609. "use strict";
  5610. t.exports = {
  5611. ZoomIn: "zoom.in",
  5612. ZoomOut: "zoom.out",
  5613. ZoomMax: "zoom.max",
  5614. ZoomMin: "zoom.min"
  5615. }
  5616. }
  5617. , {}],
  5618. 54: [function(e, t, i) {
  5619. "use strict";
  5620. t.exports = {
  5621. PANORAMA: "panorama",
  5622. DOLLHOUSE: "dollhouse",
  5623. FLOORPLAN: "floorplan"
  5624. }
  5625. }
  5626. , {}],
  5627. 55: [function(e, t, i) {
  5628. "use strict";
  5629. function n(e) {
  5630. this.message = e
  5631. }
  5632. t.exports = n
  5633. }
  5634. , {}],
  5635. 56: [function(e, t, i) {
  5636. "use strict";
  5637. function n(e) {
  5638. r.call(this, e)
  5639. }
  5640. var r = e("./BasicException");
  5641. n.prototype = Object.create(r.prototype),
  5642. t.exports = n
  5643. }
  5644. , {
  5645. "./BasicException": 55
  5646. }],
  5647. 57: [function(e, t, i) {
  5648. "use strict";
  5649. function n(e) {
  5650. r.call(this, e)
  5651. }
  5652. var r = e("./BasicException");
  5653. n.prototype = Object.create(r.prototype),
  5654. t.exports = n
  5655. }
  5656. , {
  5657. "./BasicException": 55
  5658. }],
  5659. 58: [function(e, t, i) {
  5660. "use strict";
  5661. function n(e) {
  5662. r.call(this, e)
  5663. }
  5664. var r = e("./BasicException");
  5665. n.prototype = Object.create(r.prototype),
  5666. t.exports = n
  5667. }
  5668. , {
  5669. "./BasicException": 55
  5670. }],
  5671. 59: [function(e, t, i) {
  5672. (function(i) {
  5673. "use strict";
  5674. function n(e) {
  5675. var t = {};
  5676. if (e) {
  5677. var i = e.flags;
  5678. if (i)
  5679. for (var n in i)
  5680. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5681. return t
  5682. }
  5683. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5684. null
  5685. }
  5686. var r = e("./util/ajax")
  5687. , o = e("./util/showcase")
  5688. , a = e("./util/logger")
  5689. , s = ""
  5690. , l = new a(i)
  5691. , c = {};
  5692. t.exports = {
  5693. loadFeatureFlags: function(e) {
  5694. var t = $.Deferred();
  5695. return r.get(e.urlBase + s, {
  5696. responseType: "json",
  5697. prefetchFrom: "user",
  5698. auth: o.getAuthorizationHeader()
  5699. }).done(function(e) {
  5700. c = n(e),
  5701. c ? t.resolve(c) : t.reject("loading-failed")
  5702. }).fail(function() {
  5703. l.debug("Retrieval of feature flags failed."),
  5704. t.reject("loading-failed")
  5705. }),
  5706. t.promise()
  5707. },
  5708. getFlags: function() {
  5709. return c
  5710. },
  5711. updateDependentSettings: function(e, t) {
  5712. e = e || c,
  5713. e.labels && (t.labels.enabled = !0),
  5714. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5715. e.showcase_sdk && (t.sdkInit = !0),
  5716. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5717. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5718. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5719. e.hide_sc_sharing && (t.share.enabled = !1)
  5720. }
  5721. }
  5722. }
  5723. ).call(this, "/js/featureflags.js")
  5724. }
  5725. , {
  5726. "./util/ajax": 181,
  5727. "./util/logger": 189,
  5728. "./util/showcase": 193
  5729. }],
  5730. 60: [function(e, t, i) {
  5731. "use strict";
  5732. var n = (e("../util/common"),
  5733. {
  5734. status: 0,
  5735. set: function(e) {
  5736. if (isNaN(e))
  5737. return !1;
  5738. var t = $('.progressbar');
  5739. 0 > e && (e = 0);
  5740. e > 100 && (e = 100);
  5741. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5742. var barperc = e*width;
  5743. var perc = Math.round(e);
  5744. var labelpos = (parseInt(barperc)-15);
  5745. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5746. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5747. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5748. this.status = e
  5749. },
  5750. done: function(e) {
  5751. return e || this.status ? (this.status = null,
  5752. this.set(100)) : this
  5753. }
  5754. });
  5755. t.exports.circleLoader = n
  5756. }
  5757. , {
  5758. "../util/common": 185
  5759. }],
  5760. 61: [function(e, t, i) {
  5761. "use strict";
  5762. t.exports = Object.freeze({
  5763. CLOSE: "modal.closer.close"
  5764. })
  5765. }
  5766. , {}],
  5767. 62: [function(e, t, i) {
  5768. "use strict";
  5769. function n(e, t) {
  5770. t && (t.stopPropagation(),
  5771. t.preventDefault()),
  5772. e && this.emit(l.CLOSE, e),
  5773. g.reset()
  5774. }
  5775. function r(e, t) {
  5776. function i() {
  5777. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5778. t !== f && (f = t,
  5779. t ? (e.classList.add("closeByFooter"),
  5780. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5781. h.classList.remove("closeByFooter")))
  5782. }
  5783. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5784. }
  5785. var o = e("../../settings")
  5786. , a = (e("../../tag/Media/MediaEvent"),
  5787. e("../../util/browser"))
  5788. , s = e("../../util/common")
  5789. , l = e("./ModalCloserEvent")
  5790. , c = e("events").EventEmitter
  5791. , h = document.getElementsByClassName("footer")[0]
  5792. , u = h.querySelectorAll(".close")[0]
  5793. , d = null
  5794. , p = null
  5795. , f = null
  5796. , g = (a.isMobile(),
  5797. {
  5798. open: function(e) {
  5799. e && (r(e),
  5800. d && u.removeEventListener("click", d, !0),
  5801. d = n.bind(this, e.id),
  5802. u.addEventListener("click", d, !0),
  5803. p && window.removeEventListener("resize", p, !0),
  5804. p = r.bind(this, e),
  5805. window.addEventListener("resize", p, !0))
  5806. },
  5807. reset: function() {
  5808. h.classList.remove("closeByFooter"),
  5809. u.removeEventListener("click", d, !0),
  5810. window.removeEventListener("resize", p, !0),
  5811. d = p = f = null
  5812. }
  5813. });
  5814. s.extendObject(g, c.prototype),
  5815. t.exports = g
  5816. }
  5817. , {
  5818. "../../tag/Media/MediaEvent": 131,
  5819. "../../settings": 166,
  5820. "../../util/browser": 182,
  5821. "../../util/common": 185,
  5822. "./ModalCloserEvent": 61,
  5823. events: 202
  5824. }],
  5825. 63: [function(e, t, i) {
  5826. "use strict";
  5827. function n(e, t, i) {
  5828. var n = new r.GUI({
  5829. width: 400
  5830. })
  5831. , u = n.addFolder("Flydown from Dollhouse");
  5832. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5833. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5834. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5835. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5836. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5837. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5838. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5839. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5840. var d = n.addFolder("Transition between panos");
  5841. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5842. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5843. h.transition.flyTime = 0,
  5844. d.__controllers.forEach(function(e) {
  5845. e.updateDisplay()
  5846. })
  5847. }),
  5848. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5849. h.transition.flySpeed = 0,
  5850. d.__controllers.forEach(function(e) {
  5851. e.updateDisplay()
  5852. })
  5853. }),
  5854. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5855. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5856. d.add(h.transition, "movementEasing", Object.keys(a));
  5857. var p = n.addFolder("Path Display");
  5858. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5859. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5860. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5861. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5862. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5863. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5864. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5865. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5866. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5867. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5868. h.path.color = l[h.path.color],
  5869. h.path.colorUp = l._desat(h.path.color),
  5870. h.path.colorDown = l.darken(h.path.color)
  5871. }),
  5872. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5873. h.reticuleColor = l[h.reticuleColor]
  5874. });
  5875. var f = n.addFolder("Warping")
  5876. , g = f.addFolder("Warp/Teleport");
  5877. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5878. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5879. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5880. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5881. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5882. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5883. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5884. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5885. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5886. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5887. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5888. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5889. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5890. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5891. h.path.typ = c[h.path.typ]
  5892. }),
  5893. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5894. t.endlessLoop = h.warp.loop
  5895. }),
  5896. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5897. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5898. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5899. var m = f.addFolder("Long Warp Only");
  5900. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5901. h.warp.flySpeed = 0,
  5902. m.__controllers.forEach(function(e) {
  5903. e.updateDisplay()
  5904. })
  5905. }),
  5906. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5907. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5908. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5909. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5910. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5911. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5912. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5913. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5914. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5915. var v = n.addFolder("Warp Esoterica");
  5916. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5917. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5918. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5919. h.warp.minWarpTime = 0,
  5920. v.__controllers.forEach(function(e) {
  5921. e.updateDisplay()
  5922. })
  5923. }),
  5924. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5925. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5926. v.add(h.warp, "movementEasing", Object.keys(a));
  5927. var A = n.addFolder("Misc");
  5928. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5929. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5930. }),
  5931. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5932. i.cameras[s.PANORAMA].fov = h.insideFOV
  5933. }),
  5934. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5935. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5936. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5937. var y = n.addFolder("Navigation");
  5938. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5939. h.navigation.panoScores || e.panos.forEach(function(e) {
  5940. e.floor.remove(e.text3d),
  5941. e.text3d = null
  5942. })
  5943. }),
  5944. y.add(h.navigation, "mouseDirection"),
  5945. y.add(h.navigation, "filterStrictness", 0, 1),
  5946. y.add(h.navigation, "angleFactor", -60, 0),
  5947. y.add(h.navigation, "directionFactor", 1, 20),
  5948. y.add(h.navigation, "distanceFactor", -5, 5),
  5949. y.add(h.navigation, "optionalityFactor", .1, 10);
  5950. var C = n.addFolder("tags")
  5951. , I = C.addFolder("Tag Creation");
  5952. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5953. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5954. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5955. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5956. var E = C.addFolder("Visibility");
  5957. E.add(h.tags.visibility, "anyDistance"),
  5958. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5959. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5960. E.add(h.tags.visibility, "hideViaFloor"),
  5961. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5962. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5963. var b = C.addFolder("Disc Parameters");
  5964. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5965. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5966. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5967. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5968. }),
  5969. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5970. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5971. }),
  5972. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5973. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5974. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5975. var w = C.addFolder("Navigate");
  5976. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5977. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5978. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5979. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5980. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5981. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5982. var _ = n.addFolder("Debug");
  5983. _.add(h, "wireframe").onFinishChange(function() {
  5984. e.chunks.forEach(function(t) {
  5985. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5986. t.wireframeTwin.material.depthWrite = !1,
  5987. t.wireframeTwin.material.depthTest = !1,
  5988. t.wireframeTwin.material.opacity = .5,
  5989. t.wireframeTwin.material.transparent = !0),
  5990. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5991. })
  5992. }),
  5993. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5994. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5995. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5996. e.skybox.wireframe = null)
  5997. }),
  5998. _.add(h, "showSweeps").onFinishChange(function() {
  5999. e.setSweepVisibility(h.showSweeps)
  6000. }),
  6001. _.add(h, "showMesh").onFinishChange(function() {
  6002. e.chunks.forEach(function(e) {
  6003. e.visible = h.showMesh
  6004. })
  6005. }),
  6006. _.add(h, "showFloors").onFinishChange(function() {
  6007. e.floors.forEach(function(e) {
  6008. e.collider.children.forEach(function(e) {
  6009. e.material.visible = h.showFloors
  6010. })
  6011. })
  6012. }),
  6013. _.add(h, "showSkyboxes").onFinishChange(function() {
  6014. e.panos.forEach(function(e) {
  6015. e.skyboxMesh.visible = h.showSkyboxes
  6016. })
  6017. }),
  6018. _.add(h, "showNeighbors").onChange(function() {}),
  6019. _.add(e, "alpha", 0, 1)
  6020. }
  6021. var r = e("../lib/dat.gui")
  6022. , o = e("three")
  6023. , a = e("../util/easing")
  6024. , s = e("../enum/Viewmode")
  6025. , l = e("../enum/Colors")
  6026. , c = e("../enum/WarpStyle")
  6027. , h = e("../settings");
  6028. e("../tag/tag");
  6029. r.GUI.prototype.removeFolder = function(e) {
  6030. var t = this.__folders[e];
  6031. t && (t.close(),
  6032. this.__ul.removeChild(t.domElement.parentNode),
  6033. delete this.__folders[e],
  6034. this.onResize())
  6035. }
  6036. ,
  6037. t.exports.toggle = n
  6038. }
  6039. , {
  6040. "../enum/Colors": 19,
  6041. "../enum/Viewmode": 51,
  6042. "../enum/WarpStyle": 52,
  6043. "../lib/dat.gui": 93,
  6044. "../tag/tag": 123,
  6045. "../settings": 166,
  6046. "../util/easing": 186,
  6047. three: 217
  6048. }],
  6049. 64: [function(e, t, i) {
  6050. (function(i) {
  6051. "use strict";
  6052. function n(e, t, i, n) {
  6053. $(".gui-error .error-problem-text").text(e),
  6054. $(".gui-error .error-solution-text").text(t),
  6055. $(".gui-error .error-explanation").text(i),
  6056. $(".gui-error .error-actions").html(n),
  6057. $(window).resize(),
  6058. $(".gui-error").fadeIn(),
  6059. $("#bottom-logo").fadeIn()
  6060. }
  6061. function r(e) {
  6062. 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("");
  6063. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6064. s.isMobile() || $("[rel=tiletip]").tooltip({
  6065. placement: "bottom",
  6066. delay: {
  6067. show: 50,
  6068. hide: 0
  6069. },
  6070. trigger: "hover",
  6071. viewport: {
  6072. selector: "body",
  6073. padding: 10
  6074. }
  6075. })
  6076. }
  6077. function o() {
  6078. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6079. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6080. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6081. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6082. e.preventDefault(),
  6083. e.stopPropagation(),
  6084. r(" ")
  6085. })
  6086. }
  6087. function a(e) {
  6088. if ($("head title").text(c.pageTitle),
  6089. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6090. $("#gui-loading").fadeOut(250),
  6091. $("#quick-blackout").hide(),
  6092. l.track("showcase_error", {
  6093. error_key: e
  6094. }),
  6095. h.locale || h.init(),
  6096. "webgl-unsupported" === e)
  6097. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6098. else if ("webgl-ios" === e)
  6099. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6100. else if ("webgl-safari" === e)
  6101. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6102. else if ("webgl-generic" === e)
  6103. o();
  6104. else if ("missing-urls" === e)
  6105. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6106. else if ("loading-failed" === e)
  6107. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6108. else {
  6109. if ("loading-failed-maintenance" !== e)
  6110. return void d.error("Unhandled error: " + e);
  6111. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6112. }
  6113. }
  6114. var s = e("./../util/browser")
  6115. , l = e("./../analytics")
  6116. , c = e("./../settings")
  6117. , h = e("../localization/localize")
  6118. , u = e("./../util/logger")
  6119. , d = new u(i)
  6120. , p = '"https://support.port.com/hc/articles/208220058"';
  6121. t.exports.error = a
  6122. }
  6123. ).call(this, "/js/gui/error.js")
  6124. }
  6125. , {
  6126. "../localization/localize": 108,
  6127. "./../analytics": 4,
  6128. "./../settings": 166,
  6129. "./../util/browser": 182,
  6130. "./../util/logger": 189
  6131. }],
  6132. 65: [function(e, t, i) {
  6133. (function(i) {
  6134. "use strict";
  6135. function n() {
  6136. Ue = [],
  6137. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6138. Ue.push(".hideTarget", ".pinTop.right")
  6139. }
  6140. function r() {
  6141. for (var e in je)
  6142. if (je.hasOwnProperty(e)) {
  6143. var t = je[e];
  6144. if (!t.visible)
  6145. for (var i = 0; i < t.elements.length; i++)
  6146. $(t.elements[i]).hide()
  6147. }
  6148. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6149. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6150. n()
  6151. }
  6152. function o(e, t) {
  6153. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6154. $("#gui-zoomin").toggle(i),
  6155. $("#gui-zoomout").toggle(i)
  6156. }
  6157. function a() {
  6158. c(),
  6159. $(".pinBottom").toggleClass("open"),
  6160. $("#drawer").toggleClass("open"),
  6161. $(".footer").toggleClass("open"),
  6162. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6163. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6164. ie.resetDrawer()),
  6165. setTimeout(function() {
  6166. $("#pullTab").toggleClass("opened");
  6167. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6168. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6169. }
  6170. function s(e) {
  6171. var t;
  6172. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6173. t = e.position().top + e.outerHeight(),
  6174. e.attr("style", "display: none"));
  6175. var i = $("#player").outerHeight()
  6176. , n = i - 130;
  6177. return n < t + 25
  6178. }
  6179. function l(e) {
  6180. "touchstart" === e.type && e.preventDefault(),
  6181. e.stopPropagation()
  6182. }
  6183. function c() {
  6184. W && (W.reload(),
  6185. W.init())
  6186. }
  6187. function h(e) {
  6188. ne.show(e),
  6189. r()
  6190. }
  6191. function u(e) {
  6192. ne.progress(e)
  6193. }
  6194. function d(e, t, i) {
  6195. var n = t.player;
  6196. $("#gui-thumb").fadeOut(2500),
  6197. ne.hide(function() {
  6198. Ge = !1
  6199. }),
  6200. me.init(e, i),
  6201. de.finishSetup(Object.keys(e.tags).length),
  6202. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6203. var s = function() {
  6204. i.dismissExaminedTag(),
  6205. i.disableHovering()
  6206. };
  6207. Ae.on(ye.OPENED, s),
  6208. Ce.on(Me.OPENED, s),
  6209. he.on(ue.OPENED, s),
  6210. fe.on(ge.OPENED, s);
  6211. var l = i.enableHovering.bind(i);
  6212. if (Ae.on(ye.CLOSED, l),
  6213. Ce.on(Me.CLOSED, l),
  6214. he.on(ue.CLOSED, l),
  6215. fe.on(ge.CLOSED, l),
  6216. Q.labels.enabled && Object.keys(e.labels).length,
  6217. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6218. C(e.currentFloor, n.mode)),
  6219. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6220. r(),
  6221. o(t, t.player),
  6222. $("#gui").fadeIn(1500),
  6223. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6224. a(),
  6225. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6226. }, 2e3),
  6227. !K.isMobile())
  6228. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6229. $(c[h]).addClass("hasHover");
  6230. O(e),
  6231. de.setupToggling();
  6232. //xzw:
  6233. window.editHotPanel && editHotPanel();
  6234. //czj
  6235. navBorderRadius(e);
  6236. //czj 编辑界面
  6237. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6238. window.EditTools && new EditTools(n.sceneRenderer);
  6239. }
  6240. function navBorderRadius(e){
  6241. var pullTab = $("#pullTab"),
  6242. mobileRadius = {
  6243. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6244. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6245. },
  6246. topRadius = {
  6247. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6248. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6249. };
  6250. function BorderRadius(bottom,top){
  6251. $("#gui-modes-map > div:visible:last").css(bottom);
  6252. if(pullTab.is(':visible')){
  6253. $(".viewContainer > div:visible:first").css(top);
  6254. }else{
  6255. $("#gui-modes-map > div:visible:first").css(top);
  6256. }
  6257. }
  6258. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6259. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6260. }else{
  6261. BorderRadius(topRadius.bottom,topRadius.top);
  6262. }
  6263. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6264. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special){
  6265. window.specialScene && specialScene.special().afterImplement();
  6266. }
  6267. }
  6268. function p(e) {
  6269. e || (e = 0),
  6270. We = !1,
  6271. window.setTimeout(function() {
  6272. We || (ze = !0,
  6273. $("#gui-spinner").stop(!0, !0).show())
  6274. }
  6275. .bind(this), e)
  6276. }
  6277. function f() {
  6278. $("#gui-spinner").stop(!0, !0),
  6279. $("#gui-spinner").fadeOut(1e3),
  6280. We = !0,
  6281. ze = !1
  6282. }
  6283. function g(e, t) {
  6284. var i = e.mode
  6285. , n = t || e.currentPano;
  6286. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6287. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6288. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6289. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6290. Q.show360Views.enabled && !n.isAligned() ? (
  6291. $(".gui-floor").addClass("hidden"),
  6292. $("#gui-modes-outside").addClass("desktop-only")) : (
  6293. $(".gui-floor").removeClass("hidden"),
  6294. $("#gui-modes-outside").removeClass("desktop-only")),
  6295. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6296. Be = i,
  6297. $("#gui-modes-outside").addClass("hidden"),
  6298. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6299. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6300. }
  6301. function m(e, t) {
  6302. var i = t.player;
  6303. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6304. l(e),
  6305. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6306. J.track("USER", {
  6307. event_type: "showcase_gui",
  6308. gui_action: "click_inside_mode_button"
  6309. }),
  6310. t.changeMode(_e.PANORAMA);
  6311. }),
  6312. $("#gui-modes-outside").find("a").on("click", function(e) {
  6313. l(e),
  6314. J.track("showcase_gui", {
  6315. gui_action: "click_outside_mode_button"
  6316. }),
  6317. t.changeMode(Be)
  6318. }),
  6319. $("#gui-modes-floorplan").on("click", function(e) {
  6320. l(e),
  6321. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6322. gui_action: "click_floorplan_mode_button"
  6323. }),
  6324. t.changeMode(_e.FLOORPLAN));
  6325. }),
  6326. $("#gui-modes-dollhouse").on("click", function(e) {
  6327. l(e),
  6328. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6329. gui_action: "click_dollhouse_mode_button"
  6330. }),
  6331. t.changeMode(_e.DOLLHOUSE));
  6332. })
  6333. }
  6334. function v(e, t) {
  6335. function i() {
  6336. document.getElementById("vr").classList.remove("hidden"),
  6337. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6338. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6339. $(".improper-embed").toggleClass("hidden", !1),
  6340. r())
  6341. }, function(e) {
  6342. r()
  6343. }) : r()
  6344. }
  6345. function n(i) {
  6346. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6347. Ie.init(e.data, t, i, q),
  6348. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6349. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6350. }
  6351. function r() {
  6352. De.info("WebVR support not found, VR button activates native app VR modal"),
  6353. Ae.init(e.data, q),
  6354. Ae.on(ye.OPENED, function() {
  6355. var e = document.getElementById("vr-modal");
  6356. return function() {
  6357. Ze("vr"),
  6358. le.open(e)
  6359. }
  6360. }()),
  6361. Ae.on(ye.CLOSED, le.reset)
  6362. }
  6363. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6364. /*********************** 方奕卓 VR功能事件监听 ********************/
  6365. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6366. switch (Q.vr.option) {
  6367. case Pe.CONTEXTUAL:
  6368. i();
  6369. break;
  6370. case Pe.ANDROID:
  6371. K.detectAndroid() && i();
  6372. break;
  6373. case Pe.NONE:
  6374. }
  6375. }
  6376. }
  6377. function A(e, t) {
  6378. $("#play").on("mousedown touchstart", function(e) {
  6379. l(e);
  6380. Ze("tour");
  6381. ve.play();
  6382. J.trackAlways("showcase_gui", {
  6383. gui_action: "play_highlights"
  6384. })
  6385. }),
  6386. window.startAndPlay = function(e) {
  6387. // l(e);
  6388. Ze("tour");
  6389. ve.play();
  6390. J.trackAlways("showcase_gui", {
  6391. gui_action: "play_highlights"
  6392. })
  6393. };
  6394. $("#pause").on("mousedown touchstart", function(e) {
  6395. l(e),
  6396. ve.pause(),
  6397. J.trackAlways("showcase_gui", {
  6398. gui_action: "pause_highlights"
  6399. })
  6400. }),
  6401. $("#gui-zoomin").find("a").on("click", function(e) {
  6402. l(e),
  6403. t.player.zoomInIncrementally()
  6404. }),
  6405. $("#gui-zoomout").find("a").on("click", function(e) {
  6406. l(e),
  6407. t.player.zoomOutIncrementally()
  6408. })
  6409. }
  6410. function y(e, t) {
  6411. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6412. if(getQueryVariable('m') === '372') continue;
  6413. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6414. $(".gui-floor").find(".container").prepend(r)
  6415. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6416. }
  6417. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6418. i.on("click", function(e) {
  6419. l(e),
  6420. Ze("floor"),
  6421. i.toggleClass("open")
  6422. }),
  6423. $(".floorChoice").on("click", function(e) {
  6424. l(e);
  6425. var n = $(this).data("index");
  6426. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6427. t.player.gotoFloor(n),
  6428. J.track("showcase_gui", {
  6429. gui_action: "click_floor_select_button",
  6430. interaction_source: "gui"
  6431. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6432. Ze("move"),
  6433. t.allFloors(),
  6434. J.track("showcase_gui", {
  6435. gui_action: "click_toggle_all_floors_button",
  6436. interaction_source: "gui"
  6437. })),
  6438. i.removeClass("open")
  6439. })
  6440. }
  6441. function C(e, t) {
  6442. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? ($(".allFloorBtn").show(),$(".gui-floor-icon").hide(),$(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),$(".gui-floor-icon").show(),$(".gui-floor-title").hide()),
  6443. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6444. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6445. $(".floorChoice").removeClass("active"),
  6446. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6447. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6448. $(".floorChoice").removeClass("active"),
  6449. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6450. }
  6451. function I(e) {
  6452. return e.describe().inTransition
  6453. }
  6454. function b(e, t, i) {
  6455. Fe = e.heroLocations.length;
  6456. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6457. , r = 100 / Fe + "%"
  6458. , o = $("#thumb-container")
  6459. , a = $("#progressBar");
  6460. $("#status").find(".totalSteps").text(Fe);
  6461. for (var s = 0; s < Fe; s++) {
  6462. var c = e.heroLocations[s]
  6463. , h = $(n);
  6464. if (h.attr("data-index", s),
  6465. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6466. c.name) {
  6467. var u = $('<div class="overlay"></div>').text(c.name);
  6468. h.prepend(u)
  6469. }
  6470. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6471. var d = e.panos.get(c.panoId)
  6472. , p = d && !d.isAligned()
  6473. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6474. h.prepend(f)
  6475. }
  6476. o.append(h),
  6477. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6478. }
  6479. j = 144 * Fe,
  6480. Y = 111 * Fe,
  6481. $(".thumbImg").on("mouseover", function() {
  6482. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6483. }),
  6484. $(".thumbImg").on("mouseout", function() {
  6485. t.clearPath()
  6486. }),
  6487. $(".thumbImg").on("click", function(e) {
  6488. l(e);
  6489. var i = $(this);
  6490. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6491. J.trackAlways("showcase_gui", {
  6492. gui_action: "click_highlight"
  6493. }),
  6494. t.goToHighlight(i.data("index"))
  6495. }),
  6496. $(".previous").find("a").on("click", function(e) {
  6497. l(e),
  6498. J.trackAlways("showcase_gui", {
  6499. gui_action: "prev_highlight"
  6500. }),
  6501. t.prevHighlight()
  6502. }),
  6503. $(".next").find("a").on("click", function(e) {
  6504. l(e),
  6505. J.trackAlways("showcase_gui", {
  6506. gui_action: "next_highlight"
  6507. }),
  6508. t.nextHighlight()
  6509. }),
  6510. $("#drawer").on("mouseleave", function(e) {
  6511. l(e);
  6512. var t;
  6513. try {
  6514. t = new MouseEvent("mouseup",{
  6515. clientX: e.clientX,
  6516. clientY: e.clientY,
  6517. screenX: e.screenX,
  6518. screenY: e.screenY
  6519. })
  6520. } catch (i) {
  6521. t = document.createEvent("MouseEvents"),
  6522. t.initMouseEvent("mouseup", 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)
  6523. }
  6524. document.dispatchEvent(t)
  6525. }),
  6526. W = new Sly($("#scrollFrame"),{
  6527. horizontal: !0,
  6528. itemNav: "centered",
  6529. smart: !0,
  6530. scrollTrap: !0,
  6531. scrollBy: 1,
  6532. mouseDragging: !0,
  6533. touchDragging: !0,
  6534. speed: 300,
  6535. dragHandle: !0,
  6536. dynamicHandle: !0,
  6537. clickBar: !0,
  6538. scrollBar: $("#scroller"),
  6539. activateOn: null
  6540. }).init(),
  6541. W.on("active", function(e, t) {
  6542. Ve = t,
  6543. Ze("tour"),
  6544. $(".step").removeClass("active"),
  6545. $("#status").find(".curIdx").text(t + 1);
  6546. for (var i = 0; i <= t; i++)
  6547. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6548. }),
  6549. w()
  6550. }
  6551. function w() {
  6552. var e = $("#player").width() - 20
  6553. , t = $("#scroller")
  6554. , i = $("#drawer")
  6555. , n = $(".pinBottom");
  6556. if ($("#player").width() < 488 || $("#player").height() < 488)
  6557. t.addClass("hidden"),
  6558. i.addClass("noScroll"),
  6559. n.addClass("noScroll");
  6560. else {
  6561. var r = j > e
  6562. , o = !i.hasClass("noScroll")
  6563. , a = r !== o;
  6564. a && (t.toggleClass("hidden"),
  6565. i.toggleClass("noScroll"),
  6566. n.toggleClass("noScroll"))
  6567. }
  6568. }
  6569. function _(e) {
  6570. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6571. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6572. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6573. }
  6574. function T(e) {
  6575. function t(t, i) {
  6576. return !!e.player_options[t] && e[i || t]
  6577. }
  6578. $(".model-title").text(e.name);
  6579. var i = Q.pageTitle;
  6580. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6581. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6582. document.title = i ,
  6583. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6584. delay: {
  6585. show: 50,
  6586. hide: 0
  6587. },
  6588. trigger: "hover",
  6589. html: !1,
  6590. viewport: {
  6591. selector: "body",
  6592. padding: 10
  6593. }
  6594. }),
  6595. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6596. // t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  6597. de.populate({
  6598. name: t("model_name", "name"),
  6599. coBrand: t("presented_by"),
  6600. description: t("model_summary", "summary") || "暂无内容",
  6601. contactName: t("contact_name"),
  6602. address: t("address"),
  6603. phone: t("contact_phone"),
  6604. formattedPhone: e.formatted_contact_phone,
  6605. email: t("contact_email"),
  6606. url: t("external_url"),
  6607. socialSharing: e.enable_social_sharing && e.is_public
  6608. })
  6609. }
  6610. function x(e, t, i, n, r, o) {
  6611. function a() {
  6612. o.setLoadingStartTime(),
  6613. H(),
  6614. r ? (re.showMessage(t, i, je.coBrand.visible),
  6615. l()) : h(l)
  6616. }
  6617. var s = $.Deferred()
  6618. , l = s.resolve.bind(s);
  6619. return Ge = !0,
  6620. O(e),
  6621. e.data.player_options && _(e.data.player_options),
  6622. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6623. Re.localizeGUI(),
  6624. T(e.data),
  6625. r || $(".quick").addClass("hidden"),
  6626. //e.data.image && !r && E(e.data.image),
  6627. n ? (J.impression(),
  6628. a()) : (o.setWaitingStartTime(),
  6629. oe.show(r, a)),
  6630. s
  6631. }
  6632. function S(e, t, i, n, r, a, s) {
  6633. q = s,
  6634. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6635. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6636. ae.init(),
  6637. re.init(e, a),
  6638. Oe.init(e, t, n),
  6639. $(".icon").on("mouseover", function() {
  6640. t.player && t.player.reticule.hide()
  6641. }),
  6642. m(e, t),
  6643. A(e, t),
  6644. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(MP_PREFETCHED_MODELDATA.name/* e.data.name */),
  6645. Ce.on(Me.OPENED, function() {
  6646. var e = document.getElementById("share-modal");
  6647. return function() {
  6648. Ze("share"),
  6649. le.open(e)
  6650. }
  6651. }()),
  6652. Ce.on(Me.CLOSED, le.reset)),
  6653. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6654. je.tourControls.visible = !1),
  6655. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6656. z(),
  6657. g(i),
  6658. v(e, r),
  6659. e.on("floor.changed", C),
  6660. e.on("waiting", R.bind(this, e)),
  6661. e.on("waiting-done", P.bind(this, e)),
  6662. i.on(xe.ModeChanged, function(e, n) {
  6663. g(i),
  6664. o(t, i),
  6665. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6666. he.updateMode(n)
  6667. }),
  6668. n.on(Se.Move, Ze.bind(this, "move")),
  6669. i.on(xe.Ready, function() {
  6670. ie.init(n, i, i.tagManager, t),
  6671. i.on(xe.ModeChanged, function(e, t) {
  6672. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6673. })
  6674. }),
  6675. i.on(xe.PanoChosen, function(e, t) {
  6676. g(i, t),
  6677. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6678. }),
  6679. le.on(ce.CLOSE, function(e) {
  6680. switch (e) {
  6681. case "vr-modal":
  6682. Ae.dismiss();
  6683. break;
  6684. case "share-modal":
  6685. Ce.hide();
  6686. break;
  6687. case "terms-modal":
  6688. fe.hide()
  6689. }
  6690. });
  6691. var l = $("#play").eq(0)
  6692. , c = $("#pause").eq(0)
  6693. , h = $(".pinBottom").toArray()
  6694. , u = $("#drawer").eq(0)
  6695. , d = $("#playHead").eq(0)
  6696. , p = $("#progressBar").eq(0)
  6697. , f = $("#thumb-container").eq(0)
  6698. , y = f.children()
  6699. , I = p.children();
  6700. t.on("update.controls", function() {
  6701. var n = t.describe();
  6702. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6703. c.show()),
  6704. n.tourInProgress && (h.forEach(function(e) {
  6705. e.classList.add("playing")
  6706. }),
  6707. u.addClass("playing"),
  6708. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6709. c.hide()),
  6710. n.tourInProgress || (ve.stopTour(),
  6711. h.forEach(function(e) {
  6712. e.classList.remove("playing")
  6713. }),
  6714. u.removeClass("playing"),
  6715. d.removeClass("playing")));
  6716. var r, a, s;
  6717. if (null !== n.currentItem) {
  6718. var p, f;
  6719. $("#status").find(".curIdx").text(n.currentItem + 1),
  6720. n.onTheBus ? (p = "active",
  6721. f = "recent") : (f = "active",
  6722. p = "recent");
  6723. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6724. for (r = 0; r < e.heroLocations.length; r += 1)
  6725. s = y.eq(r),
  6726. a = I.eq(r),
  6727. s.removeClass(f),
  6728. a.removeClass(f),
  6729. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6730. a.addClass(p),
  6731. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6732. a.addClass(p)) : (s.removeClass(p),
  6733. a.removeClass(p))
  6734. } else
  6735. for (r = 0; r < e.heroLocations.length; r += 1)
  6736. s = y.eq(r),
  6737. a = I.eq(r),
  6738. s.removeClass("active recent"),
  6739. a.removeClass("active recent");
  6740. o(t, i)
  6741. }),
  6742. document.addEventListener("keydown", function(n) {
  6743. switch (J.updateInteraction(Se.InteractionKey),
  6744. n.which) {
  6745. case we.ZERO:
  6746. Q.debug && e.toggleAlpha();
  6747. break;
  6748. case we.NINE:
  6749. Q.debug && se.toggle();
  6750. break;
  6751. case we.ONE:
  6752. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6753. break;
  6754. case we.TWO:
  6755. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6756. break;
  6757. case we.THREE:
  6758. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6759. break;
  6760. case we.FOUR:
  6761. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6762. break;
  6763. case we.SPACE:
  6764. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6765. break;
  6766. case we.RETURN:
  6767. Q.debug && e.toggleExplodeUp();
  6768. break;
  6769. case we.P:
  6770. k();
  6771. break;
  6772. case we.U:
  6773. B();
  6774. break;
  6775. case we.X:
  6776. Q.debug && e.toggleExplode();
  6777. break;
  6778. case we.PLUSEQUALS:
  6779. t.player.activatePersistentZooming(!0),
  6780. ie.hideUi();
  6781. break;
  6782. case we.DASHUNDERSCORE:
  6783. t.player.activatePersistentZooming(!1),
  6784. ie.hideUi();
  6785. break;
  6786. case we.SEVEN:
  6787. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6788. break;
  6789. case we.EIGHT:
  6790. t.player.decreaseZoomSpeed();
  6791. break;
  6792. case we.NINE:
  6793. t.player.increaseZoomSpeed()
  6794. }
  6795. return i && i.reticule.hide(),
  6796. !0
  6797. }
  6798. .bind(this)),
  6799. document.addEventListener("keyup", function(e) {
  6800. switch (e.which) {
  6801. case we.PLUSEQUALS:
  6802. t.player.deactivatePersistentZooming();
  6803. break;
  6804. case we.DASHUNDERSCORE:
  6805. t.player.deactivatePersistentZooming()
  6806. }
  6807. }
  6808. .bind(this)),
  6809. F(e),
  6810. L(e, t.player),
  6811. M(i),
  6812. te.setAutoPlay(e.heroCount()),
  6813. he.init(i, a.mode),
  6814. he.on(ue.OPENED, Ze.bind(this, "help")),
  6815. fe.init(),
  6816. fe.on(ge.OPENED, function() {
  6817. var e = document.getElementById("terms-modal");
  6818. return function() {
  6819. Ze("terms"),
  6820. le.open(e)
  6821. }
  6822. }()),
  6823. fe.on(ge.CLOSED, le.reset),
  6824. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6825. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6826. Q.profiling.enabled && se.show(),
  6827. ve.init(t)
  6828. }
  6829. function M(e) {
  6830. var t = function(e, t) {
  6831. $(e).find("a").each(function(e, i) {
  6832. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6833. i.style.pointerEvents = t ? "auto" : "none"
  6834. })
  6835. }
  6836. , i = function() {
  6837. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6838. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6839. };
  6840. e.on(Ne.ZoomMax, function() {
  6841. t("#gui-zoomin", !1),
  6842. t("#gui-zoomout", !0)
  6843. }),
  6844. e.on(Ne.ZoomMin, function() {
  6845. t("#gui-zoomin", !0),
  6846. t("#gui-zoomout", !1)
  6847. }),
  6848. e.on(Ne.ZoomIn, function() {
  6849. t("#gui-zoomout", !0)
  6850. }),
  6851. e.on(Ne.ZoomOut, function() {
  6852. t("#gui-zoomin", !0)
  6853. }),
  6854. i()
  6855. }
  6856. function R(e) {
  6857. O(e)
  6858. }
  6859. function P(e) {
  6860. O(e)
  6861. }
  6862. function O(e) {
  6863. var t = e.waitQueue.length;
  6864. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6865. }
  6866. function L(e, t) {
  6867. He = {
  6868. gui: null,
  6869. visible: !1,
  6870. model: e,
  6871. player: t
  6872. }
  6873. }
  6874. function D(e, t) {
  6875. function i() {
  6876. var i = t.toJSON();
  6877. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6878. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6879. }
  6880. var n = {}
  6881. , r = new Le.GUI({
  6882. autoPlace: !0,
  6883. width: "60%"
  6884. });
  6885. i(),
  6886. t.on(xe.ViewChanged, i),
  6887. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6888. r.domElement.id = "datLinks";
  6889. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6890. return o.forEach(function(e) {
  6891. if (!K.detectSafari()) {
  6892. var t = document.createElement("button");
  6893. t.classList.add("btn-deep-link"),
  6894. t.innerText = Re.MENU_COPY,
  6895. e.nextSibling.appendChild(t);
  6896. var i = function() {
  6897. alert(Re.LINK_ALERT_COPY),
  6898. t.hide()
  6899. };
  6900. t.addEventListener("click", function(e) {
  6901. try {
  6902. var t = e.target.parentNode.childNodes[0];
  6903. t.select();
  6904. var n = document.execCommand("copy");
  6905. t.blur(),
  6906. n || i()
  6907. } catch (e) {
  6908. i()
  6909. }
  6910. })
  6911. }
  6912. }),
  6913. $(r.__closeButton).hide(),
  6914. r
  6915. }
  6916. function N(e) {
  6917. He.gui || (He.gui = D(He.model, He.player)),
  6918. He.visible = e,
  6919. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6920. }
  6921. function B() {
  6922. N(!He.visible)
  6923. }
  6924. function F(e) {
  6925. ke = {
  6926. gui: null,
  6927. visible: !1,
  6928. model: e
  6929. }
  6930. }
  6931. function V(e) {
  6932. var t = new Le.GUI;
  6933. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6934. e.setSweepVisibility(Q.showSweeps)
  6935. }),
  6936. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6937. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6938. Q.transition.flySpeed = 0,
  6939. t.__controllers.forEach(function(e) {
  6940. e.updateDisplay()
  6941. })
  6942. }),
  6943. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6944. $(t.__closeButton).hide(),
  6945. t
  6946. }
  6947. function U(e) {
  6948. ke.gui || (ke.gui = V(ke.model)),
  6949. ke.visible = e,
  6950. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6951. }
  6952. function k() {
  6953. U(!ke.visible)
  6954. }
  6955. function H() {
  6956. function e(e) {
  6957. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  6958. }
  6959. $("body").css("touch-action", "none"),
  6960. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6961. // e.preventDefault()
  6962. });
  6963. var t = document.getElementById("terms-text")
  6964. , i = document.getElementById("more-help-wrapper")
  6965. , n = (document.getElementById("navigation-help-wrapper"),
  6966. document.getElementById("help-dialog"),
  6967. document.getElementById("tag-billboards"));
  6968. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  6969. document.body.addEventListener("DOMMouseScroll", e)),
  6970. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6971. e.stopPropagation()
  6972. })
  6973. }
  6974. function G(e, t) {
  6975. for (var i = []; e; )
  6976. i.push(e),
  6977. e = e.parentNode;
  6978. for (; t && i.indexOf(t) === -1; )
  6979. t = t.parentNode;
  6980. return t
  6981. }
  6982. function z() {
  6983. var e, t = function(t) {
  6984. e = 0 === t.button || 1 === t.which ? t.target : null
  6985. }, i = function(t) {
  6986. e !== t.target && (e = G(e, t.target));
  6987. var i = document.getElementById("gui-parent");
  6988. if (G(i, e) !== i && (e = null),
  6989. e) {
  6990. var n;
  6991. try {
  6992. n = new MouseEvent("click",t)
  6993. } catch (e) {
  6994. n = document.createEvent("MouseEvents"),
  6995. n.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)
  6996. }
  6997. n.syntheticClick = !0,
  6998. e.dispatchEvent(n),
  6999. e = null
  7000. }
  7001. };
  7002. document.body.addEventListener("mousedown", t, !0),
  7003. document.body.addEventListener("mouseup", i, !0),
  7004. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7005. e.syntheticClick || (e.stopPropagation(),
  7006. "A" === e.target.nodeName && e.preventDefault())
  7007. }, !0)
  7008. }
  7009. var W, j, Y, X, Z, q, K = (e("three"),
  7010. e("../util/ajax"),
  7011. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7012. e("../util/camera"),
  7013. e("../util/logger")), te = (e("../objects/Snapshot"),
  7014. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  7015. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7016. e("../enum/PathDisplayMode"),
  7017. e("../enum/DirectorEvents"),
  7018. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7019. e("../enum/WarpStyle"),
  7020. e("../enum/AlignmentType"),
  7021. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7022. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7023. coBrand: {
  7024. visible: !0,
  7025. elements: [".co-brand", "#loaderCoBrand"]
  7026. },
  7027. help: {
  7028. visible: !0,
  7029. elements: [".nav-help", "#nav-help"]
  7030. },
  7031. tourControls: {
  7032. visible: !0,
  7033. elements: [".next", ".previous", "#play"]
  7034. },
  7035. highlight: {
  7036. visible: !0,
  7037. elements: ["#drawer", "#pullTab"]
  7038. },
  7039. share: {
  7040. visible: !0,
  7041. elements: [".socialButton", "#share"]
  7042. },
  7043. fullScreen: {
  7044. visible: !0,
  7045. elements: ["#gui-fullscreen"]
  7046. },
  7047. floors: {
  7048. visible: !0,
  7049. elements: [".gui-floor"]
  7050. }
  7051. }, Ye = function() {
  7052. var e = document.getElementById("drawer");
  7053. return function() {
  7054. $("#player").height() < 400 && e.classList.contains("open") && a()
  7055. }
  7056. }(), Xe = function() {
  7057. var e = document.getElementById("meta-info");
  7058. return function() {
  7059. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7060. }
  7061. }(), Ze = function(e) {
  7062. function t() {
  7063. u.classList.contains("expand") && de.toggleMeta(!0)
  7064. }
  7065. function i() {
  7066. fe.hide()
  7067. }
  7068. function n() {
  7069. he.close()
  7070. }
  7071. function r() {
  7072. Ae.dismiss()
  7073. }
  7074. function o() {
  7075. p.hasClass("open") && a(!0)
  7076. }
  7077. function l() {
  7078. Ce.hide()
  7079. }
  7080. function c() {
  7081. f.hasClass("open") && f.removeClass("open")
  7082. }
  7083. function h() {
  7084. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7085. }
  7086. var u = document.getElementById("meta-info")
  7087. , d = document.getElementById("interaction-modal")
  7088. , p = $("#drawer").eq(0)
  7089. , f = $(".gui-floor").eq(0)
  7090. , g = $(".vr-popup").eq(0);
  7091. return function(e) {
  7092. switch (e) {
  7093. case "info":
  7094. i(),
  7095. n(),
  7096. Ye(),
  7097. l(),
  7098. c(),
  7099. r(),
  7100. h();
  7101. break;
  7102. case "terms":
  7103. t(),
  7104. n(),
  7105. o(),
  7106. l(),
  7107. c(),
  7108. r(),
  7109. h();
  7110. break;
  7111. case "help":
  7112. t(),
  7113. i(),
  7114. l(),
  7115. c(),
  7116. r(),
  7117. h();
  7118. break;
  7119. case "vr":
  7120. t(),
  7121. i(),
  7122. l(),
  7123. c(),
  7124. n(),
  7125. h(),
  7126. s(g) && o();
  7127. break;
  7128. case "highlights":
  7129. Xe(),
  7130. i(),
  7131. l(),
  7132. c();
  7133. break;
  7134. case "share":
  7135. t(),
  7136. i(),
  7137. n(),
  7138. c(),
  7139. r(),
  7140. h();
  7141. break;
  7142. case "floor":
  7143. i(),
  7144. l(),
  7145. r();
  7146. break;
  7147. case "view":
  7148. c(),
  7149. l(),
  7150. i(),
  7151. r();
  7152. break;
  7153. case "tour":
  7154. i(),
  7155. l(),
  7156. c(),
  7157. r();
  7158. break;
  7159. case "move":
  7160. i(),
  7161. l(),
  7162. c(),
  7163. r();
  7164. break;
  7165. case "resize":
  7166. t(),
  7167. Ye(),
  7168. c();
  7169. break;
  7170. case "tag":
  7171. i(),
  7172. n(),
  7173. l(),
  7174. c(),
  7175. r()
  7176. }
  7177. }
  7178. }();
  7179. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7180. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7181. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7182. setTimeout(function() {
  7183. $(".icon:visible").hide().show(0)
  7184. }, 100)
  7185. }),
  7186. $("#gui-fullscreen").find("a").on("click", function(e) {
  7187. l(e),
  7188. K.requestFullscreen($("body")[0]),
  7189. J.track("showcase_gui", {
  7190. gui_action: "click_enter_fullscreen",
  7191. interaction_source: "gui"
  7192. })
  7193. //czj
  7194. //W.reload()
  7195. }),
  7196. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7197. l(e),
  7198. K.exitFullscreen(),
  7199. J.track("showcase_gui", {
  7200. gui_action: "click_exit_fullscreen",
  7201. interaction_source: "gui"
  7202. })
  7203. })
  7204. $(window).on("resize", function(e) {
  7205. var t = e.target.innerHeight
  7206. , i = e.target.innerWidth;
  7207. t === X && i === Z || (je.highlight.visible && w(),
  7208. Ze("resize"),
  7209. $(".pinTop.right").removeClass("hideUnderMeta"),
  7210. c(),
  7211. X = t,
  7212. Z = i)
  7213. }).resize(),
  7214. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7215. $("#pullTab").on("click", function(e) {
  7216. l(e),
  7217. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7218. gui_action: "hide_highlight_reel"
  7219. }),
  7220. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7221. gui_action: "show_highlight_reel"
  7222. }),
  7223. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7224. a()
  7225. });
  7226. /***********************方奕卓 热点列表事件监听 ************************/
  7227. if(window.MP_PREFETCHED_MODELDATA.showHotListSta) {
  7228. $('#hotList').css('display', '');
  7229. $('#hotList').on('click',function(e){
  7230. l(e);
  7231. var hotList = $('#hotListWrap')[0];
  7232. var isActive = hotList.classList.contains('hotListActive');
  7233. if(isActive){
  7234. hotList.classList.remove('hotListActive');
  7235. this.classList.remove('active')
  7236. }else{
  7237. hotList.classList.add('hotListActive');
  7238. this.classList.add('active')
  7239. }
  7240. }),
  7241. $('#hotListContent ul').on('mouseover', function(e){
  7242. l(e);
  7243. var target = e.target;
  7244. var hotList = document.getElementById('hotListWrap');
  7245. if(target.tagName === 'SPAN'){
  7246. var targetParent = target.parentElement.parentElement;
  7247. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7248. hotList.style.width = target.offsetWidth + 116 + 'px';
  7249. }else{
  7250. hotList.style.width = '';
  7251. }
  7252. }else if(target.tagName === 'LI'){
  7253. var targetParent = target.parentElement;
  7254. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7255. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7256. }else{
  7257. hotList.style.width = ''
  7258. }
  7259. }else {
  7260. hotList.style.width = '';
  7261. }
  7262. });
  7263. $('#hotListContent ul').on('click', function(e){
  7264. l(e);
  7265. this.preElem && this.preElem.classList.remove('active');
  7266. if(e.target.tagName === 'SPAN'){
  7267. e.target.parentElement.classList.add('active');
  7268. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7269. this.preElem = e.target.parentElement;
  7270. }else{
  7271. e.target.classList.add('active');
  7272. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7273. this.preElem = e.target;
  7274. }
  7275. })
  7276. $('#hotListClose').on('click', function(e){
  7277. l(e);
  7278. var hotList = $('#hotListWrap')[0];
  7279. hotList.classList.remove('hotListActive');
  7280. $('#hotListContent ul .active').removeClass('active');
  7281. $('#hotList')[0].classList.remove('active')
  7282. })
  7283. }
  7284. /*****************************************************************/
  7285. $("#more-menu-button").on("click", function(e) {
  7286. l(e);
  7287. var t = $("#more-menu");
  7288. t.toggleClass("open")
  7289. }),
  7290. t.exports.init = S,
  7291. t.exports.startLoading = x,
  7292. t.exports.endLoading = d,
  7293. t.exports.onProgress = u
  7294. }
  7295. ).call(this, "/js/gui/gui.js")
  7296. }
  7297. , {
  7298. "../analytics": 4,
  7299. "../controls/serializer": 14,
  7300. "../enum/AlignmentType": 17,
  7301. "../enum/BlackoutStyle": 18,
  7302. "../enum/ControlEvents": 21,
  7303. "../enum/DirectorEvents": 23,
  7304. "../enum/Keys": 30,
  7305. "../enum/PathDiscardMode": 38,
  7306. "../enum/PathDisplayMode": 39,
  7307. "../enum/PlayerEvents": 40,
  7308. "../enum/VROption": 47,
  7309. "../enum/Vectors": 50,
  7310. "../enum/Viewmode": 51,
  7311. "../enum/WarpStyle": 52,
  7312. "../enum/ZoomEvents": 53,
  7313. "../lib/dat.gui": 93,
  7314. "../localization/localize": 108,
  7315. "../tag/Media/MediaEvent": 131,
  7316. "../objects/Snapshot": 153,
  7317. "../settings": 166,
  7318. "../util/ajax": 181,
  7319. "../util/browser": 182,
  7320. "../util/camera": 183,
  7321. "../util/logger": 189,
  7322. "../util/showcase": 193,
  7323. "../util/transitions": 195,
  7324. "./closer/ModalCloserEvent": 61,
  7325. "./closer/modalCloser": 62,
  7326. "./help/HelpEvent": 66,
  7327. "./help/help": 67,
  7328. "./helpManager": 68,
  7329. "./immersiveMode": 69,
  7330. "./konami": 70,
  7331. "./landingScreen": 71,
  7332. "./loadingScreen": 72,
  7333. "./memoryUsage": 73,
  7334. "./playButton": 74,
  7335. "./populateModal": 75,
  7336. "./sharing/ShareEvents": 76,
  7337. "./sharing/modal": 77,
  7338. "./terms/TermsEvent": 78,
  7339. "./terms/terms": 79,
  7340. "./title/TitleEvents": 80,
  7341. "./title/tagToggle": 81,
  7342. "./title/titleBar": 82,
  7343. "./tourInteraction": 84,
  7344. "./vr/vrEvent": 85,
  7345. "./vr/vrModal": 87,
  7346. "./webvr/WebVrEvent": 88,
  7347. "./webvr/webVRgui": 89,
  7348. three: 217
  7349. }],
  7350. 66: [function(e, t, i) {
  7351. "use strict";
  7352. t.exports = Object.freeze({
  7353. OPENED: "help.opened",
  7354. CLOSED: "help.closed"
  7355. })
  7356. }
  7357. , {}],
  7358. 67: [function(e, t, i) {
  7359. "use strict";
  7360. function n() {
  7361. g.on("click", function(e) {
  7362. if (S && S !== l.TRANSITIONING) {
  7363. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7364. t && !M ? R.close() : r()
  7365. }
  7366. }),
  7367. w.on("click", function(e) {
  7368. R.close()
  7369. }),
  7370. E.on("click", function(e) {
  7371. S && S !== l.TRANSITIONING && (s(),
  7372. o())
  7373. }),
  7374. b.on("click", function(e) {
  7375. s(),
  7376. a()
  7377. })
  7378. }
  7379. function r() {
  7380. S && S !== l.TRANSITIONING && (M = !0,
  7381. setTimeout(function() {
  7382. M = !1
  7383. }, d.help.modalStayDuration),
  7384. R.emit(h.OPENED),
  7385. m.addClass("open " + S),
  7386. g.addClass("open"),
  7387. s(),
  7388. o(),
  7389. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7390. y.classList.add("fadeIn"))
  7391. }
  7392. function o() {
  7393. E.addClass("underline-tab"),
  7394. u.fill(_, c.NAVIGATION, S),
  7395. m.addClass(S)
  7396. }
  7397. function a() {
  7398. b.addClass("underline-tab"),
  7399. u.fill(T, c.MORE_HELP),
  7400. m.addClass("more-help")
  7401. }
  7402. function s(e, t) {
  7403. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7404. I.forEach(function(e) {
  7405. e.classList.remove("underline-tab")
  7406. })
  7407. }
  7408. var l = e("../../enum/Viewmode")
  7409. , c = e("../../enum/HelpModalType")
  7410. , h = e("./HelpEvent")
  7411. , u = (e("../helpManager"),
  7412. e("./../populateModal"))
  7413. , d = e("../../settings")
  7414. , p = e("../../util/common")
  7415. , f = e("events").EventEmitter
  7416. , g = $(".footer-help").eq(0)
  7417. , m = $("#help-dialog").eq(0)
  7418. , v = document.querySelector("#quick-logo")
  7419. , A = document.querySelector("#loaderCoBrand")
  7420. , y = document.querySelector("#help-dialog")
  7421. , C = document.querySelector(".footer")
  7422. , I = $(".help-tabs").children().toArray()
  7423. , E = $(".navigation-tab").eq(0)
  7424. , b = $(".more-help-tab").eq(0)
  7425. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7426. m.find(".close").eq(0))
  7427. , _ = m.find(".interactions").toArray()
  7428. , T = m.find(".ui-instructions").toArray()
  7429. , x = l.PANORAMA
  7430. , S = l.PANORAMA
  7431. , M = !1
  7432. , R = {
  7433. init: function(e, t) {
  7434. S = t,
  7435. x = t,
  7436. [y, A, v, C].forEach(function(e) {
  7437. e.classList.add(u.deviceType)
  7438. }),
  7439. n()
  7440. },
  7441. close: function() {
  7442. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7443. g.removeClass("open"),
  7444. m.removeClass("open"),
  7445. y.classList.contains("fadeIn"))) {
  7446. y.classList.remove("fadeIn");
  7447. var e = S === l.TRANSITIONING ? x : S;
  7448. u.clear(_, c.NAVIGATION, e)
  7449. }
  7450. },
  7451. updateMode: function(e) {
  7452. x = S,
  7453. S = e
  7454. }
  7455. };
  7456. p.extendObject(R, f.prototype),
  7457. t.exports = R
  7458. }
  7459. , {
  7460. "../../enum/HelpModalType": 28,
  7461. "../../enum/Viewmode": 51,
  7462. "../../settings": 166,
  7463. "../../util/common": 185,
  7464. "../helpManager": 68,
  7465. "./../populateModal": 75,
  7466. "./HelpEvent": 66,
  7467. events: 202
  7468. }],
  7469. 68: [function(e, t, i) {
  7470. (function(i) {
  7471. "use strict";
  7472. var n = e("../util/browser")
  7473. , r = e("./../util/logger")
  7474. , o = e("./../settings")
  7475. , a = new r(i)
  7476. , s = function() {
  7477. var e;
  7478. try {
  7479. return e = window.localStorage.getItem("visitCount") || "0",
  7480. e = (parseFloat(e) + 1).toString(),
  7481. window.localStorage.setItem("visitCount", e),
  7482. a.debug("visitCount = " + e),
  7483. e
  7484. } catch (t) {
  7485. e = "1",
  7486. a.debug("couldn't set local storage")
  7487. }
  7488. }()
  7489. , l = !1;
  7490. t.exports = {
  7491. isHelpDisabled: function() {
  7492. return "0" === n.valueFromHash("help", null) || l
  7493. },
  7494. isLargeHelpEnabled: function() {
  7495. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7496. },
  7497. isSmallHelpEnabled: function() {
  7498. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7499. },
  7500. isHelpEnabled: function() {
  7501. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7502. },
  7503. setAutoPlay: function(e) {
  7504. l = o.warp.auto >= 0 && e > 1
  7505. }
  7506. }
  7507. }
  7508. ).call(this, "/js/gui/helpManager.js")
  7509. }
  7510. , {
  7511. "../util/browser": 182,
  7512. "./../settings": 166,
  7513. "./../util/logger": 189
  7514. }],
  7515. 69: [function(e, t, i) {
  7516. "use strict";
  7517. function n(e, t, i, n) {
  7518. F = n,
  7519. r(e, t, i, F),
  7520. o(),
  7521. N = t.mode
  7522. }
  7523. function r(e, t, i, n) {
  7524. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7525. e.controls[t].on(v.Move, a),
  7526. e.controls[t].on(v.LongTap, c)
  7527. }),
  7528. M.on("mousewheel DOMMouseScroll", a),
  7529. i.on(m.TagActivated, a),
  7530. i.on(m.TagNavigation, a),
  7531. t.on(A.FlyingEnded, s),
  7532. t.on(A.ModeChanging, function(e, t) {
  7533. B = t !== C.PANORAMA && e !== C.PANORAMA
  7534. }),
  7535. t.on(A.ModeChanged, function(e, i) {
  7536. N = t.mode,
  7537. i !== C.TRANSITIONING ? l() : a("modeChange")
  7538. }),
  7539. n.on(y.TourStart, function() {
  7540. L = !0,
  7541. a()
  7542. }),
  7543. n.on(y.TourEnd, function() {
  7544. L = !1,
  7545. l()
  7546. }),
  7547. n.on(y.ActionInterrupted, function() {
  7548. L = !1
  7549. }),
  7550. R.addEventListener("touchend", function() {
  7551. $("#pullTab").hasClass("opened") && !L && l()
  7552. }, !0)
  7553. }
  7554. function o() {
  7555. p.isMobile() ? (b.forEach(function(e) {
  7556. e.classList.add("mobile")
  7557. }),
  7558. w.click(l)) : (b.forEach(function(e) {
  7559. e.addEventListener("mouseleave", function() {
  7560. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7561. }, !0)
  7562. }),
  7563. M.mouseleave(function() {
  7564. b[0].classList.contains("detectHover") && l()
  7565. }))
  7566. }
  7567. function a(e) {
  7568. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7569. P = !0,
  7570. g.close(),
  7571. h(e),
  7572. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7573. _.hasClass("playing") || (b.forEach(function(e) {
  7574. e.classList.add("detectHover")
  7575. }),
  7576. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7577. }
  7578. function s() {
  7579. _.hasClass("playing") || (clearTimeout(O),
  7580. O = setTimeout(l, f.immersive.timeToShowAgain))
  7581. }
  7582. function l() {
  7583. clearTimeout(O),
  7584. P = !1,
  7585. I.forEach(function(e) {
  7586. e.classList.remove("drawerOpen")
  7587. }),
  7588. L || E.forEach(function(e) {
  7589. e.classList.remove("duringTour")
  7590. }),
  7591. b.forEach(function(e) {
  7592. e.classList.remove("detectHover")
  7593. })
  7594. }
  7595. function c() {
  7596. P ? l() : a(),
  7597. D = !0,
  7598. setTimeout(function() {
  7599. D = !1
  7600. }, f.immersive.uiStayDuration)
  7601. }
  7602. function h(e) {
  7603. !d(e) && L ? E.forEach(function(e) {
  7604. e.classList.remove("drawerOpen"),
  7605. e.classList.add("duringTour")
  7606. }) : _.hasClass("open") ? E.forEach(function(e) {
  7607. e.classList.remove("duringTour"),
  7608. e.classList.add("drawerOpen")
  7609. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7610. e.classList.add("fadeOut")
  7611. })
  7612. }
  7613. function u() {
  7614. T.hasClass("duringTour") || (L = !1,
  7615. a("gui"),
  7616. l())
  7617. }
  7618. function d(e) {
  7619. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7620. }
  7621. var p = e("../util/browser")
  7622. , f = e("../settings")
  7623. , g = e("./help/help")
  7624. , m = e("../enum/tagEvents")
  7625. , v = e("../enum/ControlEvents")
  7626. , A = e("../enum/PlayerEvents")
  7627. , y = e("../enum/DirectorEvents")
  7628. , A = e("../enum/PlayerEvents")
  7629. , C = e("../enum/Viewmode")
  7630. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7631. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7632. , b = $("#hover-bottom, #hover-top").toArray()
  7633. , w = ($("#pullTab").eq(0),
  7634. $("#playHead").eq(0),
  7635. $(".pinBottom-container").eq(0))
  7636. , _ = $("#drawer").eq(0)
  7637. , T = $("#drawer-container").eq(0)
  7638. , x = $("#meta-info").eq(0)
  7639. , S = $(".pinTop.left").eq(0)
  7640. , M = $("#player").eq(0)
  7641. , R = document.getElementById("pullTab")
  7642. , P = !1
  7643. , O = null
  7644. , L = !1
  7645. , D = !1
  7646. , N = null
  7647. , B = !1
  7648. , F = null;
  7649. t.exports.init = n,
  7650. t.exports.hideUi = a,
  7651. t.exports.resetDrawer = u
  7652. }
  7653. , {
  7654. "../enum/ControlEvents": 21,
  7655. "../enum/DirectorEvents": 23,
  7656. "../enum/tagEvents": 32,
  7657. "../enum/PlayerEvents": 40,
  7658. "../enum/Viewmode": 51,
  7659. "../settings": 166,
  7660. "../util/browser": 182,
  7661. "./help/help": 67
  7662. }],
  7663. 70: [function(e, t, i) {
  7664. (function(i) {
  7665. "use strict";
  7666. function n(e, t, i) {
  7667. l.debug("konami has the modelInstance");
  7668. var n = [];
  7669. $(window).on("keydown", function(e) {
  7670. n.push(e.which),
  7671. n.length > o.secretPanelWord.length && n.shift(),
  7672. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7673. o.debug = !0)
  7674. }),
  7675. $(window).on("keydown", function n(r) {
  7676. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7677. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7678. })
  7679. }
  7680. var r = e("./../util/logger")
  7681. , o = e("./../settings")
  7682. , a = e("./debug")
  7683. , s = e("./../util/common")
  7684. , l = (e("./gui"),
  7685. new r(i));
  7686. o.console && $("body").append('<div id="debug-console"></div>'),
  7687. t.exports.init = n
  7688. }
  7689. ).call(this, "/js/gui/konami.js")
  7690. }
  7691. , {
  7692. "./../settings": 166,
  7693. "./../util/common": 185,
  7694. "./../util/logger": 189,
  7695. "./debug": 63,
  7696. "./gui": 65
  7697. }],
  7698. 71: [function(e, t, i) {
  7699. "use strict";
  7700. function n(e, t) {
  7701. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7702. }
  7703. function r(e) {
  7704. var t = $.Deferred();
  7705. e || t.resolve();
  7706. var i = c.startupFlyinDelay;
  7707. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7708. setTimeout(t.resolve.bind(t), i),
  7709. t
  7710. }
  7711. function o(e, t, i) {
  7712. var n = 0;
  7713. c.quickstart.enabled && (a(i),
  7714. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7715. var r = function() {
  7716. e.once(g.Move, l),
  7717. t.once(f.TourStart, l)
  7718. };
  7719. s(n, r)
  7720. }
  7721. function a(e) {
  7722. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7723. v.before(y),
  7724. A = $(".quick-brand").toArray()),*/
  7725. m.addClass("fadeOut"),
  7726. setTimeout(function() {
  7727. A.forEach(function(e) {
  7728. e.classList.add("fadeIn")
  7729. })
  7730. }, c.quickstart.showTextDelay),
  7731. setTimeout(function() {
  7732. A.forEach(function(e) {
  7733. e.classList.add("fadeOut")
  7734. })
  7735. }, c.quickstart.fadeOutDelay),
  7736. !0
  7737. }
  7738. function s(e, t) {
  7739. setTimeout(function() {
  7740. if (h.isHelpEnabled()) {
  7741. if (t(),
  7742. u.init(),
  7743. C.addClass("fadeIn landing " + u.deviceType),
  7744. h.isSmallHelpEnabled())
  7745. return void C.addClass("small");
  7746. u.fill(I, d.LANDING[E]),
  7747. C.addClass(E)
  7748. }
  7749. }, e)
  7750. //csz 用户引导界面
  7751. var helpData = {
  7752. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7753. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7754. }
  7755. var navIcon = $(".nav-icon .icon");
  7756. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7757. function paging(id){
  7758. id.on("click",function(){
  7759. var navPage = null;
  7760. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7761. if(navPage > helpData.length || navPage < 1) return false
  7762. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7763. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7764. }else{
  7765. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7766. }
  7767. })
  7768. };
  7769. paging($(".next-button"));
  7770. paging($(".prev-button"));
  7771. }
  7772. function l() {
  7773. u.clear(I, d.LANDING[E]),
  7774. C.removeClass("fadeIn")
  7775. }
  7776. var c = e("../settings")
  7777. , h = (e("./help/help"),
  7778. e("./helpManager"))
  7779. , u = e("./populateModal")
  7780. , d = e("../enum/HelpModalType")
  7781. , p = e("../enum/Viewmode")
  7782. , f = e("../enum/DirectorEvents")
  7783. , g = e("../enum/PlayerEvents")
  7784. , m = $("#quick-blackout").eq(0)
  7785. , v = $("#quick-logo").eq(0)
  7786. , A = $(".quick-brand").toArray()
  7787. , y = $("#loaderCoBrand").eq(0)
  7788. , C = $("#interaction-modal").eq(0)
  7789. , I = C.find(".interaction").toArray()
  7790. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7791. "");
  7792. t.exports.delayLanding = r,
  7793. t.exports.showMessage = o,
  7794. t.exports.init = n,
  7795. t.exports.dismissModal = l
  7796. }
  7797. , {
  7798. "../enum/DirectorEvents": 23,
  7799. "../enum/HelpModalType": 28,
  7800. "../enum/PlayerEvents": 40,
  7801. "../enum/Viewmode": 51,
  7802. "../settings": 166,
  7803. "./help/help": 67,
  7804. "./helpManager": 68,
  7805. "./populateModal": 75
  7806. }],
  7807. 72: [function(e, t, i) {
  7808. "use strict";
  7809. var n = e("./circleLoader").circleLoader;
  7810. t.exports = {
  7811. element: $("#gui-loading"),
  7812. hide: function(e) {
  7813. n.done(),
  7814. this.element.fadeOut(1500, e)
  7815. },
  7816. show: function(e) {
  7817. this.element.fadeIn(500, function() {
  7818. this.element.css("display", "table"),
  7819. e && e()
  7820. }
  7821. .bind(this))
  7822. },
  7823. progress: function(e) {
  7824. n.set(e)
  7825. }
  7826. }
  7827. }
  7828. , {
  7829. "./circleLoader": 60
  7830. }],
  7831. 73: [function(e, t, i) {
  7832. "use strict";
  7833. var n = e("../settings")
  7834. , r = $("#memory-info")
  7835. , o = r.find("#memory-gpu")
  7836. , a = !1;
  7837. t.exports = {
  7838. show: function() {
  7839. n.profiling.enabled && (r.show(),
  7840. a = !0)
  7841. },
  7842. hide: function() {
  7843. r.hide(),
  7844. a = !1
  7845. },
  7846. toggle: function() {
  7847. a ? this.hide() : this.show()
  7848. },
  7849. update: function(e) {
  7850. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7851. }
  7852. }
  7853. }
  7854. , {
  7855. "../settings": 166
  7856. }],
  7857. 74: [function(e, t, i) {
  7858. "use strict";
  7859. var n = e("../util/browser")
  7860. , r = e("../analytics");
  7861. e("../settings");
  7862. t.exports = {
  7863. show: function(e, t) {
  7864. $("#gui-message").fadeOut(500, function() {
  7865. t()
  7866. })
  7867. }
  7868. }
  7869. }
  7870. , {
  7871. "../analytics": 4,
  7872. "../settings": 166,
  7873. "../util/browser": 182
  7874. }],
  7875. 75: [function(e, t, i) {
  7876. "use strict";
  7877. function n(e, t, i, n) {
  7878. function r(e) {
  7879. return e.classList.contains(a)
  7880. }
  7881. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7882. //for (var a in o) {
  7883. //var s = e.find(r);
  7884. //for (var l in o[a]) {
  7885. //var c = o[a][l];
  7886. //if ("top-info" === l || "bottom-info" === l) {
  7887. //var h = n ? c : "";
  7888. //czj 注释掉第一次打开的用户引导
  7889. //s.querySelector("." + l).textContent = h
  7890. //} else {
  7891. //var u = n ? c : "";
  7892. //, d = s.querySelector("." + l);
  7893. //d.src = u,
  7894. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7895. //}
  7896. //}
  7897. //}
  7898. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7899. // p.forEach(function(e) {
  7900. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7901. // })
  7902. }
  7903. var r = e("../util/browser")
  7904. , o = e("../localization/localize")
  7905. , a = e("../enum/HelpModalType")
  7906. , s = (e("../enum/HelpModalSize"),
  7907. e("../enum/Viewmode"));
  7908. t.exports = {
  7909. init: function() {
  7910. if (!this.hasInitialized) {
  7911. this.hasInitialized = !0,
  7912. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7913. this.assets = {},
  7914. this.assets[a.LANDING[s.PANORAMA]] = {
  7915. desktop: {
  7916. left: {
  7917. "top-info": o.ROTATE,
  7918. "big-image": "images/nav_help_mouse_drag_left.png",
  7919. keyboard: "images/nav_help_keyboard_left_right.png"
  7920. },
  7921. middle: {
  7922. "top-info": o.MOVE,
  7923. "big-image": "images/nav_help_mouse_click.png",
  7924. keyboard: "images/nav_help_keyboard_up_down.png"
  7925. },
  7926. right: {
  7927. "top-info": o.ZOOM,
  7928. "big-image": "images/nav_help_mouse_zoom.png",
  7929. keyboard: "images/nav_help_zoom_keys.png"
  7930. }
  7931. },
  7932. mobile: {
  7933. left: {
  7934. "top-info": o.ROTATE,
  7935. "big-image": "images/nav_help_gesture_drag.png"
  7936. },
  7937. middle: {
  7938. "top-info": o.MOVE,
  7939. "big-image": "images/nav_help_gesture_tap.png"
  7940. },
  7941. right: {
  7942. "top-info": o.ZOOM,
  7943. "big-image": "images/nav_help_gesture_pinch.png"
  7944. }
  7945. }
  7946. },
  7947. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7948. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7949. desktop: {
  7950. left: {
  7951. "top-info": o.ROTATE,
  7952. "big-image": "images/nav_help_mouse_drag_left.png",
  7953. keyboard: "images/nav_help_keyboard_left_right.png"
  7954. },
  7955. middle: {
  7956. "top-info": o.MOVE,
  7957. "big-image": "images/nav_help_mouse_position_right.png"
  7958. }
  7959. },
  7960. mobile: {
  7961. left: {
  7962. "top-info": o.ROTATE,
  7963. "big-image": "images/nav_help_gesture_drag.png"
  7964. },
  7965. middle: {
  7966. "top-info": o.MOVE,
  7967. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7968. }
  7969. }
  7970. },
  7971. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7972. desktop: {
  7973. left: {
  7974. "top-info": o.MOVE,
  7975. "big-image": "images/nav_help_mouse_position_left.png"
  7976. },
  7977. middle: {
  7978. "top-info": o.ROTATE,
  7979. "big-image": "images/nav_help_mouse_drag_right.png",
  7980. keyboard: "images/nav_help_keyboard_left_right.png"
  7981. }
  7982. },
  7983. mobile: {
  7984. left: {
  7985. "top-info": o.MOVE,
  7986. "big-image": "images/nav_help_gesture_position.png"
  7987. },
  7988. middle: {
  7989. "top-info": o.ROTATE,
  7990. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7991. }
  7992. }
  7993. };
  7994. var e = {
  7995. "top-info": o.INSIDE,
  7996. "big-image": "images/nav_help_click_inside.png",
  7997. keyboard: "images/nav_help_inside_key.png"
  7998. };
  7999. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8000. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8001. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8002. var t = {
  8003. "top-info": o.INSIDE,
  8004. "big-image": "images/nav_help_tap_inside.png"
  8005. };
  8006. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8007. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8008. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8009. this.assets[a.NAVIGATION] = {},
  8010. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8011. desktop: {
  8012. left: {
  8013. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8014. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8015. "big-image": "images/nav_help_mouse_drag_left.png",
  8016. keyboard: "images/nav_help_keyboard_left_right.png"
  8017. },
  8018. middle: {
  8019. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8020. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8021. "big-image": "images/nav_help_mouse_click.png",
  8022. keyboard: "images/nav_help_keyboard_up_down.png"
  8023. },
  8024. right: {
  8025. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8026. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8027. "big-image": "images/nav_help_mouse_zoom.png",
  8028. keyboard: "images/nav_help_zoom_keys.png"
  8029. }
  8030. },
  8031. mobile: {
  8032. left: {
  8033. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8034. "big-image": "images/nav_help_gesture_drag.png"
  8035. },
  8036. middle: {
  8037. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8038. "big-image": "images/nav_help_gesture_tap.png"
  8039. },
  8040. right: {
  8041. "top-info": o.HELP_MOBILE_3,
  8042. "big-image": "images/nav_help_gesture_pinch.png"
  8043. }
  8044. }
  8045. },
  8046. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8047. desktop: {
  8048. left: {
  8049. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8050. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8051. "big-image": "images/nav_help_mouse_drag_left.png",
  8052. keyboard: "images/nav_help_keyboard_all.png"
  8053. },
  8054. middle: {
  8055. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8056. "big-image": "images/nav_help_mouse_position_right.png"
  8057. },
  8058. right: {
  8059. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8060. "big-image": "images/nav_help_mouse_zoom.png"
  8061. }
  8062. },
  8063. mobile: {
  8064. left: {
  8065. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8066. "big-image": "images/nav_help_gesture_drag.png"
  8067. },
  8068. middle: {
  8069. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8070. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8071. },
  8072. right: {
  8073. "top-info": o.HELP_MOBILE_3,
  8074. "big-image": "images/nav_help_gesture_pinch.png"
  8075. }
  8076. }
  8077. },
  8078. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8079. desktop: {
  8080. left: {
  8081. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8082. "big-image": "images/nav_help_mouse_position_left.png"
  8083. },
  8084. middle: {
  8085. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8086. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8087. "big-image": "images/nav_help_mouse_drag_right.png",
  8088. keyboard: "images/nav_help_keyboard_left_right.png"
  8089. },
  8090. right: {
  8091. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8092. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8093. "big-image": "images/nav_help_mouse_zoom.png",
  8094. keyboard: "images/nav_help_keyboard_up_down.png"
  8095. }
  8096. },
  8097. mobile: {
  8098. left: {
  8099. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8100. "big-image": "images/nav_help_gesture_position.png"
  8101. },
  8102. middle: {
  8103. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8104. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8105. },
  8106. right: {
  8107. "top-info": o.HELP_MOBILE_3,
  8108. "big-image": "images/nav_help_gesture_pinch.png"
  8109. }
  8110. }
  8111. },
  8112. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8113. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8114. "top-info": o.HELP_DESKTOP_360_2A,
  8115. "bottom-info": o.HELP_DESKTOP_360_2B,
  8116. "big-image": "images/nav_help_click_inside.png",
  8117. keyboard: "images/nav_help_inside_key.png"
  8118. },
  8119. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8120. "top-info": o.HELP_MOBILE_360_2,
  8121. "big-image": "images/nav_help_tap_inside.png"
  8122. },
  8123. this.assets[a.MORE_HELP] = {
  8124. desktop: {
  8125. "more-help-hlr": {
  8126. "top-info": o.HELP_MORE_HLR_A,
  8127. "big-image": "images/nav_help_expand.svg",
  8128. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8129. },
  8130. "more-help-dollhouse": {
  8131. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8132. "big-image": "images/nav_help_dollhouse.svg",
  8133. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8134. },
  8135. "more-help-floors": {
  8136. "top-info": o.HELP_MORE_FLOORS_A,
  8137. "big-image": "images/nav_help_floor picker.svg",
  8138. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8139. },
  8140. "more-help-tag": {
  8141. "top-info": o.HELP_MORE_TAG_A,
  8142. "big-image": "images/nav_help_tag.svg",
  8143. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8144. },
  8145. "more-help-zoom": {
  8146. "top-info": o.HELP_MORE_ZOOM_A,
  8147. "big-image": "images/nav_help_zoom.svg",
  8148. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8149. },
  8150. "more-help-tour": {
  8151. "top-info": o.HELP_MORE_TOUR_A,
  8152. "big-image": "images/nav_help_play.png",
  8153. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8154. },
  8155. "more-help-inside": {
  8156. "top-info": o.HELP_MORE_INSIDE_A,
  8157. "big-image": "images/nav_help_inside.svg",
  8158. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8159. },
  8160. "more-help-vr": {
  8161. "top-info": o.HELP_MORE_VR_A,
  8162. "big-image": "images/nav_help_vr.svg",
  8163. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8164. },
  8165. "more-help-360": {
  8166. "top-info": o.HELP_MORE_360_A,
  8167. "big-image": "images/nav_help_360.svg",
  8168. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8169. },
  8170. "more-help-fullscreen": {
  8171. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8172. "big-image": "images/nav_help_fullscreen.svg",
  8173. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8174. }
  8175. },
  8176. mobile: {
  8177. "more-help-hlr": {
  8178. "top-info": o.HELP_MORE_HLR_A,
  8179. "big-image": "images/nav_help_expand.svg",
  8180. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8181. },
  8182. "more-help-dollhouse": {
  8183. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8184. "big-image": "images/nav_help_dollhouse.svg",
  8185. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8186. },
  8187. "more-help-floors": {
  8188. "top-info": o.HELP_MORE_FLOORS_A,
  8189. "big-image": "images/nav_help_floor picker.svg",
  8190. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8191. },
  8192. "more-help-tag": {
  8193. "top-info": o.HELP_MORE_TAG_A,
  8194. "big-image": "images/nav_help_tag.svg",
  8195. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8196. },
  8197. "more-help-tour": {
  8198. "top-info": o.HELP_MORE_TOUR_A,
  8199. "big-image": "images/nav_help_play.png",
  8200. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8201. },
  8202. "more-help-inside": {
  8203. "top-info": o.HELP_MORE_INSIDE_A,
  8204. "big-image": "images/nav_help_inside.svg",
  8205. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8206. },
  8207. "more-help-vr": {
  8208. "top-info": o.HELP_MORE_VR_A,
  8209. "big-image": "images/webvr.svg",
  8210. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8211. },
  8212. "more-help-360": {
  8213. "top-info": o.HELP_MORE_360_A,
  8214. "big-image": "images/nav_help_360.svg",
  8215. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8216. }
  8217. }
  8218. },
  8219. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8220. desktop: {
  8221. left: {
  8222. "top-info": o.ROTATE,
  8223. "big-image": "images/nav_help_mouse_drag_left.png",
  8224. keyboard: "images/nav_help_keyboard_left_right.png"
  8225. },
  8226. middle: {
  8227. "top-info": o.MOVE,
  8228. "big-image": "images/nav_help_mouse_click.png",
  8229. keyboard: "images/nav_help_keyboard_up_down.png"
  8230. },
  8231. right: {
  8232. "top-info": o.PLAY,
  8233. "big-image": "images/Desktop-help-play-button.svg",
  8234. keyboard: "images/Desktop-help-spacebar-2.svg"
  8235. }
  8236. },
  8237. mobile: {
  8238. left: {
  8239. "top-info": o.ROTATE,
  8240. "big-image": "images/nav_help_gesture_drag.png"
  8241. },
  8242. middle: {
  8243. "top-info": o.MOVE,
  8244. "big-image": "images/nav_help_gesture_tap.png"
  8245. },
  8246. right: {
  8247. "top-info": o.PLAY,
  8248. "big-image": "images/mobile-help-play-button.svg"
  8249. }
  8250. }
  8251. },
  8252. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8253. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8254. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8255. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8256. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8257. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8258. }
  8259. },
  8260. fill: function(e, t, i) {
  8261. n.call(this, e, t, i, !0)
  8262. },
  8263. clear: function(e, t, i) {
  8264. n.call(this, e, t, i, !1)
  8265. }
  8266. }
  8267. }
  8268. , {
  8269. "../enum/HelpModalSize": 27,
  8270. "../enum/HelpModalType": 28,
  8271. "../enum/Viewmode": 51,
  8272. "../localization/localize": 108,
  8273. "../util/browser": 182
  8274. }],
  8275. 76: [function(e, t, i) {
  8276. "use strict";
  8277. t.exports = Object.freeze({
  8278. OPENED: "share.open",
  8279. CLOSED: "share.closed",
  8280. LINK_CLICKED: "share.linked"
  8281. })
  8282. }
  8283. , {}],
  8284. 77: [function(e, t, i) {
  8285. "use strict";
  8286. function n(e) {
  8287. function t(t, i) {
  8288. var n = window.screenY + ($("#player").height() - i) / 2
  8289. , r = window.screenX + ($("#player").width() - t) / 2
  8290. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8291. I.emit(l.LINK_CLICKED, {
  8292. channel: e
  8293. }),
  8294. window.open(C[e], "shareWindow", o)
  8295. }
  8296. switch (e) {
  8297. case y.FACEBOOK:
  8298. t(580, 420);
  8299. break;
  8300. case y.TWITTER:
  8301. t(550, 440);
  8302. break;
  8303. case y.MAIL:
  8304. I.emit(l.LINK_CLICKED, {
  8305. channel: "email"
  8306. }),
  8307. window.open(C[e], "_blank");
  8308. break;
  8309. case y.LINKEDIN:
  8310. }
  8311. }
  8312. function r(e) {
  8313. I.emit(l.LINK_CLICKED, {
  8314. channel: "copylink"
  8315. });
  8316. var t = document.createRange();
  8317. t.selectNodeContents(v);
  8318. var i = window.getSelection();
  8319. i.removeAllRanges(),
  8320. i.addRange(t),
  8321. document.execCommand("copy"),
  8322. A.classList.remove("hidden"),
  8323. v.classList.add("highlighted")
  8324. }
  8325. function o(e) {
  8326. e && (e.stopPropagation(),
  8327. e.target === v) || (window.getSelection().removeAllRanges(),
  8328. v.classList.remove("highlighted"),
  8329. A.classList.add("hidden"))
  8330. }
  8331. var a = e("../../util/browser")
  8332. , s = e("../../localization/localize")
  8333. , l = e("./ShareEvents")
  8334. , c = e("../../util/common")
  8335. , h = e("events").EventEmitter
  8336. , u = document.getElementById("sharing")
  8337. , d = document.getElementById("share-modal")
  8338. , p = document.getElementById("share-close")
  8339. , f = document.getElementById("facebook-share")
  8340. , g = document.getElementById("twitter-share")
  8341. , m = document.getElementById("mail-share")
  8342. , v = document.getElementById("share-url-text")
  8343. , A = document.getElementById("copy-success")
  8344. , y = Object.freeze({
  8345. FACEBOOK: "facebook",
  8346. TWITTER: "twitter",
  8347. MAIL: "mail",
  8348. LINKEDIN: "linkedin"
  8349. })
  8350. , C = {};
  8351. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8352. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8353. C[y.MAIL] = "mailto:?subject=";
  8354. var I = {
  8355. init: function(e) {
  8356. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8357. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8358. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8359. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8360. u.addEventListener("click", this.toggle.bind(this)),
  8361. p.addEventListener("click", this.hide.bind(this)),
  8362. v.addEventListener("click", r),
  8363. d.addEventListener("click", o),
  8364. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8365. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8366. m.addEventListener("click", n.bind(this, y.MAIL)),
  8367. v.textContent = window.location.href + "&utm_source=4",
  8368. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8369. u.classList.remove("hidden")
  8370. },
  8371. show: function() {
  8372. this.emit(l.OPENED),
  8373. d.classList.add("fadeIn")
  8374. },
  8375. hide: function() {
  8376. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8377. document.selection && document.selection.empty(),
  8378. window.getSelection().removeAllRanges(),
  8379. o(),
  8380. d.classList.remove("fadeIn"))
  8381. },
  8382. toggle: function() {
  8383. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8384. }
  8385. };
  8386. c.extendObject(I, h.prototype),
  8387. t.exports = I
  8388. }
  8389. , {
  8390. "../../localization/localize": 108,
  8391. "../../util/browser": 182,
  8392. "../../util/common": 185,
  8393. "./ShareEvents": 76,
  8394. events: 202
  8395. }],
  8396. 78: [function(e, t, i) {
  8397. "use strict";
  8398. t.exports = Object.freeze({
  8399. OPENED: "terms.opened",
  8400. CLOSED: "terms.closed"
  8401. })
  8402. }
  8403. , {}],
  8404. 79: [function(e, t, i) {
  8405. "use strict";
  8406. var n = e("./TermsEvent")
  8407. , r = e("../../localization/localize")
  8408. , o = e("../../analytics")
  8409. , a = e("../../util/ajax")
  8410. , s = e("../../util/common")
  8411. , l = e("events").EventEmitter
  8412. , c = document.getElementById("terms-modal")
  8413. , h = {
  8414. init: function() {
  8415. $(".footer-terms").on("click", function(e) {
  8416. e.preventDefault(),
  8417. this.show()
  8418. }
  8419. .bind(this)),
  8420. $("#terms-modal .close").on("click", this.hide.bind(this))
  8421. },
  8422. show: function() {
  8423. this.emit(n.OPENED),
  8424. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8425. var t = $("#terms-text").html(e);
  8426. o.track("showcase_gui", {
  8427. gui_action: "click_terms_button",
  8428. interaction_source: "gui"
  8429. }),
  8430. t.find("a").attr("target", "_blank")
  8431. }).fail(function() {
  8432. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8433. }),
  8434. c.classList.add("fadeIn")
  8435. },
  8436. hide: function(e) {
  8437. e && e.preventDefault(),
  8438. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8439. c.classList.remove("fadeIn")
  8440. }
  8441. };
  8442. s.extendObject(h, l.prototype),
  8443. t.exports = h
  8444. }
  8445. , {
  8446. "../../analytics": 4,
  8447. "../../localization/localize": 108,
  8448. "../../util/ajax": 181,
  8449. "../../util/common": 185,
  8450. "./TermsEvent": 78,
  8451. events: 202
  8452. }],
  8453. 80: [function(e, t, i) {
  8454. "use strict";
  8455. t.exports = Object.freeze({
  8456. OPEN_INFO: "title.open.info",
  8457. CLOSE_INFO: "title.close.info",
  8458. SHOW_INFO: "title.show.info",
  8459. HIDE_INFO: "title.hide.info",
  8460. LINK_CLICKED: "title.link.click",
  8461. CONTACT_LINK_CLICKED: "title.contact.click",
  8462. ORIGIN_LINK_CLICKED: "title.origin.click"
  8463. })
  8464. }
  8465. , {}],
  8466. 81: [function(e, t, i) {
  8467. "use strict";
  8468. function n(e, t) {
  8469. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8470. }
  8471. function r(e, t) {
  8472. function i(i) {
  8473. e.shouldShowtags = "show" === this.value,
  8474. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8475. }
  8476. document.getElementById("tag-toggles").classList.remove("hidden"),
  8477. document.getElementById("radio-tag-show").checked = !0;
  8478. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8479. n[r].addEventListener("change", i)
  8480. }
  8481. var o = e("../../settings");
  8482. t.exports.init = n
  8483. }
  8484. , {
  8485. "../../settings": 166
  8486. }],
  8487. 82: [function(e, t, i) {
  8488. (function(i) {
  8489. "use strict";
  8490. function n(e, t) {
  8491. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8492. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8493. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8494. document.getElementById("gui-name").classList.add("noCoBrand"),
  8495. document.getElementById("cobrandTitle").classList.add("hidden")),
  8496. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8497. !1)
  8498. }
  8499. function r(e) {
  8500. return e ? (L = !0,
  8501. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8502. }
  8503. function o(e, t, i, n) {
  8504. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8505. return void T.classList.add("hidden");
  8506. L = !0;
  8507. var r = []
  8508. , o = c(r, "<br>");
  8509. if (e && o('<span id="contactName">' + e + "</span>"),
  8510. t) {
  8511. var a = n || t
  8512. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8513. o(s)
  8514. }
  8515. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8516. r[0] = "",
  8517. x.innerHTML = r.join("")
  8518. }
  8519. function a(e) {
  8520. if ("string" == typeof e)
  8521. try {
  8522. e = JSON.parse(e)
  8523. } catch (e) {
  8524. return y.warn("Unable to parse address data"),
  8525. void S.parentElement.classList.add("hidden")
  8526. }
  8527. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8528. return void S.parentElement.classList.add("hidden");
  8529. L = !0;
  8530. var t = []
  8531. , i = c(t, " ");
  8532. e.address_1 && i(e.address_1),
  8533. e.address_2 && i(e.address_2),
  8534. e.city && i(e.city, ", "),
  8535. e.state && i(e.state, ", "),
  8536. e.zip && i(e.zip, e.state ? " " : ", "),
  8537. t[0] = "",
  8538. S.innerText = t.join("")
  8539. }
  8540. function s(e) {
  8541. var t = document.createElement("a");
  8542. return t.id = "url",
  8543. t.target = "_blank",
  8544. t.href = e,
  8545. t.innerText = e,
  8546. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8547. t
  8548. }
  8549. function l(e) {
  8550. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8551. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8552. P.appendChild(s(e)),
  8553. O.forEach(function(e) {
  8554. e.classList.add("share-link")
  8555. }),
  8556. !0)
  8557. }
  8558. function c(e, t) {
  8559. var i = e
  8560. , n = t;
  8561. return function(e, t) {
  8562. i.push(t || n, e)
  8563. }
  8564. }
  8565. function h() {
  8566. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8567. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8568. var e = [].slice.call(_.querySelectorAll("a"));
  8569. e.forEach(function(e) {
  8570. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8571. });
  8572. var t = [].slice.call(T.querySelectorAll("a"));
  8573. t.forEach(function(e) {
  8574. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8575. contact_type: e.getAttribute("id")
  8576. }))
  8577. })
  8578. }
  8579. var u = e("../../util/browser")
  8580. , d = e("../../util/common")
  8581. , p = e("../../util/logger")
  8582. , f = e("../../localization/localize")
  8583. , g = e("./titleBarSettings")
  8584. , m = e("../../settings")
  8585. , v = e("./TitleEvents")
  8586. , A = e("events").EventEmitter
  8587. , y = new p(i)
  8588. , C = document.querySelector(".pinTop.left")
  8589. , I = document.getElementsByClassName("title-container")[0]
  8590. , E = document.getElementById("title-toggle").querySelector("i")
  8591. , b = document.getElementById("meta-info-wrapper")
  8592. , w = document.getElementById("meta-info")
  8593. , _ = document.getElementById("meta-description")
  8594. , T = document.getElementsByClassName("contact-info")[0]
  8595. , x = document.getElementById("contact-data")
  8596. , S = document.getElementById("addressTxt")
  8597. , M = document.getElementById("tag-toggles")
  8598. , R = document.getElementById("share-origin")
  8599. , P = document.getElementById("share-link-wrapper")
  8600. , O = [w, b, I]
  8601. , L = !1
  8602. , D = !1
  8603. , N = {
  8604. populate: function(e) {
  8605. if (n(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8606. if (r(e.description),
  8607. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8608. a(e.address),
  8609. L) {
  8610. var t = document.createElement("br");
  8611. M.insertBefore(t, M.firstElementChild)
  8612. }
  8613. e.socialSharing && m.share.enabled && (D = l(e.url))
  8614. }
  8615. },
  8616. finishSetup: function(e) {
  8617. L = L || !!e,
  8618. h(),
  8619. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8620. },
  8621. toggleMeta: function(e, t) {
  8622. var title = document.getElementById("model-title");
  8623. t && t.preventDefault();
  8624. var i = w.classList.contains("expand");
  8625. e && !i || (i ? (O.forEach(function(e) {
  8626. e.classList.remove("expand")
  8627. }),
  8628. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8629. e.classList.add("expand");
  8630. }),
  8631. title.classList.add("expand"),
  8632. this.emit(v.OPEN_INFO)))
  8633. },
  8634. setupToggling: function() {
  8635. b.style.height = w.offsetHeight + "px",
  8636. w.addEventListener("transitionend", function() {
  8637. b.style.height = w.offsetHeight + "px"
  8638. })
  8639. },
  8640. toggleTitle: function(e) {
  8641. e && e.preventDefault(),
  8642. C.classList.contains("closed") ? (C.classList.add("open"),
  8643. E.classList.remove("icon-dpad-right"),
  8644. E.classList.add("icon-dpad-left"),
  8645. this.emit(v.SHOW_INFO),
  8646. setTimeout(function() {
  8647. C.classList.remove("closed"),
  8648. C.classList.remove("open")
  8649. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8650. E.classList.remove("icon-dpad-left"),
  8651. E.classList.add("icon-dpad-right"),
  8652. this.emit(v.HIDE_INFO))
  8653. }
  8654. };
  8655. d.extendObject(N, A.prototype),
  8656. t.exports = N
  8657. }
  8658. ).call(this, "/js/gui/title/titleBar.js")
  8659. }
  8660. , {
  8661. "../../localization/localize": 108,
  8662. "../../settings": 166,
  8663. "../../util/browser": 182,
  8664. "../../util/common": 185,
  8665. "../../util/logger": 189,
  8666. "./TitleEvents": 80,
  8667. "./titleBarSettings": 83,
  8668. events: 202
  8669. }],
  8670. 83: [function(e, t, i) {
  8671. "use strict";
  8672. t.exports = Object.freeze({
  8673. minTooltipCharacters: 19,
  8674. removeAnimationClasses: 500
  8675. })
  8676. }
  8677. , {}],
  8678. 84: [function(e, t, i) {
  8679. "use strict";
  8680. function n(e) {
  8681. C = e,
  8682. P.forEach(function(e) {
  8683. b.addEventListener(e, u.bind(this, !1), !0),
  8684. w.addEventListener(e, u.bind(this, !0), !0),
  8685. E.addEventListener(e, o, !0),
  8686. S.forEach(function(t) {
  8687. t.addEventListener(e, a, !0)
  8688. }),
  8689. $("#drawer img").on(e, a)
  8690. }),
  8691. document.addEventListener("keydown", u.bind(this, !1), !0),
  8692. C.on(v.TourStart, function() {
  8693. E.classList.add("playing")
  8694. })
  8695. }
  8696. function r() {
  8697. C.playTour(),
  8698. I && clearTimeout(I),
  8699. d(),
  8700. _.removeClass("fadeIn")
  8701. }
  8702. function o() {
  8703. E.classList.contains("playing") && (C.stopTour(),
  8704. _.addClass("fadeIn"),
  8705. setTimeout(function() {
  8706. _.removeClass("fadeIn")
  8707. }, p.tourInteraction.showPauseButton),
  8708. O || (clearTimeout(I),
  8709. I = setTimeout(h, p.tourInteraction.showModal)),
  8710. setTimeout(function() {
  8711. E.classList.remove("playing")
  8712. }, p.tourInteraction.allowNextClick))
  8713. }
  8714. function a() {
  8715. C.tourInProgress && (C.stopTour(),
  8716. C.endTourProgress(),
  8717. E.classList.remove("playing"))
  8718. }
  8719. function s() {
  8720. T.is(":visible") ? r() : o()
  8721. }
  8722. function l() {
  8723. x.hasClass("playing") && (clearTimeout(I),
  8724. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8725. }
  8726. function c() {
  8727. E.classList.remove("playing"),
  8728. h()
  8729. }
  8730. function h() {//去掉导览结束时的提示
  8731. /* if (!p.tourInteraction.disabled) {
  8732. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8733. M.addClass("fadeIn tour " + m.deviceType);
  8734. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8735. if (!p.tourInteraction.smallModal) {
  8736. var t;
  8737. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  8738. m.fill(R, A.TOUR_INTERACTION[t]),
  8739. M.addClass(t)
  8740. }
  8741. M.addClass(e)
  8742. } */
  8743. }
  8744. function u(e, t) {
  8745. if (t) {
  8746. var i = "keydown" === t.type
  8747. , n = t.which === f.SPACE || C.tourIsPlaying;
  8748. i && n || e || (O = !0),
  8749. C.atEndOfTour() && d(),
  8750. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8751. d(),
  8752. t.which !== f.SPACE && a()),
  8753. i && n && s()
  8754. }
  8755. }
  8756. function d() {
  8757. M.removeClass("fadeIn")
  8758. }
  8759. var p = (e("../util/browser"),
  8760. e("../settings"))
  8761. , f = e("../enum/Keys")
  8762. , g = e("../enum/Viewmode")
  8763. , m = (e("./helpManager"),
  8764. e("./populateModal"))
  8765. , v = e("../enum/DirectorEvents")
  8766. , A = e("../enum/HelpModalType")
  8767. , y = e("../enum/HelpModalSize")
  8768. , C = null
  8769. , I = null
  8770. , E = document.getElementById("pause-overlay")
  8771. , b = document.getElementById("player")
  8772. , w = document.getElementById("gui")
  8773. , _ = $("#pause-icon").eq(0)
  8774. , T = $("#play").eq(0)
  8775. , x = $("#playHead").eq(0)
  8776. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8777. , M = $("#interaction-modal").eq(0)
  8778. , R = $("#interaction-modal .interaction").toArray()
  8779. , P = ["touchstart", "mousedown", "pointerdown"]
  8780. , O = !1;
  8781. t.exports.init = n,
  8782. t.exports.play = r,
  8783. t.exports.pause = o,
  8784. t.exports.pauseWithoutCTA = a,
  8785. t.exports.togglePlay = s,
  8786. t.exports.stopTour = l,
  8787. t.exports.dismissModal = d
  8788. }
  8789. , {
  8790. "../enum/DirectorEvents": 23,
  8791. "../enum/HelpModalSize": 27,
  8792. "../enum/HelpModalType": 28,
  8793. "../enum/Keys": 30,
  8794. "../enum/Viewmode": 51,
  8795. "../settings": 166,
  8796. "../util/browser": 182,
  8797. "./helpManager": 68,
  8798. "./populateModal": 75
  8799. }],
  8800. 85: [function(e, t, i) {
  8801. "use strict";
  8802. t.exports = Object.freeze({
  8803. OPENED: "vr.modal.opened",
  8804. LAUNCH: "vr.modal.launch",
  8805. CLOSED: "vr.modal.closed",
  8806. NEXT: "vr.modal.next",
  8807. PREV: "vr.modal.prev",
  8808. STORE: "vr.modal.store",
  8809. falseICECHOSEN: "vr.modal.device"
  8810. })
  8811. }
  8812. , {}],
  8813. 86: [function(e, t, i) {
  8814. "use strict";
  8815. function n(e, t, i) {
  8816. function n(e, t, n, r) {
  8817. function o() {
  8818. return p + "&m=" + t + "&display=" + e
  8819. }
  8820. function s() {
  8821. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8822. , t = "&utm_source=" + u
  8823. , n = "&utm_showcase_session_id=" + i;
  8824. return e + t + n
  8825. }
  8826. function l() {
  8827. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8828. }
  8829. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8830. }
  8831. function r(e, t, i, r) {
  8832. var o = "https://api.branch.io/v1/url"
  8833. , a = n(e, t, i, r)
  8834. , s = {
  8835. responseType: "json",
  8836. data: {
  8837. branch_key: h.appConfig.branch_key,
  8838. data: {
  8839. m: t,
  8840. full_url: a,
  8841. $desktop_url: m,
  8842. $og_app_id: "331853976762864119",
  8843. $og_title: i,
  8844. $og_description: r,
  8845. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8846. $canonical_url: window.location.href
  8847. }
  8848. }
  8849. };
  8850. c.post(o, s).done(function(t) {
  8851. f[e] = t.url
  8852. }).fail(function(t) {
  8853. f[e] = t
  8854. }
  8855. .bind(this, a))
  8856. }
  8857. function o(e, t, i) {
  8858. for (var r in s) {
  8859. var o = s[r]
  8860. , a = n(o, e, t, i);
  8861. f[o] = a
  8862. }
  8863. }
  8864. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8865. , d = g + "/vr/dlist/?ret=" + u
  8866. , p = g + "/vr/show/?ret=" + u
  8867. , m = "";
  8868. switch (e) {
  8869. case l.IOS:
  8870. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8871. break;
  8872. default:
  8873. o(t.sid, t.name, t.summary)
  8874. }
  8875. }
  8876. function r(e) {
  8877. var t = f[e];
  8878. window.open(t, "_blank")
  8879. }
  8880. function o(e) {
  8881. var t = u[e];
  8882. window.open(t, "_blank")
  8883. }
  8884. var a = e("../../util/browser")
  8885. , s = e("../../enum/VRApps")
  8886. , l = e("../../enum/VRPlatforms")
  8887. , c = e("../../util/ajax")
  8888. , h = e("../../settings")
  8889. , u = {};
  8890. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8891. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8892. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8893. for (var d in s) {
  8894. var p = s[d];
  8895. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8896. }
  8897. var f = {}
  8898. , g = function() {
  8899. var e = window.location.host;
  8900. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8901. "https://" + e
  8902. }();
  8903. t.exports.init = n,
  8904. t.exports.launch = r,
  8905. t.exports.launchStore = o
  8906. }
  8907. , {
  8908. "../../enum/VRApps": 46,
  8909. "../../enum/VRPlatforms": 49,
  8910. "../../settings": 166,
  8911. "../../util/ajax": 181,
  8912. "../../util/browser": 182
  8913. }],
  8914. 87: [function(e, t, i) {
  8915. "use strict";
  8916. function n(e) {
  8917. var t;
  8918. switch (e) {
  8919. case m.IOS:
  8920. return t = p.iosVersion(),
  8921. t.major > 9 || 9 === t.major && t.minor >= 1;
  8922. case m.Android:
  8923. return t = p.androidVersion(),
  8924. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8925. }
  8926. return !1
  8927. }
  8928. function r(e, t) {
  8929. function i(e) {
  8930. K.emit(A.STORE, {
  8931. type: e
  8932. }),
  8933. f.launchStore(e)
  8934. }
  8935. function r(e) {
  8936. switch (e !== _.pageCount && (a(e),
  8937. N.text(e + 1 + " / " + _.pageCount)),
  8938. e) {
  8939. case _.Title:
  8940. O.css("display", "none"),
  8941. L.text(u[e]),
  8942. o(s);
  8943. break;
  8944. case _.Cardboard:
  8945. O.css("display", "block"),
  8946. L.text(u[e]),
  8947. M.filter(".cardboard").off(),
  8948. M.filter(".gearvr").off(),
  8949. c(e, s),
  8950. h(H, X, Z);
  8951. break;
  8952. case _.Gear:
  8953. L.text(u[e]),
  8954. c(e, s),
  8955. T.addClass("lastPage"),
  8956. h(G, X, Z);
  8957. break;
  8958. case _.pageCount:
  8959. T.removeClass("fadeIn"),
  8960. K.emit(A.CLOSED)
  8961. }
  8962. B.filter("[src='']").hide()
  8963. }
  8964. var s = function() {
  8965. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8966. w = ".show-supported",
  8967. m.Android) : (T.addClass("unsupported"),
  8968. w = ".show-unsupported",
  8969. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8970. w = ".show-ios",
  8971. _ = v.ios,
  8972. m.IOS) : (T.addClass("desktop"),
  8973. w = ".show-desktop",
  8974. m.Desktop)
  8975. }();
  8976. f.init(s, e, t),
  8977. s !== m.Desktop && T.addClass("mobile");
  8978. var l = function(e) {
  8979. K.emit(A.LAUNCH, {
  8980. vr_platform: s,
  8981. vr_app: e
  8982. }),
  8983. f.launch(e)
  8984. };
  8985. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8986. q.gear = l.bind(this, g.GearVR),
  8987. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8988. d(),
  8989. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8990. $(w).show();
  8991. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8992. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8993. s === m.IOS && (u.splice(1, 1),
  8994. y.splice(1, 1)),
  8995. $("#vr").on("click", function(e) {
  8996. e.preventDefault();
  8997. if(!window.vrEnabled) { // 开启VR
  8998. window.vrEnabled = true;
  8999. this.classList.add('active');
  9000. $('#gui div').not('#vrOff').addClass('vrHide');
  9001. $('#vrOffImg').css({'display':'inline-block'});
  9002. }else{
  9003. }
  9004. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  9005. // r(b),
  9006. // T.addClass("fadeIn"),
  9007. // K.emit(A.OPENED))
  9008. });
  9009. $('#vrOff').on('click', function(){
  9010. window.vrEnabled = false;
  9011. $('#gui div').not('#vrOff').removeClass('vrHide');
  9012. $('#vrOffImg').css({'display':'none'});
  9013. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9014. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9015. })
  9016. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9017. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9018. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9019. $("span.modelLink").text(I),
  9020. O.on("click", function(e) {
  9021. K.emit(A.PREV),
  9022. b--,
  9023. r(b)
  9024. }),
  9025. L.on("click", function(e) {
  9026. L.text();
  9027. K.emit(A.NEXT, {
  9028. nextAction: y[b]
  9029. }),
  9030. b++,
  9031. r(b)
  9032. }),
  9033. T.find(".close").on("click", K.dismiss)
  9034. }
  9035. function o(e) {
  9036. switch (e) {
  9037. case m.Android:
  9038. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9039. M.filter(".gearvr").off().on("click", q.gear),
  9040. s(H, G, "logo-button", "same-line");
  9041. break;
  9042. case m.UnsupportedAndroid:
  9043. s("", z, "", "");
  9044. break;
  9045. case m.IOS:
  9046. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9047. s(H, "", "logo-button", "");
  9048. break;
  9049. case m.Desktop:
  9050. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9051. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9052. s(H, G, "logo-button", "same-line"),
  9053. Q.cardboard()
  9054. }
  9055. }
  9056. function a(e) {
  9057. $(".p1, .p2, .p3").hide(),
  9058. x.insertAfter(S),
  9059. T.removeClass("front-page"),
  9060. T.removeClass("details-page"),
  9061. T.removeClass("lastPage"),
  9062. M.removeClass("logo-button"),
  9063. M.removeClass("same-line"),
  9064. S.removeClass("headsetOptions"),
  9065. R.attr("src", ""),
  9066. R.filter(".second").removeClass("gear"),
  9067. R.css("display", "inline-block"),
  9068. R.off(),
  9069. P.filter(".second").css("display", ""),
  9070. D.css("display", "none"),
  9071. $(".p" + (e + 1) + w).show(),
  9072. R.filter(".third").insertBefore(P.filter(".third"))
  9073. }
  9074. function s(e, t, i, n) {
  9075. T.addClass("front-page"),
  9076. R.filter(".first").attr("src", e),
  9077. R.filter(".second").attr("src", t),
  9078. M.filter(".first").addClass(i),
  9079. M.filter(".second").addClass(i),
  9080. M.addClass(n),
  9081. ".show-desktop" === w && S.insertAfter(x)
  9082. }
  9083. function l(e, t, i) {
  9084. S.addClass("headsetOptions"),
  9085. M.off(),
  9086. R.filter(".second").attr("src", t),
  9087. D.css("display", "block"),
  9088. P.filter(".second").css("display", "none"),
  9089. D.on("click", function() {
  9090. a(_.Title),
  9091. o(m.Desktop)
  9092. }),
  9093. e && (K.emit(A.falseICECHOSEN, {
  9094. name: g.GearVR
  9095. }),
  9096. R.filter(".first").attr("src", e),
  9097. R.filter(".second").addClass("gear"),
  9098. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9099. Q.gearvr()),
  9100. i && (K.emit(A.falseICECHOSEN, {
  9101. name: g.Cardboard
  9102. }),
  9103. R.filter(".third").attr("src", i),
  9104. R.filter(".third").show(),
  9105. R.filter(".third").insertAfter(R.filter(".second")),
  9106. R.filter(".third").addClass("link"),
  9107. R.filter(".second").addClass("link"),
  9108. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9109. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9110. Q.cardboard())
  9111. }
  9112. function c(e, t) {
  9113. switch (t) {
  9114. case m.IOS:
  9115. X = Y,
  9116. Z = j;
  9117. break;
  9118. case m.Desktop:
  9119. e === _.Cardboard ? (X = F,
  9120. Z = U,
  9121. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9122. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9123. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9124. Z = "");
  9125. break;
  9126. default:
  9127. e === _.Cardboard ? (X = z,
  9128. Z = j) : (X = k,
  9129. Z = W)
  9130. }
  9131. }
  9132. function h(e, t, i) {
  9133. T.find(".inner").addClass("details-page"),
  9134. T.addClass("details-page"),
  9135. R.filter(".first").attr("src", e),
  9136. R.filter(".second").attr("src", t),
  9137. R.filter(".third").attr("src", i)
  9138. }
  9139. function u() {
  9140. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9141. K.emit(A.CLOSED))
  9142. }
  9143. function d() {
  9144. var e = p.aspectRatio() > 1 && p.isMobile();
  9145. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9146. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9147. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9148. }
  9149. var p = e("../../util/browser")
  9150. , f = e("./vrLink")
  9151. , g = e("../../enum/VRApps")
  9152. , m = e("../../enum/VRPlatforms")
  9153. , v = e("../../enum/VRPages")
  9154. , A = e("./vrEvent")
  9155. , y = (e("../../settings"),
  9156. e("../../constants"))
  9157. , C = e("../../localization/localize")
  9158. , I = e("../../util/common")
  9159. , E = e("events").EventEmitter
  9160. , b = 0
  9161. , w = null
  9162. , _ = v.standard
  9163. , T = $(".vr-popup")
  9164. , x = T.find(".vr-popup-body")
  9165. , S = T.find(".vr-images")
  9166. , M = T.find(".img-container")
  9167. , R = T.find(".vr-sm-image")
  9168. , P = M.find(".vr-img-caption")
  9169. , O = $(".vr-buttons").find(".prev-button")
  9170. , L = $(".vr-buttons").find(".next-button")
  9171. , D = S.find(".front-close")
  9172. , N = $(".vr-page")
  9173. , B = T.find("img")
  9174. , F = "images/apple-store.png"
  9175. , V = "images/badge-oculus.png"
  9176. , U = "images/badge-cardboard.png"
  9177. , k = "images/logo-samsung.png"
  9178. , H = "images/headset-cardboard.png"
  9179. , G = "images/headset-gearvr.png"
  9180. , z = "images/ico-android-robot.png"
  9181. , W = "images/ico-gearvr.png"
  9182. , j = "images/ico-vr.png"
  9183. , Y = "images/apple-logo-white.svg"
  9184. , X = null
  9185. , Z = null
  9186. , q = {}
  9187. , K = {
  9188. init: r,
  9189. dismiss: u,
  9190. isDeviceSupported: n
  9191. };
  9192. I.extendObject(K, E.prototype),
  9193. $(window).resize(d);
  9194. var Q = function() {
  9195. var e = P.filter(".first").find(".cardboard")
  9196. , t = P.filter(".first").find(".gearvr");
  9197. return {
  9198. cardboard: function() {
  9199. t.addClass("hidden"),
  9200. e.removeClass("hidden")
  9201. },
  9202. gearvr: function() {
  9203. e.addClass("hidden"),
  9204. t.removeClass("hidden")
  9205. }
  9206. }
  9207. }();
  9208. t.exports = K
  9209. }
  9210. , {
  9211. "../../constants": 8,
  9212. "../../enum/VRApps": 46,
  9213. "../../enum/VRPages": 48,
  9214. "../../enum/VRPlatforms": 49,
  9215. "../../localization/localize": 108,
  9216. "../../settings": 166,
  9217. "../../util/browser": 182,
  9218. "../../util/common": 185,
  9219. "./vrEvent": 85,
  9220. "./vrLink": 86,
  9221. events: 202
  9222. }],
  9223. 88: [function(e, t, i) {
  9224. "use strict";
  9225. t.exports = Object.freeze({
  9226. OPENED: "webvr.modal.opened",
  9227. SHOW_TERMS: "webvr.footer.show.terms"
  9228. })
  9229. }
  9230. , {}],
  9231. 89: [function(e, t, i) {
  9232. (function(i) {
  9233. "use strict";
  9234. function n(e, t, i, n) {
  9235. function r(e) {
  9236. e.preventDefault(),
  9237. a(e.currentTarget.id)
  9238. }
  9239. function a(e) {
  9240. ne[e](),
  9241. Object.keys(ne).map(function(t, i) {
  9242. $("#" + t).toggleClass("tabs-underlined", t === e)
  9243. })
  9244. }
  9245. y = i,
  9246. v = t,
  9247. w.init(E.Android, e, n),
  9248. m();
  9249. var l = new RegExp("daydream","i")
  9250. , c = l.test(y.displayName);
  9251. c ? (a("tabdaydream"),
  9252. B.filter(".device-headset-side").attr("src", H),
  9253. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9254. B.filter(".device-headset-side").attr("src", Y),
  9255. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9256. $("#vr").on("click", function(e) {
  9257. e.preventDefault(),
  9258. g("click_webvr_button"),
  9259. L.is(":hidden") && (ie.emit(_.OPENED),
  9260. o())
  9261. }),
  9262. $(".webvr-popup .close").on("click", function(e) {
  9263. e.preventDefault(),
  9264. D.hasClass("hidden") ? (g("webvr_help_close"),
  9265. p()) : s()
  9266. }),
  9267. $("#tabcardboard").on("click", r),
  9268. $("#tabdaydream").on("click", r),
  9269. $("#tabnative").on("click", r),
  9270. $(".webvr-popup .open-with-app").on("click", function(e) {
  9271. e.preventDefault(),
  9272. g("webvr_learn_more"),
  9273. a("tabnative"),
  9274. p()
  9275. }),
  9276. $(".webvr-popup .help").on("click", function(e) {
  9277. e.preventDefault(),
  9278. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9279. p()
  9280. }),
  9281. $(".webvr-popup .terms").on("click", function(e) {
  9282. e.preventDefault(),
  9283. g("webvr_click_terms"),
  9284. s(),
  9285. ie.emit(_.SHOW_TERMS)
  9286. }),
  9287. F.on("click", function(e) {
  9288. e.preventDefault(),
  9289. g(ee),
  9290. window.open(J, "_blank")
  9291. }),
  9292. V.on("click", function(e) {
  9293. e.preventDefault(),
  9294. g("webvr_phone_link"),
  9295. window.open(te, "_blank")
  9296. }),
  9297. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9298. e.preventDefault(),
  9299. g("webvr_cardboard_link"),
  9300. w.launch(b.CardboardAndroid)
  9301. }),
  9302. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9303. e.preventDefault(),
  9304. g("webvr_oculus_link"),
  9305. w.launch(b.GearVR)
  9306. })
  9307. }
  9308. function r() {
  9309. function e() {
  9310. y.isPresenting || (f(),
  9311. window.removeEventListener("vrdisplaypresentchange", e))
  9312. }
  9313. R.info("Headset mounted"),
  9314. v.suspend();
  9315. var t = document.createElement("canvas");
  9316. for (t.getContext("webgl"),
  9317. t.className = "webvr-canvas",
  9318. document.bgColor = "#000",
  9319. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9320. document.body.removeChild(document.body.firstChild);
  9321. document.body.appendChild(t),
  9322. g("webvr_enter_app"),
  9323. y.requestPresent([{
  9324. source: t,
  9325. predistorted: !0
  9326. }]).catch(function(t) {
  9327. R.error("Failed to present: " + t),
  9328. g("webvr_exit_calibrate"),
  9329. e()
  9330. }),
  9331. A.then(function() {
  9332. window.dispatchEvent(new Event("vrapp-start"))
  9333. }),
  9334. window.addEventListener("vrdisplaypresentchange", e)
  9335. }
  9336. function o() {
  9337. O.fadeOut(I.guiAnimationSpeed),
  9338. L.fadeIn(I.guiAnimationSpeed),
  9339. a()
  9340. }
  9341. function a() {
  9342. if (!A) {
  9343. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9344. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9345. A = new Promise(function(e, i) {
  9346. var n = document.createElement("script");
  9347. n.type = "text/javascript",
  9348. n.src = t,
  9349. n.onload = e,
  9350. document.head.appendChild(n)
  9351. }
  9352. )
  9353. }
  9354. D.find(".enter-button").on("click", r)
  9355. }
  9356. function s() {
  9357. g("webvr_modal_close"),
  9358. D.find(".enter-button").off("click", r),
  9359. L.fadeOut(I.guiAnimationSpeed, function() {
  9360. D.toggleClass("hidden", !1),
  9361. N.toggleClass("hidden", !0),
  9362. C.exitFullscreen()
  9363. }),
  9364. O.fadeIn(I.guiAnimationSpeed)
  9365. }
  9366. function l() {
  9367. k.toggleClass("hidden", !1),
  9368. U.toggleClass("hidden", !0)
  9369. }
  9370. function c() {
  9371. k.toggleClass("hidden", !0),
  9372. U.toggleClass("hidden", !1)
  9373. }
  9374. function h() {
  9375. B.filter(".device-headset").attr("src", G),
  9376. B.filter(".device-phone").attr("src", z),
  9377. J = Z,
  9378. ee = K,
  9379. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9380. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9381. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9382. c()
  9383. }
  9384. function u() {
  9385. B.filter(".badge-cardboard").attr("src", j),
  9386. B.filter(".badge-oculus").attr("src", X),
  9387. l()
  9388. }
  9389. function d() {
  9390. B.filter(".device-headset").attr("src", Y),
  9391. B.filter(".device-phone").attr("src", W),
  9392. J = q,
  9393. ee = Q,
  9394. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9395. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9396. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9397. c()
  9398. }
  9399. function p() {
  9400. D.toggleClass("hidden"),
  9401. N.toggleClass("hidden")
  9402. }
  9403. function f() {
  9404. R.info("exiting webVR"),
  9405. g("webvr_exit_app"),
  9406. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9407. }
  9408. function g(e) {
  9409. var t = C.isLandscape() ? "landscape" : "portrait";
  9410. T.trackAlways("showcase_gui", {
  9411. gui_action: e,
  9412. orientation: t
  9413. })
  9414. }
  9415. function m() {
  9416. var e = C.isLandscape();
  9417. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9418. }
  9419. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9420. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9421. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9422. init: n
  9423. }, ne = {
  9424. tabcardboard: d,
  9425. tabdaydream: h,
  9426. tabnative: u
  9427. };
  9428. S.extendObject(ie, P.prototype),
  9429. $(window).resize(m),
  9430. t.exports = ie
  9431. }
  9432. ).call(this, "/js/gui/webvr/webVRgui.js")
  9433. }
  9434. , {
  9435. "../../analytics": 4,
  9436. "../../constants": 8,
  9437. "../../enum/VRApps": 46,
  9438. "../../enum/VRPlatforms": 49,
  9439. "../../localization/localize": 108,
  9440. "../../settings": 166,
  9441. "../../util/browser": 182,
  9442. "../../util/common": 185,
  9443. "../../util/logger": 189,
  9444. "./../gui": 65,
  9445. "./../vr/vrLink": 86,
  9446. "./WebVrEvent": 88,
  9447. events: 202
  9448. }],
  9449. 90: [function(e, t, i) {
  9450. "use strict";
  9451. function n(e, t, i, n, o) {
  9452. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9453. this.roomId = o || "",
  9454. this.labelId = e,
  9455. this.position = (new r.Vector3).copy(t),
  9456. this.text = i
  9457. }
  9458. var r = e("three")
  9459. , o = e("../util/browser");
  9460. n.prototype.build = function() {
  9461. var e = window.document.createElement("div");
  9462. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9463. var t = window.document.createElement("div");
  9464. t.setAttribute("class", "gui-floorplan-label-text");
  9465. var i = window.document.createTextNode(this.text);
  9466. t.appendChild(i),
  9467. e.appendChild(t),
  9468. window.document.body.appendChild(e),
  9469. this.labelGui = e,
  9470. this.textBlock = t,
  9471. $(this.labelGui).hide();
  9472. var n = window.getComputedStyle(this.labelGui);
  9473. this.initialTransform = n.transform || n.webkitTransform
  9474. }
  9475. ,
  9476. t.exports = n
  9477. }
  9478. , {
  9479. "../util/browser": 182,
  9480. three: 217
  9481. }],
  9482. 91: [function(e, t, i) {
  9483. "use strict";
  9484. function n() {
  9485. this.player = null,
  9486. this.modelManager = null,
  9487. this.container = null
  9488. }
  9489. var r = e("three")
  9490. , o = (e("../util/common"),
  9491. e("../enum/PlayerEvents"))
  9492. , a = (e("../enum/DirectorEvents"),
  9493. e("../enum/ModelManagerEvents"))
  9494. , s = e("../settings")
  9495. , l = e("../enum/Viewmode")
  9496. , c = (e("../enum/WarpStyle"),
  9497. e("../util/transitions"),
  9498. e("../util/lerp"),
  9499. e("../util/browser"));
  9500. //场景初始化
  9501. n.prototype.init = function(e, t, i) {
  9502. this.player = e,
  9503. this.modelManager = t,
  9504. this.container = i,
  9505. this.updateModel(),
  9506. this.bindEvents()
  9507. }
  9508. ,
  9509. n.prototype.bindEvents = function() {
  9510. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9511. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9512. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9513. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9514. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9515. }
  9516. ,
  9517. n.prototype.updateModel = function() {
  9518. this.model = this.modelManager.getActiveModel()
  9519. }
  9520. ,
  9521. n.prototype.handlePlayerViewChanged = function() {
  9522. this.updateLabelVisibility(),
  9523. this.updateLabelDisplay()
  9524. }
  9525. ,
  9526. n.prototype.getLabelsForFloor = function(e, t) {
  9527. return t = t || [],
  9528. t.length = 0,
  9529. this.model.labels.forEach(function(i) {
  9530. this.labelVisibleForFloor(i, e) && t.push(i)
  9531. }
  9532. .bind(this)),
  9533. t
  9534. }
  9535. ,
  9536. n.prototype.getLabelsForCurrentFloor = function(e) {
  9537. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9538. }
  9539. ,
  9540. n.prototype.labelVisibleForFloor = function(e, t) {
  9541. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9542. if (!this.model.showingLabels || !e.labelGui || !i)
  9543. return !1;
  9544. var n = e.floorId === this.model.floors.size() - 1;
  9545. return this.model.allFloorsVisible ? n : e.floorId === t
  9546. }
  9547. ,
  9548. n.prototype.updateLabelVisibility = function(e) {
  9549. this.model.labels.forEach(function(e) {
  9550. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9551. }
  9552. .bind(this))
  9553. }
  9554. ,
  9555. n.prototype.showAllLabels = function(e, t) {
  9556. this.model.labels.forEach(function(i) {
  9557. this.showLabel(i, e, t)
  9558. }
  9559. .bind(this))
  9560. }
  9561. ,
  9562. n.prototype.hideAllLabels = function(e, t) {
  9563. this.model.labels.forEach(function(i) {
  9564. this.hideLabel(i, e, t)
  9565. }
  9566. .bind(this))
  9567. }
  9568. ,
  9569. n.prototype.showLabel = function(e, t, i) {
  9570. this.model.showingLabels && (e.visible || (e.visible = !0,
  9571. e.labelGui.style.display = "block",
  9572. e.labelGui.style.opacity = 0,
  9573. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9574. }
  9575. ,
  9576. n.prototype.hideLabel = function(e, t, i) {
  9577. e.visible && (e.visible = !1,
  9578. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9579. }
  9580. ,
  9581. n.prototype.supportedMode = function() {
  9582. return this.player.mode === l.FLOORPLAN
  9583. }
  9584. ,
  9585. n.prototype.updateLabelDisplay = function() {
  9586. var e = (new r.Vector3,
  9587. new r.Vector3,
  9588. []);
  9589. return function() {
  9590. var t = this.player.getLabelScaleFactor()
  9591. , i = .6
  9592. , n = 1.2
  9593. , r = (1 - t) * n + i
  9594. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9595. this.getLabelsForCurrentFloor(e);
  9596. for (var a = 0; a < e.length; a++) {
  9597. var l = e[a];
  9598. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9599. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9600. }
  9601. }
  9602. }(),
  9603. n.prototype.updateProjectedGuiElement = function() {
  9604. var e = new r.Vector3;
  9605. new r.Vector3;
  9606. return function(t, i, n, r, o) {
  9607. i.style.fontSize = 100 * o + "%";
  9608. var a = $("#player").width()
  9609. , s = $("#player").height()
  9610. , l = .5 * a
  9611. , c = .5 * s;
  9612. e.copy(n),
  9613. e.project(this.player.camera);
  9614. var h = e.x * l + l
  9615. , u = -(e.y * c) + c;
  9616. h -= t.offsetWidth / 2,
  9617. u -= t.offsetHeight / 2,
  9618. t.style.left = h + "px",
  9619. t.style.top = u + "px"
  9620. }
  9621. }(),
  9622. n.prototype.handleStartInside = function(e) {
  9623. this.updateLabelVisibility()
  9624. }
  9625. ,
  9626. n.prototype.handleStartOutside = function() {
  9627. this.updateLabelVisibility()
  9628. }
  9629. ,
  9630. t.exports = n
  9631. }
  9632. , {
  9633. "../enum/DirectorEvents": 23,
  9634. "../enum/ModelManagerEvents": 33,
  9635. "../enum/PlayerEvents": 40,
  9636. "../enum/Viewmode": 51,
  9637. "../enum/WarpStyle": 52,
  9638. "../settings": 166,
  9639. "../util/browser": 182,
  9640. "../util/common": 185,
  9641. "../util/lerp": 188,
  9642. "../util/transitions": 195,
  9643. three: 217
  9644. }],
  9645. 92: [function(e, t, i) {
  9646. "use strict";
  9647. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9648. if (null == this)
  9649. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9650. if ("function" != typeof e)
  9651. throw new TypeError("predicate must be a function");
  9652. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9653. if (t = i[o],
  9654. e.call(r, t, o, i))
  9655. return o;
  9656. return -1
  9657. }
  9658. ),
  9659. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9660. value: function(e) {
  9661. if (null == this)
  9662. throw new TypeError('"this" is null or not defined');
  9663. var t = Object(this)
  9664. , i = t.length >>> 0;
  9665. if ("function" != typeof e)
  9666. throw new TypeError("predicate must be a function");
  9667. for (var n = arguments[1], r = 0; r < i; ) {
  9668. var o = t[r];
  9669. if (e.call(n, o, r, t))
  9670. return o;
  9671. r++
  9672. }
  9673. }
  9674. })
  9675. }
  9676. , {}],
  9677. 93: [function(e, t, i) {
  9678. "use strict";
  9679. var n = n || {};
  9680. t.exports = n,
  9681. n.gui = n.gui || {},
  9682. n.utils = n.utils || {},
  9683. n.controllers = n.controllers || {},
  9684. n.dom = n.dom || {},
  9685. n.color = n.color || {},
  9686. n.utils.css = function() {
  9687. return {
  9688. load: function(e, t) {
  9689. t = t || document;
  9690. var i = t.createElement("link");
  9691. i.type = "text/css",
  9692. i.rel = "stylesheet",
  9693. i.href = e,
  9694. t.getElementsByTagName("head")[0].appendChild(i)
  9695. },
  9696. inject: function(e, t) {
  9697. t = t || document;
  9698. var i = document.createElement("style");
  9699. i.type = "text/css",
  9700. i.innerHTML = e,
  9701. t.getElementsByTagName("head")[0].appendChild(i)
  9702. }
  9703. }
  9704. }(),
  9705. n.utils.common = function() {
  9706. var e = Array.prototype.forEach
  9707. , t = Array.prototype.slice;
  9708. return {
  9709. BREAK: {},
  9710. extend: function(e) {
  9711. return this.each(t.call(arguments, 1), function(t) {
  9712. for (var i in t)
  9713. this.isUndefined(t[i]) || (e[i] = t[i])
  9714. }, this),
  9715. e
  9716. },
  9717. defaults: function(e) {
  9718. return this.each(t.call(arguments, 1), function(t) {
  9719. for (var i in t)
  9720. this.isUndefined(e[i]) && (e[i] = t[i])
  9721. }, this),
  9722. e
  9723. },
  9724. compose: function() {
  9725. var e = t.call(arguments);
  9726. return function() {
  9727. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9728. i = [e[n].apply(this, i)];
  9729. return i[0]
  9730. }
  9731. },
  9732. each: function(t, i, n) {
  9733. if (t)
  9734. if (e && t.forEach && t.forEach === e)
  9735. t.forEach(i, n);
  9736. else if (t.length === t.length + 0) {
  9737. for (var r = 0, o = t.length; r < o; r++)
  9738. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9739. return
  9740. } else
  9741. for (var r in t)
  9742. if (i.call(n, t[r], r) === this.BREAK)
  9743. return
  9744. },
  9745. defer: function(e) {
  9746. setTimeout(e, 0)
  9747. },
  9748. toArray: function(e) {
  9749. return e.toArray ? e.toArray() : t.call(e)
  9750. },
  9751. isUndefined: function(e) {
  9752. return void 0 === e
  9753. },
  9754. isNull: function(e) {
  9755. return null === e
  9756. },
  9757. isNaN: function(e) {
  9758. return e !== e
  9759. },
  9760. isArray: Array.isArray || function(e) {
  9761. return e.constructor === Array
  9762. }
  9763. ,
  9764. isObject: function(e) {
  9765. return e === Object(e)
  9766. },
  9767. isNumber: function(e) {
  9768. return e === e + 0
  9769. },
  9770. isString: function(e) {
  9771. return e === e + ""
  9772. },
  9773. isBoolean: function(e) {
  9774. return e === !1 || e === !0
  9775. },
  9776. isFunction: function(e) {
  9777. return "[object Function]" === Object.prototype.toString.call(e)
  9778. }
  9779. }
  9780. }(),
  9781. n.controllers.Controller = function(e) {
  9782. var t = function(e, t) {
  9783. this.initialValue = e[t],
  9784. this.domElement = document.createElement("div"),
  9785. this.object = e,
  9786. this.property = t,
  9787. this.__onChange = void 0,
  9788. this.__onFinishChange = void 0
  9789. };
  9790. return e.extend(t.prototype, {
  9791. onChange: function(e) {
  9792. return this.__onChange = e,
  9793. this
  9794. },
  9795. onFinishChange: function(e) {
  9796. return this.__onFinishChange = e,
  9797. this
  9798. },
  9799. setValue: function(e) {
  9800. return this.object[this.property] = e,
  9801. this.__onChange && this.__onChange.call(this, e),
  9802. this.updateDisplay(),
  9803. this
  9804. },
  9805. getValue: function() {
  9806. return this.object[this.property]
  9807. },
  9808. updateDisplay: function() {
  9809. return this
  9810. },
  9811. isModified: function() {
  9812. return this.initialValue !== this.getValue()
  9813. }
  9814. }),
  9815. t
  9816. }(n.utils.common),
  9817. n.dom.dom = function(e) {
  9818. function t(t) {
  9819. if ("0" === t || e.isUndefined(t))
  9820. return 0;
  9821. var i = t.match(r);
  9822. return e.isNull(i) ? 0 : parseFloat(i[1])
  9823. }
  9824. var i = {
  9825. HTMLEvents: ["change"],
  9826. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9827. KeyboardEvents: ["keydown"]
  9828. }
  9829. , n = {};
  9830. e.each(i, function(t, i) {
  9831. e.each(t, function(e) {
  9832. n[e] = i
  9833. })
  9834. });
  9835. var r = /(\d+(\.\d+)?)px/
  9836. , o = {
  9837. makeSelectable: function(e, t) {
  9838. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9839. return !1
  9840. }
  9841. : function() {}
  9842. ,
  9843. e.style.MozUserSelect = t ? "auto" : "none",
  9844. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9845. e.unselectable = t ? "on" : "off")
  9846. },
  9847. makeFullscreen: function(t, i, n) {
  9848. e.isUndefined(i) && (i = !0),
  9849. e.isUndefined(n) && (n = !0),
  9850. t.style.position = "absolute",
  9851. i && (t.style.left = 0,
  9852. t.style.right = 0),
  9853. n && (t.style.top = 0,
  9854. t.style.bottom = 0)
  9855. },
  9856. fakeEvent: function(t, i, r, o) {
  9857. r = r || {};
  9858. var a = n[i];
  9859. if (!a)
  9860. throw new Error("Event type " + i + " not supported.");
  9861. var s = document.createEvent(a);
  9862. switch (a) {
  9863. case "MouseEvents":
  9864. var l = r.x || r.clientX || 0
  9865. , c = r.y || r.clientY || 0;
  9866. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9867. break;
  9868. case "KeyboardEvents":
  9869. var h = s.initKeyboardEvent || s.initKeyEvent;
  9870. e.defaults(r, {
  9871. cancelable: !0,
  9872. ctrlKey: !1,
  9873. altKey: !1,
  9874. shiftKey: !1,
  9875. metaKey: !1,
  9876. keyCode: void 0,
  9877. charCode: void 0
  9878. }),
  9879. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9880. break;
  9881. default:
  9882. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9883. }
  9884. e.defaults(s, o),
  9885. t.dispatchEvent(s)
  9886. },
  9887. bind: function(e, t, i, n) {
  9888. return n = n || !1,
  9889. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9890. o
  9891. },
  9892. unbind: function(e, t, i, n) {
  9893. return n = n || !1,
  9894. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9895. o
  9896. },
  9897. addClass: function(e, t) {
  9898. if (void 0 === e.className)
  9899. e.className = t;
  9900. else if (e.className !== t) {
  9901. var i = e.className.split(/ +/);
  9902. i.indexOf(t) == -1 && (i.push(t),
  9903. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9904. }
  9905. return o
  9906. },
  9907. removeClass: function(e, t) {
  9908. if (t)
  9909. if (void 0 === e.className)
  9910. ;
  9911. else if (e.className === t)
  9912. e.removeAttribute("class");
  9913. else {
  9914. var i = e.className.split(/ +/)
  9915. , n = i.indexOf(t);
  9916. n != -1 && (i.splice(n, 1),
  9917. e.className = i.join(" "))
  9918. }
  9919. else
  9920. e.className = void 0;
  9921. return o
  9922. },
  9923. hasClass: function(e, t) {
  9924. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9925. },
  9926. getWidth: function(e) {
  9927. var i = getComputedStyle(e);
  9928. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9929. },
  9930. getHeight: function(e) {
  9931. var i = getComputedStyle(e);
  9932. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9933. },
  9934. getOffset: function(e) {
  9935. var t = {
  9936. left: 0,
  9937. top: 0
  9938. };
  9939. if (e.offsetParent)
  9940. do
  9941. t.left += e.offsetLeft,
  9942. t.top += e.offsetTop;
  9943. while (e = e.offsetParent);return t
  9944. },
  9945. isActive: function(e) {
  9946. return e === document.activeElement && (e.type || e.href)
  9947. }
  9948. };
  9949. return o
  9950. }(n.utils.common),
  9951. n.controllers.OptionController = function(e, t, i) {
  9952. var n = function(e, r, o) {
  9953. n.superclass.call(this, e, r);
  9954. var a = this;
  9955. if (this.__select = document.createElement("select"),
  9956. i.isArray(o)) {
  9957. var s = {};
  9958. i.each(o, function(e) {
  9959. s[e] = e
  9960. }),
  9961. o = s
  9962. }
  9963. i.each(o, function(e, t) {
  9964. var i = document.createElement("option");
  9965. i.innerHTML = t,
  9966. i.setAttribute("value", e),
  9967. a.__select.appendChild(i)
  9968. }),
  9969. this.updateDisplay(),
  9970. t.bind(this.__select, "change", function() {
  9971. var e = this.options[this.selectedIndex].value;
  9972. a.setValue(e)
  9973. }),
  9974. this.domElement.appendChild(this.__select)
  9975. };
  9976. return n.superclass = e,
  9977. i.extend(n.prototype, e.prototype, {
  9978. setValue: function(e) {
  9979. var t = n.superclass.prototype.setValue.call(this, e);
  9980. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9981. t
  9982. },
  9983. updateDisplay: function() {
  9984. return this.__select.value = this.getValue(),
  9985. n.superclass.prototype.updateDisplay.call(this)
  9986. }
  9987. }),
  9988. n
  9989. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9990. n.controllers.NumberController = function(e, t) {
  9991. function i(e) {
  9992. return e = e.toString(),
  9993. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9994. }
  9995. var n = function(e, r, o) {
  9996. n.superclass.call(this, e, r),
  9997. o = o || {},
  9998. this.__min = o.min,
  9999. this.__max = o.max,
  10000. this.__step = o.step,
  10001. t.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,
  10002. this.__precision = i(this.__impliedStep)
  10003. };
  10004. return n.superclass = e,
  10005. t.extend(n.prototype, e.prototype, {
  10006. setValue: function(e) {
  10007. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10008. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10009. n.superclass.prototype.setValue.call(this, e)
  10010. },
  10011. min: function(e) {
  10012. return this.__min = e,
  10013. this
  10014. },
  10015. max: function(e) {
  10016. return this.__max = e,
  10017. this
  10018. },
  10019. step: function(e) {
  10020. return this.__step = e,
  10021. this.__impliedStep = e,
  10022. this.__precision = i(e),
  10023. this
  10024. }
  10025. }),
  10026. n
  10027. }(n.controllers.Controller, n.utils.common),
  10028. n.controllers.NumberControllerBox = function(e, t, i) {
  10029. function n(e, t) {
  10030. var i = Math.pow(10, t);
  10031. return Math.round(e * i) / i
  10032. }
  10033. var r = function(e, n, o) {
  10034. function a() {
  10035. var e = parseFloat(d.__input.value);
  10036. i.isNaN(e) || d.setValue(e)
  10037. }
  10038. function s() {
  10039. a(),
  10040. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10041. }
  10042. function l(e) {
  10043. t.bind(window, "mousemove", c),
  10044. t.bind(window, "mouseup", h),
  10045. u = e.clientY
  10046. }
  10047. function c(e) {
  10048. var t = u - e.clientY;
  10049. d.setValue(d.getValue() + t * d.__impliedStep),
  10050. u = e.clientY
  10051. }
  10052. function h() {
  10053. t.unbind(window, "mousemove", c),
  10054. t.unbind(window, "mouseup", h)
  10055. }
  10056. this.__truncationSuspended = !1,
  10057. r.superclass.call(this, e, n, o);
  10058. var u, d = this;
  10059. this.__input = document.createElement("input"),
  10060. this.__input.setAttribute("type", "text"),
  10061. t.bind(this.__input, "change", a),
  10062. t.bind(this.__input, "blur", s),
  10063. t.bind(this.__input, "mousedown", l),
  10064. t.bind(this.__input, "keydown", function(e) {
  10065. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10066. this.blur(),
  10067. d.__truncationSuspended = !1)
  10068. }),
  10069. this.updateDisplay(),
  10070. this.domElement.appendChild(this.__input)
  10071. };
  10072. return r.superclass = e,
  10073. i.extend(r.prototype, e.prototype, {
  10074. updateDisplay: function() {
  10075. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10076. r.superclass.prototype.updateDisplay.call(this)
  10077. }
  10078. }),
  10079. r
  10080. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10081. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10082. function o(e, t, i, n, r) {
  10083. return n + (r - n) * ((e - t) / (i - t))
  10084. }
  10085. var a = function(e, i, n, r, s) {
  10086. function l(e) {
  10087. t.bind(window, "mousemove", c),
  10088. t.bind(window, "mouseup", h),
  10089. c(e)
  10090. }
  10091. function c(e) {
  10092. e.preventDefault();
  10093. var i = t.getOffset(u.__background)
  10094. , n = t.getWidth(u.__background);
  10095. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10096. !1
  10097. }
  10098. function h() {
  10099. t.unbind(window, "mousemove", c),
  10100. t.unbind(window, "mouseup", h),
  10101. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10102. }
  10103. a.superclass.call(this, e, i, {
  10104. min: n,
  10105. max: r,
  10106. step: s
  10107. });
  10108. var u = this;
  10109. this.__background = document.createElement("div"),
  10110. this.__foreground = document.createElement("div"),
  10111. t.bind(this.__background, "mousedown", l),
  10112. t.addClass(this.__background, "slider"),
  10113. t.addClass(this.__foreground, "slider-fg"),
  10114. this.updateDisplay(),
  10115. this.__background.appendChild(this.__foreground),
  10116. this.domElement.appendChild(this.__background)
  10117. };
  10118. return a.superclass = e,
  10119. a.useDefaultStyles = function() {
  10120. i.inject(r)
  10121. }
  10122. ,
  10123. n.extend(a.prototype, e.prototype, {
  10124. updateDisplay: function() {
  10125. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10126. return this.__foreground.style.width = 100 * e + "%",
  10127. a.superclass.prototype.updateDisplay.call(this)
  10128. }
  10129. }),
  10130. a
  10131. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\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}"),
  10132. n.controllers.FunctionController = function(e, t, i) {
  10133. var n = function(e, i, r) {
  10134. n.superclass.call(this, e, i);
  10135. var o = this;
  10136. this.__button = document.createElement("div"),
  10137. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10138. t.bind(this.__button, "click", function(e) {
  10139. return e.preventDefault(),
  10140. o.fire(),
  10141. !1
  10142. }),
  10143. t.addClass(this.__button, "button"),
  10144. this.domElement.appendChild(this.__button)
  10145. };
  10146. return n.superclass = e,
  10147. i.extend(n.prototype, e.prototype, {
  10148. fire: function() {
  10149. this.__onChange && this.__onChange.call(this),
  10150. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10151. this.getValue().call(this.object)
  10152. }
  10153. }),
  10154. n
  10155. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10156. n.controllers.BooleanController = function(e, t, i) {
  10157. var n = function(e, i) {
  10158. function r() {
  10159. o.setValue(!o.__prev)
  10160. }
  10161. n.superclass.call(this, e, i);
  10162. var o = this;
  10163. this.__prev = this.getValue(),
  10164. this.__checkbox = document.createElement("input"),
  10165. this.__checkbox.setAttribute("type", "checkbox"),
  10166. t.bind(this.__checkbox, "change", r, !1),
  10167. this.domElement.appendChild(this.__checkbox),
  10168. this.updateDisplay()
  10169. };
  10170. return n.superclass = e,
  10171. i.extend(n.prototype, e.prototype, {
  10172. setValue: function(e) {
  10173. var t = n.superclass.prototype.setValue.call(this, e);
  10174. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10175. this.__prev = this.getValue(),
  10176. t
  10177. },
  10178. updateDisplay: function() {
  10179. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10180. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10181. n.superclass.prototype.updateDisplay.call(this)
  10182. }
  10183. }),
  10184. n
  10185. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10186. n.color.toString = function(e) {
  10187. return function(t) {
  10188. if (1 == t.a || e.isUndefined(t.a)) {
  10189. for (var i = t.hex.toString(16); i.length < 6; )
  10190. i = "0" + i;
  10191. return "#" + i
  10192. }
  10193. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10194. }
  10195. }(n.utils.common),
  10196. n.color.interpret = function(e, t) {
  10197. var i, n, r = function() {
  10198. n = !1;
  10199. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10200. return t.each(o, function(r) {
  10201. if (r.litmus(e))
  10202. return t.each(r.conversions, function(r, o) {
  10203. if (i = r.read(e),
  10204. n === !1 && i !== !1)
  10205. return n = i,
  10206. i.conversionName = o,
  10207. i.conversion = r,
  10208. t.BREAK
  10209. }),
  10210. t.BREAK
  10211. }),
  10212. n
  10213. }, o = [{
  10214. litmus: t.isString,
  10215. conversions: {
  10216. THREE_CHAR_HEX: {
  10217. read: function(e) {
  10218. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10219. return null !== t && {
  10220. space: "HEX",
  10221. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10222. }
  10223. },
  10224. write: e
  10225. },
  10226. SIX_CHAR_HEX: {
  10227. read: function(e) {
  10228. var t = e.match(/^#([A-F0-9]{6})$/i);
  10229. return null !== t && {
  10230. space: "HEX",
  10231. hex: parseInt("0x" + t[1].toString())
  10232. }
  10233. },
  10234. write: e
  10235. },
  10236. CSS_RGB: {
  10237. read: function(e) {
  10238. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10239. return null !== t && {
  10240. space: "RGB",
  10241. r: parseFloat(t[1]),
  10242. g: parseFloat(t[2]),
  10243. b: parseFloat(t[3])
  10244. }
  10245. },
  10246. write: e
  10247. },
  10248. CSS_RGBA: {
  10249. read: function(e) {
  10250. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10251. return null !== t && {
  10252. space: "RGB",
  10253. r: parseFloat(t[1]),
  10254. g: parseFloat(t[2]),
  10255. b: parseFloat(t[3]),
  10256. a: parseFloat(t[4])
  10257. }
  10258. },
  10259. write: e
  10260. }
  10261. }
  10262. }, {
  10263. litmus: t.isNumber,
  10264. conversions: {
  10265. HEX: {
  10266. read: function(e) {
  10267. return {
  10268. space: "HEX",
  10269. hex: e,
  10270. conversionName: "HEX"
  10271. }
  10272. },
  10273. write: function(e) {
  10274. return e.hex
  10275. }
  10276. }
  10277. }
  10278. }, {
  10279. litmus: t.isArray,
  10280. conversions: {
  10281. RGB_ARRAY: {
  10282. read: function(e) {
  10283. return 3 == e.length && {
  10284. space: "RGB",
  10285. r: e[0],
  10286. g: e[1],
  10287. b: e[2]
  10288. }
  10289. },
  10290. write: function(e) {
  10291. return [e.r, e.g, e.b]
  10292. }
  10293. },
  10294. RGBA_ARRAY: {
  10295. read: function(e) {
  10296. return 4 == e.length && {
  10297. space: "RGB",
  10298. r: e[0],
  10299. g: e[1],
  10300. b: e[2],
  10301. a: e[3]
  10302. }
  10303. },
  10304. write: function(e) {
  10305. return [e.r, e.g, e.b, e.a]
  10306. }
  10307. }
  10308. }
  10309. }, {
  10310. litmus: t.isObject,
  10311. conversions: {
  10312. RGBA_OBJ: {
  10313. read: function(e) {
  10314. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10315. space: "RGB",
  10316. r: e.r,
  10317. g: e.g,
  10318. b: e.b,
  10319. a: e.a
  10320. }
  10321. },
  10322. write: function(e) {
  10323. return {
  10324. r: e.r,
  10325. g: e.g,
  10326. b: e.b,
  10327. a: e.a
  10328. }
  10329. }
  10330. },
  10331. RGB_OBJ: {
  10332. read: function(e) {
  10333. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10334. space: "RGB",
  10335. r: e.r,
  10336. g: e.g,
  10337. b: e.b
  10338. }
  10339. },
  10340. write: function(e) {
  10341. return {
  10342. r: e.r,
  10343. g: e.g,
  10344. b: e.b
  10345. }
  10346. }
  10347. },
  10348. HSVA_OBJ: {
  10349. read: function(e) {
  10350. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10351. space: "HSV",
  10352. h: e.h,
  10353. s: e.s,
  10354. v: e.v,
  10355. a: e.a
  10356. }
  10357. },
  10358. write: function(e) {
  10359. return {
  10360. h: e.h,
  10361. s: e.s,
  10362. v: e.v,
  10363. a: e.a
  10364. }
  10365. }
  10366. },
  10367. HSV_OBJ: {
  10368. read: function(e) {
  10369. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10370. space: "HSV",
  10371. h: e.h,
  10372. s: e.s,
  10373. v: e.v
  10374. }
  10375. },
  10376. write: function(e) {
  10377. return {
  10378. h: e.h,
  10379. s: e.s,
  10380. v: e.v
  10381. }
  10382. }
  10383. }
  10384. }
  10385. }];
  10386. return r
  10387. }(n.color.toString, n.utils.common),
  10388. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10389. function g(e, t, i, o) {
  10390. if (void 0 === t[i])
  10391. throw new Error("Object " + t + ' has no property "' + i + '"');
  10392. var a;
  10393. if (o.color)
  10394. a = new h(t,i);
  10395. else {
  10396. var s = [t, i].concat(o.factoryArgs);
  10397. a = n.apply(e, s)
  10398. }
  10399. o.before instanceof r && (o.before = o.before.__li),
  10400. A(e, a),
  10401. p.addClass(a.domElement, "c");
  10402. var l = document.createElement("span");
  10403. p.addClass(l, "property-name"),
  10404. l.innerHTML = a.property;
  10405. var c = document.createElement("div");
  10406. c.appendChild(l),
  10407. c.appendChild(a.domElement);
  10408. var u = m(e, c, o.before);
  10409. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10410. p.addClass(u, typeof a.getValue()),
  10411. v(e, u, a),
  10412. e.__controllers.push(a),
  10413. a
  10414. }
  10415. function m(e, t, i) {
  10416. var n = document.createElement("li");
  10417. return t && n.appendChild(t),
  10418. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10419. e.onResize(),
  10420. n
  10421. }
  10422. function v(e, t, i) {
  10423. if (i.__li = t,
  10424. i.__gui = e,
  10425. f.extend(i, {
  10426. options: function(t) {
  10427. return arguments.length > 1 ? (i.remove(),
  10428. g(e, i.object, i.property, {
  10429. before: i.__li.nextElementSibling,
  10430. factoryArgs: [f.toArray(arguments)]
  10431. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10432. g(e, i.object, i.property, {
  10433. before: i.__li.nextElementSibling,
  10434. factoryArgs: [t]
  10435. })) : void 0
  10436. },
  10437. name: function(e) {
  10438. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10439. i
  10440. },
  10441. listen: function() {
  10442. return i.__gui.listen(i),
  10443. i
  10444. },
  10445. remove: function() {
  10446. return i.__gui.remove(i),
  10447. i
  10448. }
  10449. }),
  10450. i instanceof l) {
  10451. var n = new s(i.object,i.property,{
  10452. min: i.__min,
  10453. max: i.__max,
  10454. step: i.__step
  10455. });
  10456. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10457. var t = i[e]
  10458. , r = n[e];
  10459. i[e] = n[e] = function() {
  10460. var e = Array.prototype.slice.call(arguments);
  10461. return t.apply(i, e),
  10462. r.apply(n, e)
  10463. }
  10464. }),
  10465. p.addClass(t, "has-slider"),
  10466. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10467. } else if (i instanceof s) {
  10468. var r = function(t) {
  10469. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10470. g(e, i.object, i.property, {
  10471. before: i.__li.nextElementSibling,
  10472. factoryArgs: [i.__min, i.__max, i.__step]
  10473. })) : t
  10474. };
  10475. i.min = f.compose(r, i.min),
  10476. i.max = f.compose(r, i.max)
  10477. } else
  10478. i instanceof o ? (p.bind(t, "click", function() {
  10479. p.fakeEvent(i.__checkbox, "click")
  10480. }),
  10481. p.bind(i.__checkbox, "click", function(e) {
  10482. e.stopPropagation()
  10483. })) : i instanceof a ? (p.bind(t, "click", function() {
  10484. p.fakeEvent(i.__button, "click")
  10485. }),
  10486. p.bind(t, "mouseover", function() {
  10487. p.addClass(i.__button, "hover")
  10488. }),
  10489. p.bind(t, "mouseout", function() {
  10490. p.removeClass(i.__button, "hover")
  10491. })) : i instanceof h && (p.addClass(t, "color"),
  10492. i.updateDisplay = f.compose(function(e) {
  10493. return t.style.borderLeftColor = i.__color.toString(),
  10494. e
  10495. }, i.updateDisplay),
  10496. i.updateDisplay());
  10497. i.setValue = f.compose(function(t) {
  10498. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10499. t
  10500. }, i.setValue)
  10501. }
  10502. function A(e, t) {
  10503. var i = e.getRoot()
  10504. , n = i.__rememberedObjects.indexOf(t.object);
  10505. if (n != -1) {
  10506. var r = i.__rememberedObjectIndecesToControllers[n];
  10507. if (void 0 === r && (r = {},
  10508. i.__rememberedObjectIndecesToControllers[n] = r),
  10509. r[t.property] = t,
  10510. i.load && i.load.remembered) {
  10511. var o, a = i.load.remembered;
  10512. if (a[e.preset])
  10513. o = a[e.preset];
  10514. else {
  10515. if (!a[L])
  10516. return;
  10517. o = a[L]
  10518. }
  10519. if (o[n] && void 0 !== o[n][t.property]) {
  10520. var s = o[n][t.property];
  10521. t.initialValue = s,
  10522. t.setValue(s)
  10523. }
  10524. }
  10525. }
  10526. }
  10527. function y(e, t) {
  10528. return document.location.href + "." + t
  10529. }
  10530. function C(e) {
  10531. var t = e.__save_row = document.createElement("li");
  10532. p.addClass(e.domElement, "has-save"),
  10533. e.__ul.insertBefore(t, e.__ul.firstChild),
  10534. p.addClass(t, "save-row");
  10535. var i = document.createElement("span");
  10536. i.innerHTML = "&nbsp;",
  10537. p.addClass(i, "button gears");
  10538. var n = document.createElement("span");
  10539. n.innerHTML = "Save",
  10540. p.addClass(n, "button"),
  10541. p.addClass(n, "save");
  10542. var r = document.createElement("span");
  10543. r.innerHTML = "New",
  10544. p.addClass(r, "button"),
  10545. p.addClass(r, "save-as");
  10546. var o = document.createElement("span");
  10547. o.innerHTML = "Revert",
  10548. p.addClass(o, "button"),
  10549. p.addClass(o, "revert");
  10550. var a = e.__preset_select = document.createElement("select");
  10551. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10552. w(e, i, i == e.preset)
  10553. }) : w(e, L, !1),
  10554. p.bind(a, "change", function() {
  10555. for (var t = 0; t < e.__preset_select.length; t++)
  10556. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10557. e.preset = this.value
  10558. }),
  10559. t.appendChild(a),
  10560. t.appendChild(i),
  10561. t.appendChild(n),
  10562. t.appendChild(r),
  10563. t.appendChild(o),
  10564. D) {
  10565. var s = document.getElementById("dg-save-locally")
  10566. , l = document.getElementById("dg-local-explain");
  10567. s.style.display = "block";
  10568. var c = document.getElementById("dg-local-storage");
  10569. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10570. var h = function() {
  10571. l.style.display = e.useLocalStorage ? "block" : "none"
  10572. };
  10573. h(),
  10574. p.bind(c, "change", function() {
  10575. e.useLocalStorage = !e.useLocalStorage,
  10576. h()
  10577. })
  10578. }
  10579. var u = document.getElementById("dg-new-constructor");
  10580. p.bind(u, "keydown", function(e) {
  10581. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10582. }),
  10583. p.bind(i, "click", function() {
  10584. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10585. S.show(),
  10586. u.focus(),
  10587. u.select()
  10588. }),
  10589. p.bind(n, "click", function() {
  10590. e.save()
  10591. }),
  10592. p.bind(r, "click", function() {
  10593. var t = prompt("Enter a new preset name.");
  10594. t && e.saveAs(t)
  10595. }),
  10596. p.bind(o, "click", function() {
  10597. e.revert()
  10598. })
  10599. }
  10600. function I(e) {
  10601. function t(t) {
  10602. return t.preventDefault(),
  10603. r = t.clientX,
  10604. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10605. p.bind(window, "mousemove", i),
  10606. p.bind(window, "mouseup", n),
  10607. !1
  10608. }
  10609. function i(t) {
  10610. return t.preventDefault(),
  10611. e.width += r - t.clientX,
  10612. e.onResize(),
  10613. r = t.clientX,
  10614. !1
  10615. }
  10616. function n() {
  10617. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10618. p.unbind(window, "mousemove", i),
  10619. p.unbind(window, "mouseup", n)
  10620. }
  10621. e.__resize_handle = document.createElement("div"),
  10622. f.extend(e.__resize_handle.style, {
  10623. width: "6px",
  10624. marginLeft: "-3px",
  10625. height: "200px",
  10626. cursor: "ew-resize",
  10627. position: "absolute"
  10628. });
  10629. var r;
  10630. p.bind(e.__resize_handle, "mousedown", t),
  10631. p.bind(e.__closeButton, "mousedown", t),
  10632. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10633. }
  10634. function E(e, t) {
  10635. e.domElement.style.width = t + "px",
  10636. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10637. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10638. }
  10639. function b(e, t) {
  10640. var i = {};
  10641. return f.each(e.__rememberedObjects, function(n, r) {
  10642. var o = {}
  10643. , a = e.__rememberedObjectIndecesToControllers[r];
  10644. f.each(a, function(e, i) {
  10645. o[i] = t ? e.initialValue : e.getValue()
  10646. }),
  10647. i[r] = o
  10648. }),
  10649. i
  10650. }
  10651. function w(e, t, i) {
  10652. var n = document.createElement("option");
  10653. n.innerHTML = t,
  10654. n.value = t,
  10655. e.__preset_select.appendChild(n),
  10656. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10657. }
  10658. function _(e) {
  10659. for (var t = 0; t < e.__preset_select.length; t++)
  10660. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10661. }
  10662. function T(e, t) {
  10663. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10664. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10665. }
  10666. function x(e) {
  10667. 0 != e.length && u(function() {
  10668. x(e)
  10669. }),
  10670. f.each(e, function(e) {
  10671. e.updateDisplay()
  10672. })
  10673. }
  10674. e.inject(i);
  10675. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10676. try {
  10677. return "localStorage"in window && null !== window.localStorage
  10678. } catch (e) {
  10679. return !1
  10680. }
  10681. }(), N = !0, B = !1, F = [], V = function(e) {
  10682. function t() {
  10683. var e = i.getRoot();
  10684. e.width += 1,
  10685. f.defer(function() {
  10686. e.width -= 1
  10687. })
  10688. }
  10689. var i = this;
  10690. this.domElement = document.createElement("div"),
  10691. this.__ul = document.createElement("ul"),
  10692. this.domElement.appendChild(this.__ul),
  10693. p.addClass(this.domElement, R),
  10694. this.__folders = {},
  10695. this.__controllers = [],
  10696. this.__rememberedObjects = [],
  10697. this.__rememberedObjectIndecesToControllers = [],
  10698. this.__listening = [],
  10699. e = e || {},
  10700. e = f.defaults(e, {
  10701. autoPlace: !0,
  10702. width: V.DEFAULT_WIDTH
  10703. }),
  10704. e = f.defaults(e, {
  10705. resizable: e.autoPlace,
  10706. hideable: e.autoPlace
  10707. }),
  10708. f.isUndefined(e.load) ? e.load = {
  10709. preset: L
  10710. } : e.preset && (e.load.preset = e.preset),
  10711. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10712. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10713. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10714. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10715. if (Object.defineProperties(this, {
  10716. parent: {
  10717. get: function() {
  10718. return e.parent
  10719. }
  10720. },
  10721. scrollable: {
  10722. get: function() {
  10723. return e.scrollable
  10724. }
  10725. },
  10726. autoPlace: {
  10727. get: function() {
  10728. return e.autoPlace
  10729. }
  10730. },
  10731. preset: {
  10732. get: function() {
  10733. return i.parent ? i.getRoot().preset : e.load.preset
  10734. },
  10735. set: function(t) {
  10736. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10737. _(this),
  10738. i.revert()
  10739. }
  10740. },
  10741. width: {
  10742. get: function() {
  10743. return e.width
  10744. },
  10745. set: function(t) {
  10746. e.width = t,
  10747. E(i, t)
  10748. }
  10749. },
  10750. name: {
  10751. get: function() {
  10752. return e.name
  10753. },
  10754. set: function(t) {
  10755. e.name = t,
  10756. a && (a.innerHTML = e.name)
  10757. }
  10758. },
  10759. closed: {
  10760. get: function() {
  10761. return e.closed
  10762. },
  10763. set: function(t) {
  10764. e.closed = t,
  10765. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10766. this.onResize(),
  10767. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10768. }
  10769. },
  10770. load: {
  10771. get: function() {
  10772. return e.load
  10773. }
  10774. },
  10775. useLocalStorage: {
  10776. get: function() {
  10777. return r
  10778. },
  10779. set: function(e) {
  10780. D && (r = e,
  10781. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10782. localStorage.setItem(y(i, "isLocal"), e))
  10783. }
  10784. }
  10785. }),
  10786. f.isUndefined(e.parent)) {
  10787. if (e.closed = !1,
  10788. p.addClass(this.domElement, V.CLASS_MAIN),
  10789. p.makeSelectable(this.domElement, !1),
  10790. D && r) {
  10791. i.useLocalStorage = !0;
  10792. var o = localStorage.getItem(y(this, "gui"));
  10793. o && (e.load = JSON.parse(o))
  10794. }
  10795. this.__closeButton = document.createElement("div"),
  10796. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10797. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10798. this.domElement.appendChild(this.__closeButton),
  10799. p.bind(this.__closeButton, "click", function() {
  10800. i.closed = !i.closed
  10801. })
  10802. } else {
  10803. void 0 === e.closed && (e.closed = !0);
  10804. var a = document.createTextNode(e.name);
  10805. p.addClass(a, "controller-name");
  10806. var s = m(i, a)
  10807. , l = function(e) {
  10808. return e.preventDefault(),
  10809. i.closed = !i.closed,
  10810. !1
  10811. };
  10812. p.addClass(this.__ul, V.CLASS_CLOSED),
  10813. p.addClass(s, "title"),
  10814. p.bind(s, "click", l),
  10815. e.closed || (this.closed = !1)
  10816. }
  10817. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10818. p.addClass(M, R),
  10819. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10820. document.body.appendChild(M),
  10821. N = !1),
  10822. M.appendChild(this.domElement),
  10823. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10824. this.parent || E(i, e.width)),
  10825. p.bind(window, "resize", function() {
  10826. i.onResize()
  10827. }),
  10828. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10829. i.onResize()
  10830. }),
  10831. p.bind(this.__ul, "transitionend", function() {
  10832. i.onResize()
  10833. }),
  10834. p.bind(this.__ul, "oTransitionEnd", function() {
  10835. i.onResize()
  10836. }),
  10837. this.onResize(),
  10838. e.resizable && I(this),
  10839. n = function() {
  10840. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10841. }
  10842. ,
  10843. this.saveToLocalStorageIfPossible = n;
  10844. i.getRoot();
  10845. e.parent || t()
  10846. };
  10847. return V.toggleHide = function() {
  10848. B = !B,
  10849. f.each(F, function(e) {
  10850. e.domElement.style.zIndex = B ? -999 : 999,
  10851. e.domElement.style.opacity = B ? 0 : 1
  10852. })
  10853. }
  10854. ,
  10855. V.CLASS_AUTO_PLACE = "a",
  10856. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10857. V.CLASS_MAIN = "main",
  10858. V.CLASS_CONTROLLER_ROW = "cr",
  10859. V.CLASS_TOO_TALL = "taller-than-window",
  10860. V.CLASS_CLOSED = "closed",
  10861. V.CLASS_CLOSE_BUTTON = "close-button",
  10862. V.CLASS_DRAG = "drag",
  10863. V.DEFAULT_WIDTH = 245,
  10864. V.TEXT_CLOSED = "Close Controls",
  10865. V.TEXT_OPEN = "Open Controls",
  10866. p.bind(window, "keydown", function(e) {
  10867. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10868. }, !1),
  10869. f.extend(V.prototype, {
  10870. add: function(e, t) {
  10871. return g(this, e, t, {
  10872. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10873. })
  10874. },
  10875. addColor: function(e, t) {
  10876. return g(this, e, t, {
  10877. color: !0
  10878. })
  10879. },
  10880. remove: function(e) {
  10881. this.__ul.removeChild(e.__li),
  10882. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10883. var t = this;
  10884. f.defer(function() {
  10885. t.onResize()
  10886. })
  10887. },
  10888. destroy: function() {
  10889. this.autoPlace && M.removeChild(this.domElement)
  10890. },
  10891. addFolder: function(e) {
  10892. if (void 0 !== this.__folders[e])
  10893. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10894. var t = {
  10895. name: e,
  10896. parent: this
  10897. };
  10898. t.autoPlace = this.autoPlace,
  10899. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10900. t.load = this.load.folders[e]);
  10901. var i = new V(t);
  10902. this.__folders[e] = i;
  10903. var n = m(this, i.domElement);
  10904. return p.addClass(n, "folder"),
  10905. i
  10906. },
  10907. open: function() {
  10908. this.closed = !1
  10909. },
  10910. close: function() {
  10911. this.closed = !0
  10912. },
  10913. onResize: function() {
  10914. var e = this.getRoot();
  10915. if (e.scrollable) {
  10916. var t = p.getOffset(e.__ul).top
  10917. , i = 0;
  10918. f.each(e.__ul.childNodes, function(t) {
  10919. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10920. }),
  10921. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10922. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10923. e.__ul.style.height = "auto")
  10924. }
  10925. e.__resize_handle && f.defer(function() {
  10926. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10927. }),
  10928. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10929. },
  10930. remember: function() {
  10931. if (f.isUndefined(S) && (S = new d,
  10932. S.domElement.innerHTML = t),
  10933. this.parent)
  10934. throw new Error("You can only call remember on a top level GUI.");
  10935. var e = this;
  10936. f.each(Array.prototype.slice.call(arguments), function(t) {
  10937. 0 == e.__rememberedObjects.length && C(e),
  10938. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10939. }),
  10940. this.autoPlace && E(this, this.width)
  10941. },
  10942. getRoot: function() {
  10943. for (var e = this; e.parent; )
  10944. e = e.parent;
  10945. return e
  10946. },
  10947. getSaveObject: function() {
  10948. var e = this.load;
  10949. return e.closed = this.closed,
  10950. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10951. e.remembered || (e.remembered = {}),
  10952. e.remembered[this.preset] = b(this)),
  10953. e.folders = {},
  10954. f.each(this.__folders, function(t, i) {
  10955. e.folders[i] = t.getSaveObject()
  10956. }),
  10957. e
  10958. },
  10959. save: function() {
  10960. this.load.remembered || (this.load.remembered = {}),
  10961. this.load.remembered[this.preset] = b(this),
  10962. T(this, !1),
  10963. this.saveToLocalStorageIfPossible()
  10964. },
  10965. saveAs: function(e) {
  10966. this.load.remembered || (this.load.remembered = {},
  10967. this.load.remembered[L] = b(this, !0)),
  10968. this.load.remembered[e] = b(this),
  10969. this.preset = e,
  10970. w(this, e, !0),
  10971. this.saveToLocalStorageIfPossible()
  10972. },
  10973. revert: function(e) {
  10974. f.each(this.__controllers, function(t) {
  10975. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10976. }, this),
  10977. f.each(this.__folders, function(e) {
  10978. e.revert(e)
  10979. }),
  10980. e || T(this.getRoot(), !1)
  10981. },
  10982. listen: function(e) {
  10983. var t = 0 == this.__listening.length;
  10984. this.__listening.push(e),
  10985. t && x(this.__listening)
  10986. }
  10987. }),
  10988. V
  10989. }(n.utils.css, '<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>', ".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", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10990. return function(s, l) {
  10991. var c = s[l];
  10992. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10993. min: arguments[2],
  10994. max: arguments[3]
  10995. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10996. }
  10997. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10998. var n = function(e, i) {
  10999. function r() {
  11000. a.setValue(a.__input.value)
  11001. }
  11002. function o() {
  11003. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11004. }
  11005. n.superclass.call(this, e, i);
  11006. var a = this;
  11007. this.__input = document.createElement("input"),
  11008. this.__input.setAttribute("type", "text"),
  11009. t.bind(this.__input, "keyup", r),
  11010. t.bind(this.__input, "change", r),
  11011. t.bind(this.__input, "blur", o),
  11012. t.bind(this.__input, "keydown", function(e) {
  11013. 13 === e.keyCode && this.blur()
  11014. }),
  11015. this.updateDisplay(),
  11016. this.domElement.appendChild(this.__input)
  11017. };
  11018. return n.superclass = e,
  11019. i.extend(n.prototype, e.prototype, {
  11020. updateDisplay: function() {
  11021. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11022. n.superclass.prototype.updateDisplay.call(this)
  11023. }
  11024. }),
  11025. n
  11026. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  11027. function o(e, t, i, n) {
  11028. e.style.background = "",
  11029. r.each(l, function(r) {
  11030. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11031. })
  11032. }
  11033. function a(e) {
  11034. e.style.background = "",
  11035. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11036. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11037. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11038. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11039. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11040. }
  11041. var s = function(e, l) {
  11042. function c(e) {
  11043. p(e),
  11044. t.bind(window, "mousemove", p),
  11045. t.bind(window, "mouseup", h)
  11046. }
  11047. function h() {
  11048. t.unbind(window, "mousemove", p),
  11049. t.unbind(window, "mouseup", h)
  11050. }
  11051. function u() {
  11052. var e = n(this.value);
  11053. e !== !1 ? (g.__color.__state = e,
  11054. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11055. }
  11056. function d() {
  11057. t.unbind(window, "mousemove", f),
  11058. t.unbind(window, "mouseup", d)
  11059. }
  11060. function p(e) {
  11061. e.preventDefault();
  11062. var i = t.getWidth(g.__saturation_field)
  11063. , n = t.getOffset(g.__saturation_field)
  11064. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11065. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11066. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11067. r > 1 ? r = 1 : r < 0 && (r = 0),
  11068. g.__color.v = o,
  11069. g.__color.s = r,
  11070. g.setValue(g.__color.toOriginal()),
  11071. !1
  11072. }
  11073. function f(e) {
  11074. e.preventDefault();
  11075. var i = t.getHeight(g.__hue_field)
  11076. , n = t.getOffset(g.__hue_field)
  11077. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11078. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11079. g.__color.h = 360 * r,
  11080. g.setValue(g.__color.toOriginal()),
  11081. !1
  11082. }
  11083. s.superclass.call(this, e, l),
  11084. this.__color = new i(this.getValue()),
  11085. this.__temp = new i(0);
  11086. var g = this;
  11087. this.domElement = document.createElement("div"),
  11088. t.makeSelectable(this.domElement, !1),
  11089. this.__selector = document.createElement("div"),
  11090. this.__selector.className = "selector",
  11091. this.__saturation_field = document.createElement("div"),
  11092. this.__saturation_field.className = "saturation-field",
  11093. this.__field_knob = document.createElement("div"),
  11094. this.__field_knob.className = "field-knob",
  11095. this.__field_knob_border = "2px solid ",
  11096. this.__hue_knob = document.createElement("div"),
  11097. this.__hue_knob.className = "hue-knob",
  11098. this.__hue_field = document.createElement("div"),
  11099. this.__hue_field.className = "hue-field",
  11100. this.__input = document.createElement("input"),
  11101. this.__input.type = "text",
  11102. this.__input_textShadow = "0 1px 1px ",
  11103. t.bind(this.__input, "keydown", function(e) {
  11104. 13 === e.keyCode && u.call(this)
  11105. }),
  11106. t.bind(this.__input, "blur", u),
  11107. t.bind(this.__selector, "mousedown", function(e) {
  11108. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11109. t.removeClass(g.__selector, "drag")
  11110. })
  11111. });
  11112. var m = document.createElement("div");
  11113. r.extend(this.__selector.style, {
  11114. width: "122px",
  11115. height: "102px",
  11116. padding: "3px",
  11117. backgroundColor: "#222",
  11118. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11119. }),
  11120. r.extend(this.__field_knob.style, {
  11121. position: "absolute",
  11122. width: "12px",
  11123. height: "12px",
  11124. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11125. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11126. borderRadius: "12px",
  11127. zIndex: 1
  11128. }),
  11129. r.extend(this.__hue_knob.style, {
  11130. position: "absolute",
  11131. width: "15px",
  11132. height: "2px",
  11133. borderRight: "4px solid #fff",
  11134. zIndex: 1
  11135. }),
  11136. r.extend(this.__saturation_field.style, {
  11137. width: "100px",
  11138. height: "100px",
  11139. border: "1px solid #555",
  11140. marginRight: "3px",
  11141. display: "inline-block",
  11142. cursor: "pointer"
  11143. }),
  11144. r.extend(m.style, {
  11145. width: "100%",
  11146. height: "100%",
  11147. background: "none"
  11148. }),
  11149. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11150. r.extend(this.__hue_field.style, {
  11151. width: "15px",
  11152. height: "100px",
  11153. display: "inline-block",
  11154. border: "1px solid #555",
  11155. cursor: "ns-resize"
  11156. }),
  11157. a(this.__hue_field),
  11158. r.extend(this.__input.style, {
  11159. outline: "none",
  11160. textAlign: "center",
  11161. color: "#fff",
  11162. border: 0,
  11163. fontWeight: "bold",
  11164. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11165. }),
  11166. t.bind(this.__saturation_field, "mousedown", c),
  11167. t.bind(this.__field_knob, "mousedown", c),
  11168. t.bind(this.__hue_field, "mousedown", function(e) {
  11169. f(e),
  11170. t.bind(window, "mousemove", f),
  11171. t.bind(window, "mouseup", d)
  11172. }),
  11173. this.__saturation_field.appendChild(m),
  11174. this.__selector.appendChild(this.__field_knob),
  11175. this.__selector.appendChild(this.__saturation_field),
  11176. this.__selector.appendChild(this.__hue_field),
  11177. this.__hue_field.appendChild(this.__hue_knob),
  11178. this.domElement.appendChild(this.__input),
  11179. this.domElement.appendChild(this.__selector),
  11180. this.updateDisplay()
  11181. };
  11182. s.superclass = e,
  11183. r.extend(s.prototype, e.prototype, {
  11184. updateDisplay: function() {
  11185. var e = n(this.getValue());
  11186. if (e !== !1) {
  11187. var t = !1;
  11188. r.each(i.COMPONENTS, function(i) {
  11189. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11190. return t = !0,
  11191. {}
  11192. }, this),
  11193. t && r.extend(this.__color.__state, e)
  11194. }
  11195. r.extend(this.__temp.__state, this.__color.__state),
  11196. this.__temp.a = 1;
  11197. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11198. , s = 255 - a;
  11199. r.extend(this.__field_knob.style, {
  11200. marginLeft: 100 * this.__color.s - 7 + "px",
  11201. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11202. backgroundColor: this.__temp.toString(),
  11203. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11204. }),
  11205. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11206. this.__temp.s = 1,
  11207. this.__temp.v = 1,
  11208. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11209. r.extend(this.__input.style, {
  11210. backgroundColor: this.__input.value = this.__color.toString(),
  11211. color: "rgb(" + a + "," + a + "," + a + ")",
  11212. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11213. })
  11214. }
  11215. });
  11216. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11217. return s
  11218. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11219. function r(e, t, i) {
  11220. Object.defineProperty(e, t, {
  11221. get: function() {
  11222. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11223. this.__state[t])
  11224. },
  11225. set: function(e) {
  11226. "RGB" !== this.__state.space && (a(this, t, i),
  11227. this.__state.space = "RGB"),
  11228. this.__state[t] = e
  11229. }
  11230. })
  11231. }
  11232. function o(e, t) {
  11233. Object.defineProperty(e, t, {
  11234. get: function() {
  11235. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11236. this.__state[t])
  11237. },
  11238. set: function(e) {
  11239. "HSV" !== this.__state.space && (s(this),
  11240. this.__state.space = "HSV"),
  11241. this.__state[t] = e
  11242. }
  11243. })
  11244. }
  11245. function a(e, i, r) {
  11246. if ("HEX" === e.__state.space)
  11247. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11248. else {
  11249. if ("HSV" !== e.__state.space)
  11250. throw "Corrupted color state";
  11251. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11252. }
  11253. }
  11254. function s(e) {
  11255. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11256. n.extend(e.__state, {
  11257. s: i.s,
  11258. v: i.v
  11259. }),
  11260. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11261. }
  11262. var l = function() {
  11263. if (this.__state = e.apply(this, arguments),
  11264. this.__state === !1)
  11265. throw "Failed to interpret color arguments";
  11266. this.__state.a = this.__state.a || 1
  11267. };
  11268. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11269. n.extend(l.prototype, {
  11270. toString: function() {
  11271. return i(this)
  11272. },
  11273. toOriginal: function() {
  11274. return this.__state.conversion.write(this)
  11275. }
  11276. }),
  11277. r(l.prototype, "r", 2),
  11278. r(l.prototype, "g", 1),
  11279. r(l.prototype, "b", 0),
  11280. o(l.prototype, "h"),
  11281. o(l.prototype, "s"),
  11282. o(l.prototype, "v"),
  11283. Object.defineProperty(l.prototype, "a", {
  11284. get: function() {
  11285. return this.__state.a
  11286. },
  11287. set: function(e) {
  11288. this.__state.a = e
  11289. }
  11290. }),
  11291. Object.defineProperty(l.prototype, "hex", {
  11292. get: function() {
  11293. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11294. this.__state.hex
  11295. },
  11296. set: function(e) {
  11297. this.__state.space = "HEX",
  11298. this.__state.hex = e
  11299. }
  11300. }),
  11301. l
  11302. }(n.color.interpret, n.color.math = function() {
  11303. var e;
  11304. return {
  11305. hsv_to_rgb: function(e, t, i) {
  11306. var n = Math.floor(e / 60) % 6
  11307. , r = e / 60 - Math.floor(e / 60)
  11308. , o = i * (1 - t)
  11309. , a = i * (1 - r * t)
  11310. , s = i * (1 - (1 - r) * t)
  11311. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11312. return {
  11313. r: 255 * l[0],
  11314. g: 255 * l[1],
  11315. b: 255 * l[2]
  11316. }
  11317. },
  11318. rgb_to_hsv: function(e, t, i) {
  11319. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11320. return 0 == a ? {
  11321. h: NaN,
  11322. s: 0,
  11323. v: 0
  11324. } : (r = s / a,
  11325. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11326. n /= 6,
  11327. n < 0 && (n += 1),
  11328. {
  11329. h: 360 * n,
  11330. s: r,
  11331. v: a / 255
  11332. })
  11333. },
  11334. rgb_to_hex: function(e, t, i) {
  11335. var n = this.hex_with_component(0, 2, e);
  11336. return n = this.hex_with_component(n, 1, t),
  11337. n = this.hex_with_component(n, 0, i)
  11338. },
  11339. component_from_hex: function(e, t) {
  11340. return e >> 8 * t & 255
  11341. },
  11342. hex_with_component: function(t, i, n) {
  11343. return n << (e = 8 * i) | t & ~(255 << e)
  11344. }
  11345. }
  11346. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11347. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11348. window.setTimeout(e, 1e3 / 60)
  11349. }
  11350. }(), n.dom.CenteredDiv = function(e, t) {
  11351. var i = function() {
  11352. this.backgroundElement = document.createElement("div"),
  11353. t.extend(this.backgroundElement.style, {
  11354. backgroundColor: "rgba(0,0,0,0.8)",
  11355. top: 0,
  11356. left: 0,
  11357. display: "none",
  11358. zIndex: "1000",
  11359. opacity: 0,
  11360. WebkitTransition: "opacity 0.2s linear"
  11361. }),
  11362. e.makeFullscreen(this.backgroundElement),
  11363. this.backgroundElement.style.position = "fixed",
  11364. this.domElement = document.createElement("div"),
  11365. t.extend(this.domElement.style, {
  11366. position: "fixed",
  11367. display: "none",
  11368. zIndex: "1001",
  11369. opacity: 0,
  11370. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11371. }),
  11372. document.body.appendChild(this.backgroundElement),
  11373. document.body.appendChild(this.domElement);
  11374. var i = this;
  11375. e.bind(this.backgroundElement, "click", function() {
  11376. i.hide()
  11377. })
  11378. };
  11379. return i.prototype.show = function() {
  11380. var e = this;
  11381. this.backgroundElement.style.display = "block",
  11382. this.domElement.style.display = "block",
  11383. this.domElement.style.opacity = 0,
  11384. this.domElement.style.webkitTransform = "scale(1.1)",
  11385. this.layout(),
  11386. t.defer(function() {
  11387. e.backgroundElement.style.opacity = 1,
  11388. e.domElement.style.opacity = 1,
  11389. e.domElement.style.webkitTransform = "scale(1)"
  11390. })
  11391. }
  11392. ,
  11393. i.prototype.hide = function() {
  11394. var t = this
  11395. , i = function() {
  11396. t.domElement.style.display = "none",
  11397. t.backgroundElement.style.display = "none",
  11398. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11399. e.unbind(t.domElement, "transitionend", i),
  11400. e.unbind(t.domElement, "oTransitionEnd", i)
  11401. };
  11402. e.bind(this.domElement, "webkitTransitionEnd", i),
  11403. e.bind(this.domElement, "transitionend", i),
  11404. e.bind(this.domElement, "oTransitionEnd", i),
  11405. this.backgroundElement.style.opacity = 0,
  11406. this.domElement.style.opacity = 0,
  11407. this.domElement.style.webkitTransform = "scale(1.1)"
  11408. }
  11409. ,
  11410. i.prototype.layout = function() {
  11411. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11412. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11413. }
  11414. ,
  11415. i
  11416. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11417. }
  11418. , {}],
  11419. 94: [function(e, t, i) {
  11420. (function(e) {
  11421. "use strict";
  11422. function i(t) {
  11423. function i(e) {
  11424. 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++) {
  11425. var n = _((t[i] * e + 50) / 100);
  11426. n < 1 ? n = 1 : n > 255 && (n = 255),
  11427. T[G[i]] = n
  11428. }
  11429. 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++) {
  11430. var a = _((r[o] * e + 50) / 100);
  11431. a < 1 ? a = 1 : a > 255 && (a = 255),
  11432. x[G[o]] = a
  11433. }
  11434. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11435. for (var h = 0; h < 8; h++)
  11436. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11437. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11438. l++
  11439. }
  11440. function n(e, t) {
  11441. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11442. for (var a = 1; a <= e[o]; a++)
  11443. r[t[n]] = [],
  11444. r[t[n]][0] = i,
  11445. r[t[n]][1] = o,
  11446. n++,
  11447. i++;
  11448. i *= 2
  11449. }
  11450. return r
  11451. }
  11452. function r() {
  11453. C = n(z, W),
  11454. I = n(X, Z),
  11455. E = n(j, Y),
  11456. b = n(q, K)
  11457. }
  11458. function o() {
  11459. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11460. for (var n = e; n < t; n++)
  11461. P[32767 + n] = i,
  11462. R[32767 + n] = [],
  11463. R[32767 + n][1] = i,
  11464. R[32767 + n][0] = n;
  11465. for (var r = -(t - 1); r <= -e; r++)
  11466. P[32767 + r] = i,
  11467. R[32767 + r] = [],
  11468. R[32767 + r][1] = i,
  11469. R[32767 + r][0] = t - 1 + r;
  11470. e <<= 1,
  11471. t <<= 1
  11472. }
  11473. }
  11474. function a() {
  11475. for (var e = 0; e < 256; e++)
  11476. H[e] = 19595 * e,
  11477. H[e + 256 >> 0] = 38470 * e,
  11478. H[e + 512 >> 0] = 7471 * e + 32768,
  11479. H[e + 768 >> 0] = -11059 * e,
  11480. H[e + 1024 >> 0] = -21709 * e,
  11481. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11482. H[e + 1536 >> 0] = -27439 * e,
  11483. H[e + 1792 >> 0] = -5329 * e
  11484. }
  11485. function s(e) {
  11486. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11487. t & 1 << i && (N |= 1 << B),
  11488. i--,
  11489. B--,
  11490. B < 0 && (255 == N ? (l(255),
  11491. l(0)) : l(N),
  11492. B = 7,
  11493. N = 0)
  11494. }
  11495. function l(e) {
  11496. D.push(e)
  11497. }
  11498. function c(e) {
  11499. l(e >> 8 & 255),
  11500. l(255 & e)
  11501. }
  11502. function h(e, t) {
  11503. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11504. for (h = 0; h < d; ++h) {
  11505. i = e[u],
  11506. n = e[u + 1],
  11507. r = e[u + 2],
  11508. o = e[u + 3],
  11509. a = e[u + 4],
  11510. s = e[u + 5],
  11511. l = e[u + 6],
  11512. c = e[u + 7];
  11513. var f = i + c
  11514. , g = i - c
  11515. , m = n + l
  11516. , v = n - l
  11517. , A = r + s
  11518. , y = r - s
  11519. , C = o + a
  11520. , I = o - a
  11521. , E = f + C
  11522. , b = f - C
  11523. , w = m + A
  11524. , _ = m - A;
  11525. e[u] = E + w,
  11526. e[u + 4] = E - w;
  11527. var T = .707106781 * (_ + b);
  11528. e[u + 2] = b + T,
  11529. e[u + 6] = b - T,
  11530. E = I + y,
  11531. w = y + v,
  11532. _ = v + g;
  11533. var x = .382683433 * (E - _)
  11534. , S = .5411961 * E + x
  11535. , M = 1.306562965 * _ + x
  11536. , R = .707106781 * w
  11537. , P = g + R
  11538. , L = g - R;
  11539. e[u + 5] = L + S,
  11540. e[u + 3] = L - S,
  11541. e[u + 1] = P + M,
  11542. e[u + 7] = P - M,
  11543. u += 8
  11544. }
  11545. for (u = 0,
  11546. h = 0; h < d; ++h) {
  11547. i = e[u],
  11548. n = e[u + 8],
  11549. r = e[u + 16],
  11550. o = e[u + 24],
  11551. a = e[u + 32],
  11552. s = e[u + 40],
  11553. l = e[u + 48],
  11554. c = e[u + 56];
  11555. var D = i + c
  11556. , N = i - c
  11557. , B = n + l
  11558. , F = n - l
  11559. , V = r + s
  11560. , U = r - s
  11561. , k = o + a
  11562. , H = o - a
  11563. , G = D + k
  11564. , z = D - k
  11565. , W = B + V
  11566. , j = B - V;
  11567. e[u] = G + W,
  11568. e[u + 32] = G - W;
  11569. var Y = .707106781 * (j + z);
  11570. e[u + 16] = z + Y,
  11571. e[u + 48] = z - Y,
  11572. G = H + U,
  11573. W = U + F,
  11574. j = F + N;
  11575. var X = .382683433 * (G - j)
  11576. , Z = .5411961 * G + X
  11577. , q = 1.306562965 * j + X
  11578. , K = .707106781 * W
  11579. , Q = N + K
  11580. , J = N - K;
  11581. e[u + 40] = J + Z,
  11582. e[u + 24] = J - Z,
  11583. e[u + 8] = Q + q,
  11584. e[u + 56] = Q - q,
  11585. u++
  11586. }
  11587. var $;
  11588. for (h = 0; h < p; ++h)
  11589. $ = e[h] * t[h],
  11590. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11591. return O
  11592. }
  11593. function u() {
  11594. c(65504),
  11595. c(16),
  11596. l(74),
  11597. l(70),
  11598. l(73),
  11599. l(70),
  11600. l(0),
  11601. l(1),
  11602. l(1),
  11603. l(0),
  11604. c(1),
  11605. c(1),
  11606. l(0),
  11607. l(0)
  11608. }
  11609. function d(e, t) {
  11610. c(65472),
  11611. c(17),
  11612. l(8),
  11613. c(t),
  11614. c(e),
  11615. l(3),
  11616. l(1),
  11617. l(17),
  11618. l(0),
  11619. l(2),
  11620. l(17),
  11621. l(1),
  11622. l(3),
  11623. l(17),
  11624. l(1)
  11625. }
  11626. function p() {
  11627. c(65499),
  11628. c(132),
  11629. l(0);
  11630. for (var e = 0; e < 64; e++)
  11631. l(T[e]);
  11632. l(1);
  11633. for (var t = 0; t < 64; t++)
  11634. l(x[t])
  11635. }
  11636. function f() {
  11637. c(65476),
  11638. c(418),
  11639. l(0);
  11640. for (var e = 0; e < 16; e++)
  11641. l(z[e + 1]);
  11642. for (var t = 0; t <= 11; t++)
  11643. l(W[t]);
  11644. l(16);
  11645. for (var i = 0; i < 16; i++)
  11646. l(j[i + 1]);
  11647. for (var n = 0; n <= 161; n++)
  11648. l(Y[n]);
  11649. l(1);
  11650. for (var r = 0; r < 16; r++)
  11651. l(X[r + 1]);
  11652. for (var o = 0; o <= 11; o++)
  11653. l(Z[o]);
  11654. l(17);
  11655. for (var a = 0; a < 16; a++)
  11656. l(q[a + 1]);
  11657. for (var s = 0; s <= 161; s++)
  11658. l(K[s])
  11659. }
  11660. function g() {
  11661. c(65498),
  11662. c(12),
  11663. l(3),
  11664. l(1),
  11665. l(0),
  11666. l(2),
  11667. l(17),
  11668. l(3),
  11669. l(17),
  11670. l(0),
  11671. l(63),
  11672. l(0)
  11673. }
  11674. function m(e, t, i, n, r) {
  11675. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11676. L[G[f]] = p[f];
  11677. var g = L[0] - i;
  11678. i = L[0],
  11679. 0 == g ? s(n[0]) : (o = 32767 + g,
  11680. s(n[P[o]]),
  11681. s(R[o]));
  11682. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11683. ;
  11684. if (0 == m)
  11685. return s(a),
  11686. i;
  11687. for (var v, A = 1; A <= m; ) {
  11688. for (var y = A; 0 == L[A] && A <= m; ++A)
  11689. ;
  11690. var C = A - y;
  11691. if (C >= c) {
  11692. v = C >> 4;
  11693. for (var I = 1; I <= v; ++I)
  11694. s(l);
  11695. C &= 15
  11696. }
  11697. o = 32767 + L[A],
  11698. s(r[(C << 4) + P[o]]),
  11699. s(R[o]),
  11700. A++
  11701. }
  11702. return m != u && s(a),
  11703. i
  11704. }
  11705. function v() {
  11706. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11707. k[t] = e(t)
  11708. }
  11709. function A(e) {
  11710. if (e <= 0 && (e = 1),
  11711. e > 100 && (e = 100),
  11712. w != e) {
  11713. var t = 0;
  11714. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11715. i(t),
  11716. w = e
  11717. }
  11718. }
  11719. function y() {
  11720. var e = (new Date).getTime();
  11721. t || (t = 50),
  11722. v(),
  11723. r(),
  11724. o(),
  11725. a(),
  11726. A(t);
  11727. (new Date).getTime() - e
  11728. }
  11729. var C, I, E, b, w, _ = (Math.round,
  11730. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [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], z = [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], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [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];
  11731. this.encode = function(t, i) {
  11732. var n = ((new Date).getTime(),
  11733. i.quality);
  11734. n && A(n),
  11735. D = new Array,
  11736. N = 0,
  11737. B = 7,
  11738. c(65496),
  11739. u(),
  11740. p(),
  11741. d(t.width, t.height),
  11742. f(),
  11743. g();
  11744. var r = 0
  11745. , o = 0
  11746. , a = 0;
  11747. N = 0,
  11748. B = 7,
  11749. this.encode.displayName = "_encode_";
  11750. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11751. for (l = 0; l < G; ) {
  11752. for (w = G * z + l,
  11753. _ = w,
  11754. T = -1,
  11755. x = 0,
  11756. R = 0; R < 64; R++)
  11757. x = (k ? 63 - R : R) >> 3,
  11758. T = 4 * (7 & R),
  11759. _ = w + x * G + T,
  11760. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11761. l + T >= G && (_ -= l + T - G + 4),
  11762. h = P[_++],
  11763. v = P[_++],
  11764. y = P[_++],
  11765. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11766. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11767. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11768. r = m(F, S, r, C, E),
  11769. o = m(V, M, o, I, b),
  11770. a = m(U, M, a, I, b),
  11771. l += 32
  11772. }
  11773. z += W
  11774. }
  11775. if (B >= 0) {
  11776. var j = [];
  11777. j[1] = B + 1,
  11778. j[0] = (1 << B + 1) - 1,
  11779. s(j)
  11780. }
  11781. return c(65497),
  11782. new e(D)
  11783. }
  11784. ,
  11785. y()
  11786. }
  11787. function n(e, t) {
  11788. t = t || {},
  11789. t.quality = t.quality || 50;
  11790. var n = t.quality
  11791. , r = new i(n)
  11792. , o = r.encode(e, t);
  11793. return {
  11794. data: o,
  11795. width: e.width,
  11796. height: e.height
  11797. }
  11798. }
  11799. t.exports.encode = n
  11800. }
  11801. ).call(this, e("buffer").Buffer)
  11802. }
  11803. , {
  11804. buffer: 198
  11805. }],
  11806. 95: [function(e, t, i) {
  11807. "use strict";
  11808. !function() {
  11809. if ("performance"in window == !1 && (window.performance = {}),
  11810. Date.now = Date.now || function() {
  11811. return (new Date).getTime()
  11812. }
  11813. ,
  11814. "now"in window.performance == !1) {
  11815. var e = Date.now();
  11816. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11817. window.performance.now = function() {
  11818. return Date.now() - e
  11819. }
  11820. }
  11821. }()
  11822. }
  11823. , {}],
  11824. 96: [function(e, t, i) {
  11825. "use strict";
  11826. var n = e("three");
  11827. n.EffectComposer = function(e, t) {
  11828. if (this.renderer = e,
  11829. void 0 === t) {
  11830. var i = {
  11831. minFilter: n.LinearFilter,
  11832. magFilter: n.LinearFilter,
  11833. format: n.RGBAFormat,
  11834. stencilBuffer: !1
  11835. }
  11836. , r = e.getSize();
  11837. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11838. }
  11839. this.renderTarget1 = t,
  11840. this.renderTarget2 = t.clone(),
  11841. this.writeBuffer = this.renderTarget1,
  11842. this.readBuffer = this.renderTarget2,
  11843. this.passes = [],
  11844. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11845. this.copyPass = new n.ShaderPass(n.CopyShader)
  11846. }
  11847. ,
  11848. n.EffectComposer.prototype = {
  11849. swapBuffers: function() {
  11850. var e = this.readBuffer;
  11851. this.readBuffer = this.writeBuffer,
  11852. this.writeBuffer = e
  11853. },
  11854. addPass: function(e) {
  11855. this.passes.push(e)
  11856. },
  11857. insertPass: function(e, t) {
  11858. this.passes.splice(t, 0, e)
  11859. },
  11860. render: function(e) {
  11861. this.writeBuffer = this.renderTarget1,
  11862. this.readBuffer = this.renderTarget2;
  11863. var t, i, r = !1, o = this.passes.length;
  11864. for (i = 0; i < o; i++)
  11865. if (t = this.passes[i],
  11866. t.enabled) {
  11867. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11868. t.needsSwap) {
  11869. if (r) {
  11870. var a = this.renderer.context;
  11871. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11872. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11873. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11874. }
  11875. this.swapBuffers()
  11876. }
  11877. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11878. }
  11879. },
  11880. reset: function(e) {
  11881. if (void 0 === e) {
  11882. var t = this.renderer.getSize();
  11883. e = this.renderTarget1.clone(),
  11884. e.setSize(t.width, t.height)
  11885. }
  11886. this.renderTarget1.dispose(),
  11887. this.renderTarget2.dispose(),
  11888. this.renderTarget1 = e,
  11889. this.renderTarget2 = e.clone(),
  11890. this.writeBuffer = this.renderTarget1,
  11891. this.readBuffer = this.renderTarget2
  11892. },
  11893. setSize: function(e, t) {
  11894. this.renderTarget1.setSize(e, t),
  11895. this.renderTarget2.setSize(e, t)
  11896. }
  11897. }
  11898. }
  11899. , {
  11900. three: 217
  11901. }],
  11902. 97: [function(e, t, i) {
  11903. "use strict";
  11904. var n = e("three");
  11905. n.MaskPass = function(e, t) {
  11906. this.scene = e,
  11907. this.camera = t,
  11908. this.enabled = !0,
  11909. this.clear = !0,
  11910. this.needsSwap = !1,
  11911. this.inverse = !1
  11912. }
  11913. ,
  11914. n.MaskPass.prototype = {
  11915. render: function(e, t, i, n) {
  11916. var r = e.context;
  11917. r.colorMask(!1, !1, !1, !1),
  11918. r.depthMask(!1);
  11919. var o, a;
  11920. this.inverse ? (o = 0,
  11921. a = 1) : (o = 1,
  11922. a = 0),
  11923. r.enable(r.STENCIL_TEST),
  11924. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11925. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11926. r.clearStencil(a),
  11927. e.render(this.scene, this.camera, i, this.clear),
  11928. e.render(this.scene, this.camera, t, this.clear),
  11929. r.colorMask(!0, !0, !0, !0),
  11930. r.depthMask(!0),
  11931. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11932. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11933. }
  11934. },
  11935. n.ClearMaskPass = function() {
  11936. this.enabled = !0
  11937. }
  11938. ,
  11939. n.ClearMaskPass.prototype = {
  11940. render: function(e, t, i, n) {
  11941. var r = e.context;
  11942. r.disable(r.STENCIL_TEST)
  11943. }
  11944. }
  11945. }
  11946. , {
  11947. three: 217
  11948. }],
  11949. 98: [function(e, t, i) {
  11950. "use strict";
  11951. var n = e("three");
  11952. n.RenderPass = function(e, t, i, r, o) {
  11953. this.scene = e,
  11954. this.camera = t,
  11955. this.overrideMaterial = i,
  11956. this.clearColor = r,
  11957. this.clearAlpha = void 0 !== o ? o : 1,
  11958. this.oldClearColor = new n.Color,
  11959. this.oldClearAlpha = 1,
  11960. this.enabled = !0,
  11961. this.clear = !0,
  11962. this.needsSwap = !1
  11963. }
  11964. ,
  11965. n.RenderPass.prototype = {
  11966. render: function(e, t, i, n) {
  11967. this.scene.overrideMaterial = this.overrideMaterial,
  11968. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11969. this.oldClearAlpha = e.getClearAlpha(),
  11970. e.setClearColor(this.clearColor, this.clearAlpha)),
  11971. e.render(this.scene, this.camera, i, this.clear),
  11972. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11973. this.scene.overrideMaterial = null
  11974. }
  11975. }
  11976. }
  11977. , {
  11978. three: 217
  11979. }],
  11980. 99: [function(e, t, i) {
  11981. "use strict";
  11982. var n = e("three");
  11983. n.ShaderPass = function(e, t) {
  11984. this.textureID = void 0 !== t ? t : "tDiffuse",
  11985. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11986. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11987. this.material = new n.ShaderMaterial({
  11988. defines: e.defines || {},
  11989. uniforms: this.uniforms,
  11990. vertexShader: e.vertexShader,
  11991. fragmentShader: e.fragmentShader
  11992. })),
  11993. this.renderToScreen = !1,
  11994. this.enabled = !0,
  11995. this.needsSwap = !0,
  11996. this.clear = !1,
  11997. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11998. this.scene = new n.Scene,
  11999. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12000. this.scene.add(this.quad)
  12001. }
  12002. ,
  12003. n.ShaderPass.prototype = {
  12004. render: function(e, t, i, n) {
  12005. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12006. this.quad.material = this.material,
  12007. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12008. }
  12009. }
  12010. }
  12011. , {
  12012. three: 217
  12013. }],
  12014. 100: [function(e, t, i) {
  12015. "use strict";
  12016. var n = e("three");
  12017. n.CopyShader = {
  12018. uniforms: {
  12019. tDiffuse: {
  12020. type: "t",
  12021. value: null
  12022. },
  12023. opacity: {
  12024. type: "f",
  12025. value: 1
  12026. }
  12027. },
  12028. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12029. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12030. }
  12031. }
  12032. , {
  12033. three: 217
  12034. }],
  12035. 101: [function(e, t, i) {
  12036. "use strict";
  12037. var n = e("three");
  12038. n.HorizontalBlurShader = {
  12039. uniforms: {
  12040. tDiffuse: {
  12041. type: "t",
  12042. value: null
  12043. },
  12044. h: {
  12045. type: "f",
  12046. value: 1 / 512
  12047. }
  12048. },
  12049. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12050. 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")
  12051. }
  12052. }
  12053. , {
  12054. three: 217
  12055. }],
  12056. 102: [function(e, t, i) {
  12057. "use strict";
  12058. var n = e("three");
  12059. n.VerticalBlurShader = {
  12060. uniforms: {
  12061. tDiffuse: {
  12062. type: "t",
  12063. value: null
  12064. },
  12065. v: {
  12066. type: "f",
  12067. value: 1 / 512
  12068. }
  12069. },
  12070. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12071. 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")
  12072. }
  12073. }
  12074. , {
  12075. three: 217
  12076. }],
  12077. 103: [function(e, t, i) {
  12078. "use strict";
  12079. var n = e("three");
  12080. !function() {
  12081. if ("performance"in window == 0 && (window.performance = {}),
  12082. "now"in window.performance == 0) {
  12083. var e = Date.now();
  12084. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12085. window.performance.now = function() {
  12086. return Date.now() - e
  12087. }
  12088. }
  12089. }(),
  12090. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12091. var t, i = this.extensions, r = this.context;
  12092. if (e === n.RepeatWrapping)
  12093. return r.REPEAT;
  12094. if (e === n.ClampToEdgeWrapping)
  12095. return r.CLAMP_TO_EDGE;
  12096. if (e === n.MirroredRepeatWrapping)
  12097. return r.MIRRORED_REPEAT;
  12098. if (e === n.NearestFilter)
  12099. return r.NEAREST;
  12100. if (e === n.NearestMipMapNearestFilter)
  12101. return r.NEAREST_MIPMAP_NEAREST;
  12102. if (e === n.NearestMipMapLinearFilter)
  12103. return r.NEAREST_MIPMAP_LINEAR;
  12104. if (e === n.LinearFilter)
  12105. return r.LINEAR;
  12106. if (e === n.LinearMipMapNearestFilter)
  12107. return r.LINEAR_MIPMAP_NEAREST;
  12108. if (e === n.LinearMipMapLinearFilter)
  12109. return r.LINEAR_MIPMAP_LINEAR;
  12110. if (e === n.UnsignedByteType)
  12111. return r.UNSIGNED_BYTE;
  12112. if (e === n.UnsignedShort4444Type)
  12113. return r.UNSIGNED_SHORT_4_4_4_4;
  12114. if (e === n.UnsignedShort5551Type)
  12115. return r.UNSIGNED_SHORT_5_5_5_1;
  12116. if (e === n.UnsignedShort565Type)
  12117. return r.UNSIGNED_SHORT_5_6_5;
  12118. if (e === n.ByteType)
  12119. return r.BYTE;
  12120. if (e === n.ShortType)
  12121. return r.SHORT;
  12122. if (e === n.UnsignedShortType)
  12123. return r.UNSIGNED_SHORT;
  12124. if (e === n.IntType)
  12125. return r.INT;
  12126. if (e === n.UnsignedIntType)
  12127. return r.UNSIGNED_INT;
  12128. if (e === n.FloatType)
  12129. return r.FLOAT;
  12130. if (t = i.get("OES_texture_half_float"),
  12131. null !== t && e === n.HalfFloatType)
  12132. return t.HALF_FLOAT_OES;
  12133. if (e === n.AlphaFormat)
  12134. return r.ALPHA;
  12135. if (e === n.RGBFormat)
  12136. return r.RGB;
  12137. if (e === n.RGBAFormat)
  12138. return r.RGBA;
  12139. if (e === n.LuminanceFormat)
  12140. return r.LUMINANCE;
  12141. if (e === n.LuminanceAlphaFormat)
  12142. return r.LUMINANCE_ALPHA;
  12143. if (e === n.AddEquation)
  12144. return r.FUNC_ADD;
  12145. if (e === n.SubtractEquation)
  12146. return r.FUNC_SUBTRACT;
  12147. if (e === n.ReverseSubtractEquation)
  12148. return r.FUNC_REVERSE_SUBTRACT;
  12149. if (e === n.ZeroFactor)
  12150. return r.ZERO;
  12151. if (e === n.OneFactor)
  12152. return r.ONE;
  12153. if (e === n.SrcColorFactor)
  12154. return r.SRC_COLOR;
  12155. if (e === n.OneMinusSrcColorFactor)
  12156. return r.ONE_MINUS_SRC_COLOR;
  12157. if (e === n.SrcAlphaFactor)
  12158. return r.SRC_ALPHA;
  12159. if (e === n.OneMinusSrcAlphaFactor)
  12160. return r.ONE_MINUS_SRC_ALPHA;
  12161. if (e === n.DstAlphaFactor)
  12162. return r.DST_ALPHA;
  12163. if (e === n.OneMinusDstAlphaFactor)
  12164. return r.ONE_MINUS_DST_ALPHA;
  12165. if (e === n.DstColorFactor)
  12166. return r.DST_COLOR;
  12167. if (e === n.OneMinusDstColorFactor)
  12168. return r.ONE_MINUS_DST_COLOR;
  12169. if (e === n.SrcAlphaSaturateFactor)
  12170. return r.SRC_ALPHA_SATURATE;
  12171. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12172. null !== t) {
  12173. if (e === n.RGB_S3TC_DXT1_Format)
  12174. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12175. if (e === n.RGBA_S3TC_DXT1_Format)
  12176. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12177. if (e === n.RGBA_S3TC_DXT3_Format)
  12178. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12179. if (e === n.RGBA_S3TC_DXT5_Format)
  12180. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12181. }
  12182. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12183. null !== t) {
  12184. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12185. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12186. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12187. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12188. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12189. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12190. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12191. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12192. }
  12193. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12194. null !== t && e === n.RGB_ETC1_Format)
  12195. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12196. if (t = i.get("EXT_blend_minmax"),
  12197. null !== t) {
  12198. if (e === n.MinEquation)
  12199. return t.MIN_EXT;
  12200. if (e === n.MaxEquation)
  12201. return t.MAX_EXT
  12202. }
  12203. return 0
  12204. }
  12205. ,
  12206. n.WebGLState = function(e, t, i) {
  12207. var r = this
  12208. , o = new n.Vector4
  12209. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12210. , s = new Uint8Array(a)
  12211. , l = new Uint8Array(a)
  12212. , c = new Uint8Array(a)
  12213. , h = {}
  12214. , u = null
  12215. , d = null
  12216. , p = null
  12217. , f = null
  12218. , g = null
  12219. , m = null
  12220. , v = null
  12221. , A = null
  12222. , y = !1
  12223. , C = null
  12224. , I = null
  12225. , E = null
  12226. , b = null
  12227. , w = null
  12228. , _ = null
  12229. , T = null
  12230. , x = null
  12231. , S = null
  12232. , M = null
  12233. , R = null
  12234. , P = null
  12235. , O = null
  12236. , L = null
  12237. , D = null
  12238. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12239. , B = void 0
  12240. , F = {}
  12241. , V = new n.Vector4
  12242. , U = null
  12243. , k = null
  12244. , H = new n.Vector4
  12245. , G = new n.Vector4;
  12246. this.init = function() {
  12247. this.clearColor(0, 0, 0, 1),
  12248. this.clearDepth(1),
  12249. this.clearStencil(0),
  12250. this.enable(e.DEPTH_TEST),
  12251. e.depthFunc(e.LEQUAL),
  12252. e.frontFace(e.CCW),
  12253. e.cullFace(e.BACK),
  12254. this.enable(e.CULL_FACE),
  12255. this.enable(e.BLEND),
  12256. e.blendEquation(e.FUNC_ADD),
  12257. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12258. }
  12259. ,
  12260. this.initAttributes = function() {
  12261. for (var e = 0, t = s.length; e < t; e++)
  12262. s[e] = 0
  12263. }
  12264. ,
  12265. this.enableAttribute = function(i) {
  12266. if (s[i] = 1,
  12267. 0 === l[i] && (e.enableVertexAttribArray(i),
  12268. l[i] = 1),
  12269. 0 !== c[i]) {
  12270. var n = t.get("ANGLE_instanced_arrays");
  12271. n.vertexAttribDivisorANGLE(i, 0),
  12272. c[i] = 0
  12273. }
  12274. }
  12275. ,
  12276. this.enableAttributeAndDivisor = function(t, i, n) {
  12277. s[t] = 1,
  12278. 0 === l[t] && (e.enableVertexAttribArray(t),
  12279. l[t] = 1),
  12280. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12281. c[t] = i)
  12282. }
  12283. ,
  12284. this.disableUnusedAttributes = function() {
  12285. for (var t = 0, i = l.length; t < i; t++)
  12286. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12287. l[t] = 0)
  12288. }
  12289. ,
  12290. this.enable = function(t) {
  12291. h[t] !== !0 && (e.enable(t),
  12292. h[t] = !0)
  12293. }
  12294. ,
  12295. this.disable = function(t) {
  12296. h[t] !== !1 && (e.disable(t),
  12297. h[t] = !1)
  12298. }
  12299. ,
  12300. this.getCompressedTextureFormats = function() {
  12301. if (null === u && (u = [],
  12302. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12303. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12304. u.push(i[n]);
  12305. return u
  12306. }
  12307. ,
  12308. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12309. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12310. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12311. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12312. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12313. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12314. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12315. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12316. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12317. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12318. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12319. d = t,
  12320. y = h),
  12321. t === n.CustomBlending ? (s = s || r,
  12322. l = l || o,
  12323. c = c || a,
  12324. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12325. p = r,
  12326. m = s),
  12327. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12328. f = o,
  12329. g = a,
  12330. v = l,
  12331. A = c)) : (p = null,
  12332. f = null,
  12333. g = null,
  12334. m = null,
  12335. v = null,
  12336. A = null)
  12337. }
  12338. ,
  12339. this.setDepthFunc = function(t) {
  12340. if (C !== t) {
  12341. if (t)
  12342. switch (t) {
  12343. case n.NeverDepth:
  12344. e.depthFunc(e.NEVER);
  12345. break;
  12346. case n.AlwaysDepth:
  12347. e.depthFunc(e.ALWAYS);
  12348. break;
  12349. case n.LessDepth:
  12350. e.depthFunc(e.LESS);
  12351. break;
  12352. case n.LessEqualDepth:
  12353. e.depthFunc(e.LEQUAL);
  12354. break;
  12355. case n.EqualDepth:
  12356. e.depthFunc(e.EQUAL);
  12357. break;
  12358. case n.GreaterEqualDepth:
  12359. e.depthFunc(e.GEQUAL);
  12360. break;
  12361. case n.GreaterDepth:
  12362. e.depthFunc(e.GREATER);
  12363. break;
  12364. case n.NotEqualDepth:
  12365. e.depthFunc(e.NOTEQUAL);
  12366. break;
  12367. default:
  12368. e.depthFunc(e.LEQUAL)
  12369. }
  12370. else
  12371. e.depthFunc(e.LEQUAL);
  12372. C = t
  12373. }
  12374. }
  12375. ,
  12376. this.setDepthTest = function(t) {
  12377. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12378. }
  12379. ,
  12380. this.setDepthWrite = function(t) {
  12381. I !== t && (e.depthMask(t),
  12382. I = t)
  12383. }
  12384. ,
  12385. this.setColorWrite = function(t) {
  12386. E !== t && (e.colorMask(t, t, t, t),
  12387. E = t)
  12388. }
  12389. ,
  12390. this.setStencilFunc = function(t, i, n) {
  12391. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12392. w = t,
  12393. _ = i,
  12394. T = n)
  12395. }
  12396. ,
  12397. this.setStencilOp = function(t, i, n) {
  12398. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12399. x = t,
  12400. S = i,
  12401. M = n)
  12402. }
  12403. ,
  12404. this.setStencilTest = function(t) {
  12405. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12406. }
  12407. ,
  12408. this.setStencilWrite = function(t) {
  12409. b !== t && (e.stencilMask(t),
  12410. b = t)
  12411. }
  12412. ,
  12413. this.setFlipSided = function(t) {
  12414. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12415. R = t)
  12416. }
  12417. ,
  12418. this.setLineWidth = function(t) {
  12419. t !== P && (e.lineWidth(t),
  12420. P = t)
  12421. }
  12422. ,
  12423. this.setPolygonOffset = function(t, i, n) {
  12424. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12425. !t || O === i && L === n || (e.polygonOffset(i, n),
  12426. O = i,
  12427. L = n)
  12428. }
  12429. ,
  12430. this.getScissorTest = function() {
  12431. return D
  12432. }
  12433. ,
  12434. this.setScissorTest = function(t) {
  12435. D = t,
  12436. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12437. }
  12438. ,
  12439. this.activeTexture = function(t) {
  12440. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12441. B !== t && (e.activeTexture(t),
  12442. B = t)
  12443. }
  12444. ,
  12445. this.bindTexture = function(t, i) {
  12446. void 0 === B && r.activeTexture();
  12447. var n = F[B];
  12448. void 0 === n && (n = {
  12449. type: void 0,
  12450. texture: void 0
  12451. },
  12452. F[B] = n),
  12453. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12454. n.type = t,
  12455. n.texture = i)
  12456. }
  12457. ,
  12458. this.compressedTexImage2D = function() {
  12459. try {
  12460. e.compressedTexImage2D.apply(e, arguments)
  12461. } catch (e) {
  12462. console.error(e)
  12463. }
  12464. }
  12465. ,
  12466. this.texImage2D = function() {
  12467. try {
  12468. e.texImage2D.apply(e, arguments)
  12469. } catch (e) {
  12470. console.error(e)
  12471. }
  12472. }
  12473. ,
  12474. this.clearColor = function(t, i, n, r) {
  12475. o.set(t, i, n, r),
  12476. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12477. V.copy(o))
  12478. }
  12479. ,
  12480. this.clearDepth = function(t) {
  12481. U !== t && (e.clearDepth(t),
  12482. U = t)
  12483. }
  12484. ,
  12485. this.clearStencil = function(t) {
  12486. k !== t && (e.clearStencil(t),
  12487. k = t)
  12488. }
  12489. ,
  12490. this.scissor = function(t) {
  12491. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12492. H.copy(t))
  12493. }
  12494. ,
  12495. this.viewport = function(t) {
  12496. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12497. G.copy(t))
  12498. }
  12499. ,
  12500. this.reset = function() {
  12501. for (var t = 0; t < l.length; t++)
  12502. 1 === l[t] && (e.disableVertexAttribArray(t),
  12503. l[t] = 0);
  12504. h = {},
  12505. u = null,
  12506. B = void 0,
  12507. F = {},
  12508. d = null,
  12509. E = null,
  12510. I = null,
  12511. b = null,
  12512. R = null
  12513. }
  12514. }
  12515. }
  12516. , {
  12517. three: 217
  12518. }],
  12519. 104: [function(e, t, i) {
  12520. (function(i, n) {
  12521. "use strict";
  12522. function r(e) {
  12523. this.urls = e;
  12524. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12525. this.builder = a.loadProto(t),
  12526. this.decoder = this.builder.build("binary_mesh")
  12527. }
  12528. var o = e("three")
  12529. , a = e("protobufjs")
  12530. , s = e("../util/logger")
  12531. , l = (e("../util/common"),
  12532. e("../util/ajax"))
  12533. , c = e("../objects/Chunk")
  12534. , h = new s(n);
  12535. r.prototype = {
  12536. constructor: r,
  12537. load: function(e, t, i, n) {
  12538. return h.time("download"),
  12539. l.get(e, {
  12540. responseType: "arraybuffer"
  12541. }).done(function(r) {
  12542. h.timeEnd("download"),
  12543. this.parse(r, e, t, i, n)
  12544. }
  12545. .bind(this)).fail(n)
  12546. },
  12547. parse: function(e, t, i, n, r) {
  12548. var o = this.readProtobuf(e);
  12549. if (!o)
  12550. return r();
  12551. try {
  12552. h.time("convert to webgl"),
  12553. this.convertProtobufToSceneObject(o, t, i, n, r),
  12554. h.timeEnd("convert to webgl")
  12555. } catch (e) {
  12556. return h.error("failed parsing .dam"),
  12557. h.error(e.message),
  12558. r()
  12559. }
  12560. },
  12561. readProtobuf: function(e) {
  12562. var t;
  12563. try {
  12564. h.time("parse proto"),
  12565. t = this.decoder.decode(e),
  12566. h.timeEnd("parse proto")
  12567. } catch (e) {
  12568. return h.error("failed parsing proto for .dam"),
  12569. h.error(e.message),
  12570. null
  12571. }
  12572. return t
  12573. },
  12574. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12575. function a(e) {
  12576. var i = new o.BufferGeometry;
  12577. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12578. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12579. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12580. i.applyMatrix(s),
  12581. i.computeBoundingBox(),
  12582. new c({
  12583. geometry: i,
  12584. textureName: e.material_name,
  12585. name: e.chunk_name,
  12586. meshUrl: t
  12587. })
  12588. }
  12589. if (0 === e.chunk.length)
  12590. return h.warn("No chunks in damfile..."),
  12591. i([]);
  12592. var s = new o.Matrix4;
  12593. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12594. var l = e.chunk.map(a);
  12595. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12596. r())
  12597. }
  12598. },
  12599. t.exports = r
  12600. }
  12601. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12602. }
  12603. , {
  12604. "../objects/Chunk": 144,
  12605. "../util/ajax": 181,
  12606. "../util/common": 185,
  12607. "../util/logger": 189,
  12608. buffer: 198,
  12609. protobufjs: 214,
  12610. three: 217
  12611. }],
  12612. 105: [function(e, t, i) {
  12613. (function(i) {
  12614. "use strict";
  12615. var n = (e("three"),
  12616. e("../settings"),
  12617. e("../util/browser"),
  12618. e("./DamLoader"))
  12619. , r = e("../util/logger")
  12620. , o = (e("../ab"),
  12621. new r(i));
  12622. t.exports = {
  12623. getLoaders: function() {
  12624. return [["_50k", ".dam", n], ["", ".dam", n]]
  12625. },
  12626. load: function(e, t, i, n, r, a) {
  12627. var s = this.getLoaders();
  12628. a = a || 0;
  12629. var l = s[a];
  12630. if (!l)
  12631. return void (r && r("No suitable model file found..."));
  12632. var c = l[0]
  12633. , h = l[1]
  12634. , u = new l[2](t)
  12635. , d = t.get(e + c + h);
  12636. d ? (o.debug("Trying " + c + h),
  12637. u.load(d, i, n, function() {
  12638. this.load(e, t, i, n, r, ++a)
  12639. }
  12640. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12641. this.load(e, t, i, n, r, ++a))
  12642. }
  12643. }
  12644. }
  12645. ).call(this, "/js/loaders/ModelLoader.js")
  12646. }
  12647. , {
  12648. "../ab": 3,
  12649. "../settings": 166,
  12650. "../util/browser": 182,
  12651. "../util/logger": 189,
  12652. "./DamLoader": 104,
  12653. three: 217
  12654. }],
  12655. 106: [function(e, t, i) {
  12656. (function(i) {
  12657. "use strict";
  12658. var n = e("../util/common")
  12659. , r = e("../util/texture")
  12660. , o = e("../util/browser")
  12661. , a = e("../util/logger")
  12662. , s = e("../settings")
  12663. , l = new a(i);
  12664. t.exports = {
  12665. load: function(e, t) {
  12666. function i(e, i) {
  12667. e || (t.push(i),
  12668. p++,
  12669. d.notify(p, a),
  12670. p === a && d.resolve())
  12671. }
  12672. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12673. return $.when();
  12674. var a = n.countUnique(e.chunks.map(function(e) {
  12675. return e.textureName
  12676. }))
  12677. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12678. , h = "_50k" === c ? "high" : "low";
  12679. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12680. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12681. h = "low"));
  12682. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12683. , d = $.Deferred()
  12684. , p = 0;
  12685. return e.chunks.forEach(function(t) {
  12686. if (!t.material.map && t.textureName) {
  12687. var n = e.urls.get(u + t.textureName);
  12688. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12689. }
  12690. }),
  12691. d.promise()
  12692. }
  12693. }
  12694. }
  12695. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12696. }
  12697. , {
  12698. "../settings": 166,
  12699. "../util/browser": 182,
  12700. "../util/common": 185,
  12701. "../util/logger": 189,
  12702. "../util/texture": 194
  12703. }],
  12704. 107: [function(e, t, i) {
  12705. (function(i, n) {
  12706. "use strict";
  12707. function r(e) {
  12708. this.model = e,
  12709. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12710. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12711. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12712. , n = o.loadProto(t);
  12713. this.decoder = n.build("VisionModeldata")
  12714. }
  12715. var o = e("protobufjs")
  12716. , a = e("../util/ajax")
  12717. , s = (e("../util/common"),
  12718. e("../util/math"))
  12719. , l = e("../util/logger")
  12720. , c = new l(n);
  12721. r.prototype.load = function() {
  12722. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12723. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12724. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12725. $.when([]))
  12726. }
  12727. ,
  12728. r.prototype.loadVisionModelData = function() {
  12729. return a.get(this.modelDataPath, {
  12730. responseType: "arraybuffer"
  12731. }).then(function(e) {
  12732. var t;
  12733. try {
  12734. t = this.decoder.decode(e)
  12735. } catch (e) {
  12736. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12737. this.loadSweepLocationsCSV()
  12738. }
  12739. var i = t.sweepLocations.map(function(e) {
  12740. return {
  12741. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12742. position: {
  12743. x: e.pose.translation.x,
  12744. y: e.pose.translation.y,
  12745. z: e.pose.translation.z
  12746. },
  12747. quaternion: {
  12748. x: e.pose.rotation.x,
  12749. y: e.pose.rotation.y,
  12750. z: e.pose.rotation.z,
  12751. w: e.pose.rotation.w
  12752. },
  12753. puck: {
  12754. x: e.puck.x,
  12755. y: e.puck.y,
  12756. z: e.puck.z
  12757. },
  12758. floor: e.group,
  12759. neighbours: e.visibles,
  12760. alignmentType: e.alignment_type
  12761. }
  12762. }).map(function(e) {
  12763. return e.position = s.convertVisionVector(e.position),
  12764. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12765. e.puck = s.convertVisionVector(e.puck),
  12766. e
  12767. });
  12768. return i.forEach(function(e) {
  12769. e.neighbours = e.neighbours.map(function(e) {
  12770. return i[e].uuid
  12771. })
  12772. }),
  12773. i
  12774. }
  12775. .bind(this), function() {
  12776. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12777. this.loadSweepLocationsCSV()
  12778. }
  12779. .bind(this))
  12780. }
  12781. ,
  12782. r.prototype.loadSweepLocationsCSV = function() {
  12783. return a.get(this.sweepLocationsPath).then(function(e) {
  12784. var t = e.split("\n").map(function(e) {
  12785. return e.split(", ")
  12786. }).filter(function(e) {
  12787. return e.length > 1
  12788. }).map(function(e) {
  12789. return {
  12790. uuid: e[0],
  12791. position: {
  12792. x: parseFloat(e[1]),
  12793. y: parseFloat(e[2]),
  12794. z: parseFloat(e[3])
  12795. },
  12796. quaternion: {
  12797. x: parseFloat(e[4]),
  12798. y: parseFloat(e[5]),
  12799. z: parseFloat(e[6]),
  12800. w: parseFloat(e[7])
  12801. }
  12802. }
  12803. }).map(function(e) {
  12804. return e.position = s.convertVisionVector(e.position),
  12805. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12806. e
  12807. });
  12808. return t
  12809. }).fail(function() {
  12810. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12811. })
  12812. }
  12813. ,
  12814. t.exports = r
  12815. }
  12816. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12817. }
  12818. , {
  12819. "../util/ajax": 181,
  12820. "../util/common": 185,
  12821. "../util/logger": 189,
  12822. "../util/math": 190,
  12823. buffer: 198,
  12824. protobufjs: 214
  12825. }],
  12826. 108: [function(e, t, i) {
  12827. (function(i) {
  12828. "use strict";
  12829. function n() {
  12830. this.locale = null
  12831. }
  12832. var r = e("../settings")
  12833. , o = e("../util/common")
  12834. , a = e("../util/logger")
  12835. , s = e("../enum/Locale")
  12836. , l = new a(i);
  12837. n.prototype.init = function() {
  12838. var t;
  12839. switch (r.languageTag) {
  12840. case null:
  12841. case "en":
  12842. case s.EN_US:
  12843. this.locale = s.EN_US,
  12844. t = e("./strings-en-US");
  12845. break;
  12846. case "es":
  12847. case s.ES_MX:
  12848. this.locale = s.ES_MX,
  12849. t = e("./strings-es-MX");
  12850. break;
  12851. case "fr":
  12852. case s.FR_FR:
  12853. this.locale = s.FR_FR,
  12854. t = e("./strings-fr-FR");
  12855. break;
  12856. case "de":
  12857. case s.DE_DE:
  12858. this.locale = s.DE_DE,
  12859. t = e("./strings-de-DE");
  12860. break;
  12861. case "ru":
  12862. case s.RU_RU:
  12863. this.locale = s.RU_RU,
  12864. t = e("./strings-ru-RU");
  12865. break;
  12866. case "cn":
  12867. case s.CN_CN:
  12868. this.locale = s.CN_CN,
  12869. t = e("./strings-cn-CN");
  12870. break;
  12871. case "jp":
  12872. case s.JP_JP:
  12873. this.locale = s.JP_JP,
  12874. t = e("./strings-jp-JP");
  12875. break;
  12876. default:
  12877. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12878. this.locale = s.EN_US,
  12879. t = e("./strings-en-US")
  12880. }
  12881. l.info("Using locale '" + this.locale + "'"),
  12882. o.extendObject(this, t)
  12883. }
  12884. ,
  12885. n.prototype.localizeGUI = function() {
  12886. var e = document.querySelector("#gui-parent");
  12887. this.localizeTree(e),
  12888. this.localizeLoadingText()
  12889. }
  12890. ,
  12891. n.prototype.localizeLoadingText = function() {
  12892. // var e = document.querySelector("#loader-cont")
  12893. // , t = e.getAttribute("title");
  12894. // e.removeAttribute("title"),
  12895. // e.setAttribute("data-status", t),
  12896. // e.classList.add(this.locale),
  12897. document.querySelector("#help-dialog").classList.add(this.locale),
  12898. document.querySelector("#interaction-modal").classList.add(this.locale),
  12899. document.querySelector("#gui").classList.add(this.locale);
  12900. }
  12901. ,
  12902. n.prototype.localizeTree = function(e) {
  12903. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12904. if (e.nodeType === Node.TEXT_NODE)
  12905. t = e.data.match(n),
  12906. t && (i = t[1],
  12907. e.data = this.localizeText(i) || i);
  12908. else if (e.nodeType === Node.ELEMENT_NODE) {
  12909. var r = e.getAttribute("title");
  12910. r && (t = r.match(n),
  12911. t && (i = t[1],
  12912. e.setAttribute("title", this.localizeText(i) || i)))
  12913. }
  12914. for (e = e.firstChild; e; )
  12915. this.localizeTree(e),
  12916. e = e.nextSibling
  12917. }
  12918. ,
  12919. n.prototype.localizeText = function(t) {
  12920. var i = this[t];
  12921. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12922. i = e("./strings-en-US")[t]),
  12923. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12924. i
  12925. }
  12926. ,
  12927. t.exports = new n
  12928. }
  12929. ).call(this, "/js/localization/localize.js")
  12930. }
  12931. , {
  12932. "../enum/Locale": 31,
  12933. "../settings": 166,
  12934. "../util/common": 185,
  12935. "../util/logger": 189,
  12936. "./strings-cn-CN": 109,
  12937. "./strings-de-DE": 110,
  12938. "./strings-en-US": 111,
  12939. "./strings-es-MX": 112,
  12940. "./strings-fr-FR": 113,
  12941. "./strings-jp-JP": 114,
  12942. "./strings-ru-RU": 115
  12943. }],
  12944. 109: [function(e, t, i) {
  12945. "use strict";
  12946. t.exports = {
  12947. PAGE_TITLE: "",
  12948. LOADING: "正在加载",
  12949. PRESENTED_BY_CAPS: "呈现者:",
  12950. POWERED_BY: "技术支持:",
  12951. POWERED_BY_CAPS: "技术支持:",
  12952. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12953. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12954. PRESENTED_BY: "呈现者:",
  12955. MORE: "更多 ",
  12956. LESS: "更少 ",
  12957. TAG_CONTENT: "tag™ 内容",
  12958. SHOW: "显示",
  12959. HIDE: "隐藏",
  12960. DOLLHOUSE: "场景屋",
  12961. FLOOR_PLAN: "楼层平面图",
  12962. OPEN_HIGHLIGHTS: "打开精彩片段",
  12963. CLOSE_HIGHLIGHTS: "关闭",
  12964. PREVIOUS: "上一个",
  12965. PLAY: "播放",
  12966. PAUSE: "暂停",
  12967. NEXT: "下一个",
  12968. EXPLORE_3D_SPACE: "探索 3D 空间",
  12969. VIEW_DOLLHOUSE: "观看场景屋",
  12970. SOCIAL_SHARING: "分享这个空间",
  12971. VIEW_IN_VR: "以 VR 观看",
  12972. VIEW_FULLSCREEN: "全屏观看",
  12973. EXIT_FULLSCREEN: " 退出全屏",
  12974. ZOOM_IN: "放大",
  12975. ZOOM_OUT: "缩小",
  12976. FLOOR_NAME: "楼层",
  12977. FLOOR_ALL: "ALL",
  12978. FLOOR_Lang: ["Floor",""],
  12979. TERMS: "条款",
  12980. PORT_TERMS: "port 条款",
  12981. TERMS_OF_USE: "使用条款",
  12982. CLOSE_TERMS: "关闭",
  12983. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12984. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12985. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12986. WEBVR_ENTER_WEBVR: "进入 VR",
  12987. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12988. WEBVR_LEARN_MORE: "了解更多",
  12989. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12990. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12991. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12992. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12993. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12994. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12995. VR_LEARN_MORE_CAPS: "了解更多",
  12996. VR_PREVIOUS_CAPS: "上一个’,",
  12997. VR_NEXT_CAPS: "下一个",
  12998. VR_GOT_IT_CAPS: "明白了",
  12999. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13000. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13001. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13002. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13003. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13004. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13005. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13006. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13007. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13008. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13009. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13010. VR_APP: "port VR 应用程序",
  13011. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13012. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13013. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13014. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13015. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13016. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13017. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13018. VR_ANDROID_DVICES: "Android 设备",
  13019. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13020. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13021. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13022. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13023. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13024. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13025. VR_DOWNLOAD_HERE: "在此下载",
  13026. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13027. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13028. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13029. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13030. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13031. SHARE_TO: "分享到",
  13032. SHARE_LINK: "直接链接",
  13033. SHARE_EXPLORE: "探索",
  13034. SHARE_AT: "在",
  13035. SHARE_WITH: "使用",
  13036. SHARE_3D: "以 3D",
  13037. SHARE_COPIED: "已复制!",
  13038. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13039. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13040. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13041. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13042. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13043. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13044. ERROR_GENERIC_ACTIONS_3: " 或",
  13045. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13046. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13047. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13048. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13049. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13050. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13051. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13052. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13053. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13054. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13055. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13056. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13057. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13058. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13059. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13060. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13061. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13062. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13063. LINK_TO_LOCATION: "地点链接",
  13064. MENU_COPY: "复制",
  13065. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13066. ROTATE: "旋转",
  13067. MOVE: "移动",
  13068. INSIDE: "内部",
  13069. ZOOM: "缩放",
  13070. HELP: "小帮手",
  13071. HELP_NAVIGATION_TAB: "导航",
  13072. HELP_MORE_HELP_TAB: "更多帮助",
  13073. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13074. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13075. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13076. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13077. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13078. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13079. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13080. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13081. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13082. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13083. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13084. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13085. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13086. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13087. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13088. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13089. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13090. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13091. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13092. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13093. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13094. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13095. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13096. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13097. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13098. HELP_MORE_HLR_A: "精彩片段集锦",
  13099. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13100. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13101. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13102. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13103. HELP_MORE_FLOORS_A: "楼层选择器",
  13104. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13105. HELP_MORE_TAG_A: "tag™ 贴文",
  13106. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13107. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13108. HELP_MORE_ZOOM_A: "缩放控件",
  13109. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13110. HELP_MORE_TOUR_A: "导览控件",
  13111. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13112. HELP_MORE_INSIDE_A: "内部视图",
  13113. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13114. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13115. HELP_MORE_VR_A: "VR 模式",
  13116. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13117. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13118. HELP_MORE_360_A: "360° 视图",
  13119. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13120. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13121. HELP_MORE_FULLSCREEN_A: "全屏",
  13122. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13123. CLOSE: "关闭"
  13124. }
  13125. }
  13126. , {}],
  13127. 110: [function(e, t, i) {
  13128. "use strict";
  13129. t.exports = {
  13130. PAGE_TITLE: "",
  13131. LOADING: "Lädt",
  13132. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13133. POWERED_BY: "Angetrieben von",
  13134. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13135. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13136. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13137. PRESENTED_BY: "Präsentiert von ",
  13138. MORE: "Mehr ",
  13139. LESS: "Weniger ",
  13140. TAG_CONTENT: "tag™ Inhalt",
  13141. SHOW: "Anzeigen",
  13142. HIDE: "Verbergen",
  13143. DOLLHOUSE: "Puppenhaus",
  13144. FLOOR_PLAN: "Grundriss",
  13145. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13146. CLOSE_HIGHLIGHTS: "Schließen",
  13147. PREVIOUS: "Vorheriges",
  13148. PLAY: "Abspielen",
  13149. PAUSE: "Pausieren",
  13150. NEXT: "Nächstes",
  13151. EXPLORE_3D_SPACE: "Innenraum betreten",
  13152. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13153. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13154. VIEW_IN_VR: "In VR ansehen",
  13155. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13156. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13157. ZOOM_IN: "Vergrößern",
  13158. ZOOM_OUT: "Verkleinern",
  13159. FLOOR_NAME: "Etage ",
  13160. FLOOR_ALL: "Alle",
  13161. TERMS: "Bedingungen",
  13162. PORT_TERMS: "port Bedingungen",
  13163. TERMS_OF_USE: "Nutzungsbedingungen",
  13164. TERMS_TEXT_FILE: "terms-de-DE.html",
  13165. CLOSE_TERMS: "Schließen",
  13166. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13167. HELP: "Hilfe",
  13168. HELP_NAVIGATION_TAB: "Navigation",
  13169. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13170. CLOSE: "Schließen",
  13171. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13172. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13173. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13174. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13175. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13176. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13177. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13178. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13179. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13180. 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.",
  13181. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13182. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13183. 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.",
  13184. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13185. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13186. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13187. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13188. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13189. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13190. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13191. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13192. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13193. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13194. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13195. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13196. HELP_MORE_HLR_A: "Liste das Highlight",
  13197. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13198. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13199. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13200. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13201. HELP_MORE_FLOORS_A: "Etage auswählen",
  13202. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13203. HELP_MORE_TAG_A: "tag™ Posts",
  13204. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13205. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13206. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13207. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13208. HELP_MORE_TOUR_A: "Tour Steuerung",
  13209. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13210. HELP_MORE_INSIDE_A: "Innenansicht",
  13211. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13212. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13213. HELP_MORE_VR_A: "VR Modus",
  13214. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13215. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13216. HELP_MORE_360_A: "360° Views Ansicht ",
  13217. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13218. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13219. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13220. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13221. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13222. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13223. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13224. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13225. WEBVR_LEARN_MORE: "Mehr Infos",
  13226. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13227. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13228. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13229. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13230. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13231. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13232. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13233. VR_APP: "port VR App",
  13234. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13235. 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",
  13236. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13237. VR_APP_FOR_ANDROID: "port VR app für Android",
  13238. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13239. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13240. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13241. VR_PREVIOUS_CAPS: "ZURÜCK",
  13242. VR_NEXT_CAPS: "WEITER",
  13243. VR_GOT_IT_CAPS: "VERSTANDEN",
  13244. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13245. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13246. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13247. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13248. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13249. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13250. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13251. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13252. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13253. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13254. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13255. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13256. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13257. VR_ANDROID_DVICES: "Android Geräte",
  13258. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13259. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13260. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13261. VR_DOWNLOAD_HERE: "Hier runterladen",
  13262. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13263. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13264. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13265. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13266. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13267. SHARE_TO: "Teilen auf",
  13268. SHARE_LINK: "Direkter Link",
  13269. SHARE_EXPLORE: "Umsehen",
  13270. SHARE_AT: "auf",
  13271. SHARE_WITH: "mit",
  13272. SHARE_3D: "in 3D",
  13273. SHARE_COPIED: "Kopiert!",
  13274. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13275. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13276. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13277. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13278. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13279. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13280. ERROR_GENERIC_ACTIONS_3: " oder ",
  13281. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13282. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13283. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13284. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13285. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13286. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13287. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13288. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13289. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13290. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13291. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13292. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13293. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13294. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13295. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13296. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13297. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13298. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13299. LINK_TO_LOCATION: "Link zu",
  13300. MENU_COPY: "Kopieren",
  13301. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13302. ROTATE: "Drehen",
  13303. INSIDE: "Drinnen",
  13304. MOVE: "Bewegen",
  13305. ZOOM: "Vergrößern"
  13306. }
  13307. }
  13308. , {}],
  13309. 111: [function(e, t, i) {
  13310. "use strict";
  13311. t.exports = {
  13312. PAGE_TITLE: "",
  13313. LOADING: "Loading",
  13314. PRESENTED_BY_CAPS: "PRESENTED BY",
  13315. POWERED_BY: "powered by ",
  13316. POWERED_BY_CAPS: "POWERED BY",
  13317. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13318. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13319. PRESENTED_BY: "Presented by ",
  13320. MORE: "More ",
  13321. LESS: "Less ",
  13322. TAG_CONTENT: "tag™ Content",
  13323. SHOW: "Show",
  13324. HIDE: "Hide",
  13325. DOLLHOUSE: "Dollhouse",
  13326. FLOOR_PLAN: "Floor plan",
  13327. OPEN_HIGHLIGHTS: "Open Highlights",
  13328. CLOSE_HIGHLIGHTS: "Close",
  13329. PREVIOUS: "Previous",
  13330. PLAY: "Play",
  13331. PAUSE: "Pause",
  13332. NEXT: "Next",
  13333. EXPLORE_3D_SPACE: "Explore 3D Space",
  13334. VIEW_DOLLHOUSE: "View dollhouse",
  13335. SOCIAL_SHARING: "Share this Space",
  13336. VIEW_IN_VR: "View in VR",
  13337. VIEW_FULLSCREEN: "全屏",
  13338. EXIT_FULLSCREEN: "退出全屏",
  13339. ZOOM_IN: "Zoom in",
  13340. ZOOM_OUT: "Zoom out",
  13341. FLOOR_NAME: "Floor ",
  13342. FLOOR_ALL: "全部",
  13343. TERMS: "Terms",
  13344. PORT_TERMS: "port terms",
  13345. TERMS_OF_USE: "Terms of Use",
  13346. TERMS_TEXT_FILE: "terms-en-US.html",
  13347. CLOSE_TERMS: "Close",
  13348. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13349. HELP: "Help",
  13350. HELP_NAVIGATION_TAB: "Navigation",
  13351. HELP_MORE_HELP_TAB: "More Help",
  13352. CLOSE: "Close",
  13353. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13354. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13355. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13356. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13357. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13358. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13359. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13360. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13361. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13362. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13363. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13364. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13365. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13366. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13367. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13368. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13369. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13370. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13371. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13372. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13373. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13374. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13375. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13376. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13377. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13378. HELP_MORE_HLR_A: "Highlight Reel",
  13379. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13380. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13381. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13382. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13383. HELP_MORE_FLOORS_A: "Floor Selector",
  13384. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13385. HELP_MORE_TAG_A: "tag™ Posts",
  13386. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13387. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13388. HELP_MORE_ZOOM_A: "Zoom Controls",
  13389. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13390. HELP_MORE_TOUR_A: "Tour Controls",
  13391. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13392. HELP_MORE_INSIDE_A: "Inside View",
  13393. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13394. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13395. HELP_MORE_VR_A: "VR Mode",
  13396. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13397. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13398. HELP_MORE_360_A: "360° Views",
  13399. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13400. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13401. HELP_MORE_FULLSCREEN_A: "Full screen",
  13402. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13403. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13404. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13405. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13406. WEBVR_ENTER_WEBVR: "ENTER VR",
  13407. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13408. WEBVR_LEARN_MORE: "Learn more",
  13409. WEBVR_VIEW_SPACE: "View Space in VR",
  13410. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13411. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13412. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13413. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13414. VR_PREVIOUS_CAPS: "PREVIOUS",
  13415. VR_NEXT_CAPS: "NEXT",
  13416. VR_GOT_IT_CAPS: "GOT IT",
  13417. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13418. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13419. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13420. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13421. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13422. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13423. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13424. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13425. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13426. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13427. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13428. VR_APP: "port VR App",
  13429. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13430. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13431. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13432. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13433. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13434. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13435. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13436. VR_ANDROID_DVICES: "Android Devices",
  13437. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13438. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13439. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13440. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13441. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13442. VR_APP_OPEN: "Open with the port VR app instead",
  13443. VR_DOWNLOAD_HERE: "Download here",
  13444. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13445. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13446. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13447. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13448. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13449. SHARE_TO: "Share to",
  13450. SHARE_LINK: "Direct Link",
  13451. SHARE_EXPLORE: "Explore ",
  13452. SHARE_AT: "at",
  13453. SHARE_WITH: "with",
  13454. SHARE_3D: " in 3D",
  13455. SHARE_COPIED: "Copied!",
  13456. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13457. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13458. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13459. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13460. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13461. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13462. ERROR_GENERIC_ACTIONS_3: " or ",
  13463. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13464. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13465. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13466. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13467. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13468. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13469. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13470. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13471. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13472. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13473. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13474. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13475. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13476. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13477. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13478. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13479. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13480. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13481. LINK_TO_LOCATION: "Link to location",
  13482. MENU_COPY: "Copy",
  13483. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13484. ROTATE: "Rotate",
  13485. INSIDE: "Inside",
  13486. MOVE: "Move",
  13487. ZOOM: "Zoom"
  13488. }
  13489. }
  13490. , {}],
  13491. 112: [function(e, t, i) {
  13492. "use strict";
  13493. t.exports = {
  13494. PAGE_TITLE: "",
  13495. LOADING: "Cargando",
  13496. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13497. POWERED_BY: "potenciando por ",
  13498. POWERED_BY_CAPS: "POTENCIADO POR ",
  13499. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13500. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13501. PRESENTED_BY: "Presentado por ",
  13502. MORE: "Más ",
  13503. LESS: "Menos ",
  13504. TAG_CONTENT: "Contenido de tag™",
  13505. SHOW: "Mostrar",
  13506. HIDE: "Ocultar",
  13507. DOLLHOUSE: "Dollhouse",
  13508. FLOOR_PLAN: "Planos",
  13509. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13510. CLOSE_HIGHLIGHTS: "Cerrar",
  13511. PREVIOUS: "Anterior",
  13512. PLAY: "Play",
  13513. PAUSE: "Pausa",
  13514. NEXT: "Siguiente",
  13515. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13516. VIEW_DOLLHOUSE: "Ver dollhouse",
  13517. SOCIAL_SHARING: "Compartir este espacio",
  13518. VIEW_IN_VR: "Ver en realidad virtual",
  13519. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13520. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13521. ZOOM_IN: "Acercar",
  13522. ZOOM_OUT: "Alejar",
  13523. FLOOR_NAME: "Piso ",
  13524. FLOOR_ALL: "Todas",
  13525. TERMS: "Condiciones",
  13526. PORT_TERMS: "port términos de uso",
  13527. TERMS_OF_USE: "Términos de uso",
  13528. TERMS_TEXT_FILE: "terms-es-MX.html",
  13529. CLOSE_TERMS: "Cerrar",
  13530. 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.",
  13531. HELP: "Ayuda",
  13532. HELP_NAVIGATION_TAB: "Navegación",
  13533. HELP_MORE_HELP_TAB: "Más Ayuda",
  13534. CLOSE: "Cerrar",
  13535. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13536. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13537. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13538. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13539. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13540. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13541. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13542. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13543. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13544. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13545. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13546. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13547. 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.",
  13548. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13549. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13550. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13551. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13552. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13553. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13554. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13555. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13556. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13557. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13558. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13559. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13560. HELP_MORE_HLR_A: "Galería destacada",
  13561. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13562. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13563. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13564. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13565. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13566. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13567. HELP_MORE_TAG_A: "tag™ Posts",
  13568. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13569. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13570. HELP_MORE_ZOOM_A: "Controles de zoom",
  13571. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13572. HELP_MORE_TOUR_A: "Controles de recorrido",
  13573. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13574. HELP_MORE_INSIDE_A: "Vista interior",
  13575. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13576. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13577. HELP_MORE_VR_A: "Modo de realidad virtual",
  13578. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13579. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13580. HELP_MORE_360_A: "360° Views",
  13581. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13582. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13583. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13584. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13585. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13586. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13587. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13588. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13589. WEBVR_LEARN_MORE: "Más información",
  13590. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13591. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13592. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13593. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13594. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13595. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13596. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13597. VR_APP: "port VR App",
  13598. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13599. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13600. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13601. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13602. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13603. VR_PREVIOUS_CAPS: "ANTERIOR",
  13604. VR_NEXT_CAPS: "SIGUIENTE",
  13605. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13606. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13607. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13608. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13609. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13610. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13611. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13612. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13613. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13614. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13615. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13616. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13617. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13618. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13619. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13620. VR_ANDROID_DVICES: "Dispositivos Android",
  13621. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13622. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13623. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13624. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13625. VR_DOWNLOAD_HERE: "Descargar aquí",
  13626. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13627. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13628. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13629. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13630. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13631. SHARE_TO: "Compartir en",
  13632. SHARE_LINK: "Enlace directo",
  13633. SHARE_EXPLORE: "Explorar ",
  13634. SHARE_AT: "en",
  13635. SHARE_WITH: "con",
  13636. SHARE_3D: " en 3D",
  13637. SHARE_COPIED: "¡Copiado!",
  13638. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13639. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13640. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13641. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13642. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13643. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13644. ERROR_GENERIC_ACTIONS_3: " o ",
  13645. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13646. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13647. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13648. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13649. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13650. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13651. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13652. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13653. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13654. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13655. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13656. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13657. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13658. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13659. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13660. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13661. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13662. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13663. LINK_TO_LOCATION: "Enlace a la ubicación",
  13664. MENU_COPY: "Copiar",
  13665. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13666. ROTATE: "Girar",
  13667. INSIDE: "Interior",
  13668. MOVE: "Moverse",
  13669. ZOOM: "Acercar o alejar"
  13670. }
  13671. }
  13672. , {}],
  13673. 113: [function(e, t, i) {
  13674. "use strict";
  13675. t.exports = {
  13676. PAGE_TITLE: "",
  13677. LOADING: "Chargement",
  13678. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13679. POWERED_BY: "alimenté par ",
  13680. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13681. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13682. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13683. PRESENTED_BY: "Présenté par ",
  13684. MORE: "Plus ",
  13685. LESS: "Moins ",
  13686. TAG_CONTENT: "Contenu tag™",
  13687. SHOW: "Montrer",
  13688. HIDE: "Cacher",
  13689. DOLLHOUSE: "Dollhouse",
  13690. FLOOR_PLAN: "Plan de sol",
  13691. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13692. CLOSE_HIGHLIGHTS: "Fermer",
  13693. PREVIOUS: "Précédent",
  13694. PLAY: "Lecture",
  13695. PAUSE: "Pause",
  13696. NEXT: "Suivant",
  13697. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13698. VIEW_DOLLHOUSE: "Voir dollhouse",
  13699. SOCIAL_SHARING: "Partager cet espace",
  13700. VIEW_IN_VR: "Voir en VR",
  13701. VIEW_FULLSCREEN: "Plein écran",
  13702. EXIT_FULLSCREEN: "Fermer plein écran",
  13703. ZOOM_IN: "Zoom avant",
  13704. ZOOM_OUT: "Zoom arrière",
  13705. FLOOR_NAME: "Étage ",
  13706. FLOOR_ALL: "Tous",
  13707. TERMS: "Mentions légales",
  13708. PORT_TERMS: "port mentions légales",
  13709. TERMS_OF_USE: "Conditions d'utilisation",
  13710. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13711. CLOSE_TERMS: "Fermer",
  13712. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13713. HELP: "Aide",
  13714. HELP_NAVIGATION_TAB: "Navigation",
  13715. HELP_MORE_HELP_TAB: "Aide",
  13716. CLOSE: "Fermer",
  13717. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13718. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13719. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13720. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13721. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13722. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13723. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13724. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13725. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13726. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13727. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13728. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13729. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13730. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13731. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13732. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13733. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13734. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13735. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13736. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13737. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13738. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13739. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13740. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13741. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13742. HELP_MORE_HLR_A: "Carrousel",
  13743. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13744. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13745. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13746. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13747. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13748. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13749. HELP_MORE_TAG_A: "tag™ Posts",
  13750. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13751. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13752. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13753. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13754. HELP_MORE_TOUR_A: "Commandes de la visite",
  13755. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13756. HELP_MORE_INSIDE_A: "Vue intérieure",
  13757. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13758. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13759. HELP_MORE_VR_A: "Mode RV",
  13760. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13761. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13762. HELP_MORE_360_A: "Vues 360°",
  13763. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13764. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13765. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13766. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13767. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13768. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13769. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13770. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13771. WEBVR_LEARN_MORE: "En savoir plus",
  13772. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13773. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13774. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13775. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13776. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13777. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13778. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13779. VR_NEXT_CAPS: "SUIVANT",
  13780. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13781. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13782. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13783. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13784. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13785. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13786. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13787. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13788. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13789. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13790. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13791. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13792. VR_APP: "port VR App",
  13793. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13794. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13795. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13796. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13797. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13798. 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",
  13799. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13800. VR_ANDROID_DVICES: "Appareils Android",
  13801. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13802. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13803. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13804. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13805. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13806. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13807. VR_DOWNLOAD_HERE: "Télécharger ici",
  13808. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13809. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13810. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13811. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13812. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13813. SHARE_TO: "Partager sur",
  13814. SHARE_LINK: "Lien direct",
  13815. SHARE_EXPLORE: "Explorer ",
  13816. SHARE_AT: "à",
  13817. SHARE_WITH: "avec",
  13818. SHARE_3D: " en 3D",
  13819. SHARE_COPIED: "Copié!",
  13820. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13821. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13822. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13823. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13824. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13825. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13826. ERROR_GENERIC_ACTIONS_3: " ou ",
  13827. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13828. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13829. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13830. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13831. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13832. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13833. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13834. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13835. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13836. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13837. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13838. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13839. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13840. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13841. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13842. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13843. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13844. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13845. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13846. MENU_COPY: "Copie",
  13847. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13848. ROTATE: "Faire pivoter",
  13849. INSIDE: "Intérieure",
  13850. MOVE: "Se déplacer",
  13851. ZOOM: "Zoom"
  13852. }
  13853. }
  13854. , {}],
  13855. 114: [function(e, t, i) {
  13856. "use strict";
  13857. t.exports = {
  13858. PAGE_TITLE: "",
  13859. LOADING: "読み込み中",
  13860. PRESENTED_BY_CAPS: "PRESENTED BY",
  13861. POWERED_BY: "powered by",
  13862. POWERED_BY_CAPS: "POWERED BY",
  13863. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13864. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13865. PRESENTED_BY: "Presented by ",
  13866. MORE: "全て表示 ",
  13867. LESS: "閉じる ",
  13868. TAG_CONTENT: "tag™コンテンツ ",
  13869. SHOW: "表示",
  13870. HIDE: "非表示",
  13871. DOLLHOUSE: "ドールハウス",
  13872. FLOOR_PLAN: "フロアプラン",
  13873. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13874. CLOSE_HIGHLIGHTS: "閉じる",
  13875. PREVIOUS: "前へ",
  13876. PLAY: "再生",
  13877. PAUSE: "一時停止",
  13878. NEXT: "次へ",
  13879. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13880. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13881. SOCIAL_SHARING: "このSpaceを共有する",
  13882. VIEW_IN_VR: "VRで表示",
  13883. VIEW_FULLSCREEN: "フルスクリーン表示",
  13884. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13885. ZOOM_IN: "ズームイン",
  13886. ZOOM_OUT: "ズームアウト",
  13887. FLOOR_NAME: "フロア ",
  13888. FLOOR_ALL: "すべて",
  13889. TERMS: "規約",
  13890. PORT_TERMS: "port規約",
  13891. TERMS_OF_USE: "利用規約",
  13892. CLOSE_TERMS: "閉じる",
  13893. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13894. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13895. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13896. WEBVR_ENTER_WEBVR: "VRに入る",
  13897. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13898. WEBVR_LEARN_MORE: "もっと詳しく",
  13899. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13900. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13901. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13902. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13903. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13904. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13905. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13906. VR_PREVIOUS_CAPS: "前へ",
  13907. VR_NEXT_CAPS: "次へ",
  13908. VR_GOT_IT_CAPS: "了解",
  13909. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13910. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13911. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13912. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13913. VR_WHAT_YOU_NEED: "必要なもの",
  13914. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13915. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13916. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13917. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13918. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13919. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13920. VR_APP: "port VRアプリ",
  13921. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13922. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13923. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13924. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13925. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13926. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13927. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13928. VR_ANDROID_DVICES: "Androidデバイス",
  13929. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13930. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13931. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13932. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13933. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13934. VR_APP_OPEN: "port VRアプリで開く",
  13935. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13936. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13937. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13938. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13939. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13940. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13941. SHARE_TO: "共有先",
  13942. SHARE_LINK: "ダイレクトリンク",
  13943. SHARE_EXPLORE: "探索",
  13944. SHARE_AT: "場所",
  13945. SHARE_WITH: "使用アプリ",
  13946. SHARE_3D: "3Dで",
  13947. SHARE_COPIED: "コピーされました!",
  13948. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13949. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13950. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13951. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13952. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13953. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13954. ERROR_GENERIC_ACTIONS_3: "または",
  13955. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13956. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13957. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13958. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13959. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13960. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13961. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13962. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13963. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13964. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13965. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13966. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13967. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13968. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13969. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13970. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13971. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13972. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13973. LINK_TO_LOCATION: "ロケーションへのリンク",
  13974. MENU_COPY: "コピー",
  13975. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13976. ROTATE: "回転",
  13977. MOVE: "移動",
  13978. INSIDE: "内側",
  13979. ZOOM: "ズーム",
  13980. HELP: "ヘルプ",
  13981. HELP_NAVIGATION_TAB: "ナビゲーション",
  13982. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13983. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13984. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13985. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13986. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13987. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13988. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13989. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13990. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13991. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13992. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13993. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13994. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13995. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13996. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13997. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13998. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13999. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14000. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14001. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14002. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14003. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14004. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14005. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14006. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14007. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14008. HELP_MORE_HLR_A: "ハイライト",
  14009. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14010. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14011. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14012. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14013. HELP_MORE_FLOORS_A: "フロアセレクター",
  14014. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14015. HELP_MORE_TAG_A: "tag™ Posts",
  14016. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14017. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14018. HELP_MORE_ZOOM_A: "ズームコントロール",
  14019. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14020. HELP_MORE_TOUR_A: "ツアーコントロール",
  14021. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14022. HELP_MORE_INSIDE_A: "内側ビュー",
  14023. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14024. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14025. HELP_MORE_VR_A: "VRモード",
  14026. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14027. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14028. HELP_MORE_360_A: "360° Views",
  14029. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14030. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14031. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14032. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14033. CLOSE: "閉じる"
  14034. }
  14035. }
  14036. , {}],
  14037. 115: [function(e, t, i) {
  14038. "use strict";
  14039. t.exports = {
  14040. PAGE_TITLE: "",
  14041. LOADING: "Загрузка",
  14042. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14043. POWERED_BY: "разработано на платформе ",
  14044. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14045. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14046. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14047. PRESENTED_BY: "Представлено ",
  14048. MORE: "Больше ",
  14049. LESS: "Меньше ",
  14050. TAG_CONTENT: "tag™ Контент",
  14051. SHOW: "Показать",
  14052. HIDE: "Скрыть",
  14053. DOLLHOUSE: "Dollhouse",
  14054. FLOOR_PLAN: "Планировка",
  14055. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14056. CLOSE_HIGHLIGHTS: "Закрыть",
  14057. PREVIOUS: "Предыдущий",
  14058. PLAY: "Воспроизвести",
  14059. PAUSE: "Пауза",
  14060. NEXT: "Следующий",
  14061. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14062. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14063. SOCIAL_SHARING: "Поделиться этой моделью",
  14064. VIEW_IN_VR: "Посмотреть в VR",
  14065. VIEW_FULLSCREEN: "Полный экран",
  14066. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14067. ZOOM_IN: "Увеличить",
  14068. ZOOM_OUT: "Уменьшить",
  14069. FLOOR_NAME: "Этаж ",
  14070. FLOOR_ALL: "Все",
  14071. TERMS: "Условия",
  14072. PORT_TERMS: "Правила пользования",
  14073. TERMS_OF_USE: "Условия использования",
  14074. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14075. CLOSE_TERMS: "Закрыть",
  14076. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14077. HELP: "Помощь",
  14078. HELP_NAVIGATION_TAB: "Навигация",
  14079. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14080. CLOSE: "Закрыть",
  14081. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14082. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14083. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14084. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14085. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14086. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14087. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14088. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14089. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14090. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14091. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14092. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14093. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14094. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14095. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14096. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14097. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14098. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14099. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14100. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14101. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14102. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14103. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14104. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14105. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14106. HELP_MORE_HLR_A: "Фотоколлаж",
  14107. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14108. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14109. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14110. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14111. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14112. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14113. HELP_MORE_TAG_A: "tag™ Posts",
  14114. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14115. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14116. HELP_MORE_ZOOM_A: "Масштаб",
  14117. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14118. HELP_MORE_TOUR_A: "Управление Туром",
  14119. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14120. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14121. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14122. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14123. HELP_MORE_VR_A: "Режим VR",
  14124. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14125. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14126. HELP_MORE_360_A: "360° Views",
  14127. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14128. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14129. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14130. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14131. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14132. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14133. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14134. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14135. WEBVR_LEARN_MORE: "Узнать больше",
  14136. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14137. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14138. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14139. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14140. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14141. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14142. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14143. VR_APP: "port VR App",
  14144. VR_APP_OPEN: "Или открыть через приложение port VR",
  14145. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14146. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14147. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14148. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14149. VR_VIEW_SPACE: "Запустить модель в VR",
  14150. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14151. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14152. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14153. VR_GOT_IT_CAPS: "ЯСНО",
  14154. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14155. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14156. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14157. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14158. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14159. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14160. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14161. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14162. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14163. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14164. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14165. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14166. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14167. VR_ANDROID_DVICES: "Android устройства",
  14168. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14169. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14170. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14171. VR_DOWNLOAD_HERE: "Скачать здесь",
  14172. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14173. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14174. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14175. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14176. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14177. SHARE_TO: "Поделиться",
  14178. SHARE_LINK: "Прямая ссылка",
  14179. SHARE_EXPLORE: "просмотреть",
  14180. SHARE_AT: "на",
  14181. SHARE_WITH: "с",
  14182. SHARE_3D: "в 3D",
  14183. SHARE_COPIED: "Скопировано!",
  14184. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14185. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14186. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14187. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14188. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14189. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14190. ERROR_GENERIC_ACTIONS_3: " или ",
  14191. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14192. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14193. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14194. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14195. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14196. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14197. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14198. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14199. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14200. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14201. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14202. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14203. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14204. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14205. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14206. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14207. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14208. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14209. LINK_TO_LOCATION: "Ссылка на местоположение",
  14210. MENU_COPY: "Копировать",
  14211. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14212. ROTATE: "Вращать",
  14213. MOVE: "Передвигаться",
  14214. INSIDE: "Вид изнутри",
  14215. ZOOM: "Масштаб"
  14216. }
  14217. }
  14218. , {}],
  14219. 116: [function(e, t, i) {//main.js
  14220. (function(t) {
  14221. "use strict";
  14222. var modelProgressBase = 0.4;
  14223. var progressUpdate = function(e){ // 0 <= e <= 1
  14224. console.log('e1:'+e)
  14225. e = Math.round(modelProgressBase * e * 100);
  14226. console.log('e2:'+e)
  14227. var t = $('.progressbar');
  14228. t.find('.bar').css('width',e+'%');
  14229. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14230. t.find('.perc').text(e +'%'); //具体数字的百分比
  14231. }
  14232. $('#gui-loading').fadeIn(200);
  14233. progressUpdate(0.1)
  14234. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14235. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14236. var data = matcher(e);
  14237. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14238. data.user = {
  14239. "is_authenticated": false,
  14240. "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"]
  14241. }
  14242. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  14243. var newImages = [];
  14244. data.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  14245. data.model.images = newImages
  14246. }catch(e){console.log(e) }
  14247. //data.flyInOnlyBySwitch = true
  14248. window.MP_PREFETCHED_MODELDATA = data;
  14249. data.model.summary = data.summary
  14250. data.model.name = data.name
  14251. for(let i in data){
  14252. data[i] == "false" && (data[i] = false)
  14253. }
  14254. progressUpdate(0.7);
  14255. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14256. if(data.weixinDesc){
  14257. g_weixinObj.desc = data.weixinDesc;
  14258. }
  14259. if(data.shareImgUrl){
  14260. g_weixinObj.imgUrl = data.shareImgUrl
  14261. }
  14262. window.wx && manage.weixinShare();
  14263. //初始画面
  14264. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14265. function E(e) {
  14266. $("<img/>").attr("src", e).on("load", function() {
  14267. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14268. $(this).remove()
  14269. })
  14270. }
  14271. })
  14272. function StartLoad(){//当加载完data后
  14273. function i() {
  14274. var e = Y.getModelIDFromQueryString();
  14275. if (!e)
  14276. return b(null, "loading-failed");
  14277. var t = Y.parseSidUrl(e)
  14278. , i = l()
  14279. , a = c()
  14280. , s = o()
  14281. , u = V.quickstart.enabled
  14282. , g = null
  14283. , m = null
  14284. , v = null
  14285. , w = null
  14286. , T = null
  14287. , x = null
  14288. , S = null
  14289. , M = null
  14290. , R = null
  14291. , P = null
  14292. , O = null
  14293. , L = null
  14294. , N = new ue;
  14295. r(s);
  14296. h({ //MP开头写法
  14297. urlBase: t.urlBase
  14298. }).then(function() {
  14299. return re.init(),
  14300. d(t, e) //getModel and load
  14301. }).then(function(e) {
  14302. progressUpdate(0.9)
  14303. return P = e,
  14304. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14305. startSource: i,
  14306. autoplay: V.autoplay,
  14307. quickstart: u
  14308. }),
  14309. P.urls.init()
  14310. }).then(function() {
  14311. return P.loadPanos()
  14312. }).then(function() {
  14313. m = X.getStartCameraOptions(P, P.panos),
  14314. S = A(P),
  14315. O = y(u, m.mode),
  14316. v = O.controls,
  14317. w = O.player,
  14318. T = O.director,
  14319. x = O.tagManager,
  14320. M = O.tileDownloader,
  14321. R = O.qualityManager,
  14322. L = O.panoRenderer,
  14323. C(P, S, O, s),
  14324. w.director = T,//xzw add
  14325. P.supportsTiles && M.start(),
  14326. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14327. u = !1);
  14328. var e = null;
  14329. if (u) {
  14330. de.warn("Quickstart engaged. Hold on to your knickers.");
  14331. var t = v.controls[D.PANORAMA];
  14332. g = new ie(R,S.scene,S.camera,t,s),
  14333. _(S, s, P),
  14334. e = g.load(m).then(function() {
  14335. S.addComponent(g),
  14336. S.once(le.AfterRender, function() {
  14337. de.warn("First render after quickstart load finished.")
  14338. })
  14339. })
  14340. }
  14341. window.flyToFirst = function(){//xzw add
  14342. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14343. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14344. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14345. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14346. };
  14347. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14348. }).then(function() {
  14349. return f(P, U.onProgress, i, !u, a)
  14350. }).then(function() {
  14351. if (m.quickstart = u,
  14352. I(P, S, O, s),
  14353. S.started || _(S, s, P),
  14354. H.modelLoaded(P, w, v, V.autoplay),
  14355. E(w, P, m, V.autoplay).done(function() {
  14356. T.autoTour()
  14357. }),
  14358. !P.supportsTiles) {
  14359. var e = new Z(P,w);
  14360. e.start()
  14361. }
  14362. u && (S.removeComponent(g),
  14363. g.destroy(),
  14364. m.pano.enter()),
  14365. U.init(P, T, w, v, S, m, H.getSessionId()),
  14366. U.endLoading(P, T, x),
  14367. S.once(le.AfterRender, function() {
  14368. N.setAppReadyTime();
  14369. var e = N.calcFullLoadingTime();
  14370. de.warn("Total load time: " + e / 1e3),
  14371. H.loadComplete(e),
  14372. de.warn("First render after model load finished.")
  14373. }),
  14374. S.on(le.MemoryUsageUpdated, n)
  14375. }).fail(b.bind(this, e))
  14376. }
  14377. function n(e) {
  14378. ce.update(e)
  14379. }
  14380. function r(e) {
  14381. de.info("Version", "2.25.6-0-gd87e5b1"),
  14382. q.defaultMaxListeners = 1e3,
  14383. a(e),
  14384. s()
  14385. }
  14386. function o() {
  14387. return document.getElementById("player")
  14388. }
  14389. function a(e) {
  14390. e.addEventListener("dragenter", T, !1),
  14391. e.addEventListener("dragover", T, !1)
  14392. }
  14393. function s() {
  14394. F.valueFromHash("title", !0) || $(document).ready(function() {
  14395. var e = $(".model-title");
  14396. e.hide()
  14397. })
  14398. }
  14399. function l() {
  14400. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14401. }
  14402. function c() {
  14403. return {
  14404. panoElementsToLoad: 6,
  14405. modelElementsToLoad: 0,
  14406. totalElementsLoaded: 0,
  14407. totalElementsToLoad: 0,
  14408. totalPercentageLoaded: 0,
  14409. progressCallback: null
  14410. }
  14411. }
  14412. function h(e) {
  14413. return K.loadFeatureFlags(e).done(function(e) {
  14414. K.updateDependentSettings(e, V)
  14415. })
  14416. }
  14417. // function u(e) {
  14418. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14419. // responseType: "json",
  14420. // prefetchFrom: "config"
  14421. // }).then(function(e) {
  14422. // return e ? void j.extendObject(V.appConfig, e) : {}
  14423. // }, function(e) {
  14424. // return de.warn("Failed loading runtime config, using defaults."),
  14425. // $.when({})
  14426. // })
  14427. // }
  14428. function d(e, t) {
  14429. var i = B.getModel({
  14430. url: t,
  14431. floors: F.valueFromHash("f", !0),
  14432. autoload: !1
  14433. })
  14434. ;
  14435. return $.when(i, n).then(null, function(e) {
  14436. return this
  14437. })
  14438. }
  14439. function p(e, t, i, n, r) {
  14440. de.info("Model data loaded"),
  14441. de.debug("UUID: " + e.data.job.uuid),
  14442. J.init(K.getFlags()),
  14443. i && H.initKeen({
  14444. token: i,
  14445. appId: n
  14446. }),
  14447. H.initSegment({
  14448. model: e.sid,
  14449. version: "2.25.6-0-gd87e5b1",
  14450. startSource: r.startSource,
  14451. token: t,
  14452. autoplay: r.autoplay,
  14453. quickstart: r.quickstart
  14454. })
  14455. }
  14456. function f(e, t, i, n, r) {
  14457. return r.progressCallback = t,
  14458. H.sessionStart(),
  14459. e.load(n).progress(g.bind(this, r))
  14460. }
  14461. function g(e, t) {
  14462. e.modelElementsToLoad = t[1],
  14463. v(e),
  14464. m(e)
  14465. }
  14466. function m(e) {
  14467. e.totalElementsLoaded++,
  14468. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14469. //----许钟文-----------------模型进度条向后调整
  14470. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14471. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14472. console.log('pro:'+e.totalPercentageLoaded)
  14473. //---------------------------
  14474. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14475. }
  14476. function v(e) {
  14477. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14478. }
  14479. function A(e) {
  14480. var t = new x.PerspectiveCamera;
  14481. t.layers.enable(he.PANOMARKERS),
  14482. t.layers.enable(he.RETICULE),
  14483. t.layers.enable(he.TAG);
  14484. var i = new x.Scene
  14485. , n = new x.AmbientLight(16777215);
  14486. i.add(n),
  14487. i.skybox = new W,
  14488. i.add(i.skybox),
  14489. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14490. side: x.DoubleSide
  14491. })),
  14492. i.plane.position.y = 0,
  14493. i.plane.rotateX(-Math.PI / 2),
  14494. i.plane.material.visible = !1,
  14495. i.add(i.plane),
  14496. i.updateMatrixWorld(),
  14497. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14498. if (e.metadata && e.metadata.camera_position) {
  14499. var t = e.metadata.camera_position
  14500. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14501. n.position = t.clone(),
  14502. i.add(n);
  14503. var r = e.metadata.camera_quaternion
  14504. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14505. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14506. }
  14507. }),
  14508. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14509. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14510. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14511. var r = new te(i,t,z);
  14512. return r
  14513. }
  14514. function y(e, t) {
  14515. var i = e ? 1 : 1e3
  14516. , n = J.tilegen || J.imgopt ? 6 : 2;
  14517. n = F.valueFromHash("tileconc", n);
  14518. var r = new ne
  14519. , o = new ae({
  14520. concurrentDownloads: n
  14521. })
  14522. , a = new se
  14523. , s = new P
  14524. , l = new M
  14525. , c = new S(t)
  14526. , h = new R
  14527. , u = new O(i)
  14528. , d = new L
  14529. , p = new oe;
  14530. return {
  14531. qualityManager: r,
  14532. panoRenderer: a,
  14533. tileDownloader: o,
  14534. player: c,
  14535. director: l,
  14536. modelManager: s,
  14537. tagManager: p,
  14538. displayController: u,
  14539. labelDisplayController: d,
  14540. controls: h
  14541. }
  14542. }
  14543. function C(e, t, i, n) {
  14544. var r = i.controls
  14545. , o = i.qualityManager
  14546. , a = i.panoRenderer
  14547. , s = i.tileDownloader
  14548. , l = i.modelManager;
  14549. r.init(n, l),
  14550. ee.init(i.director, r, i.player, l, t),
  14551. o.init(l),
  14552. s.init(o),
  14553. a.init(t, s, o),
  14554. l.init(s, a, o),
  14555. l.addModel(e),
  14556. t.addComponent(G)
  14557. }
  14558. function I(e, t, i, n) {
  14559. var r = i.qualityManager
  14560. , o = i.panoRenderer
  14561. , a = i.tileDownloader
  14562. , s = i.modelManager
  14563. , l = i.player
  14564. , c = i.director
  14565. , h = i.tagManager
  14566. , u = i.displayController
  14567. , d = i.labelDisplayController
  14568. , p = i.controls;
  14569. t.scene.add(e),
  14570. t.qualityManager = r;
  14571. var f = {
  14572. camera: t.camera,
  14573. director: c,
  14574. modelManager: s,
  14575. tileDownloader: a,
  14576. panoRenderer: o,
  14577. qualityManager: r,
  14578. tagManager: h,
  14579. container: n,
  14580. controls: p
  14581. };
  14582. l.init(f),
  14583. l.setScene(t.scene),
  14584. h.init(s, l),
  14585. c.init(l, s),
  14586. u.init(c, l, s, h, n),
  14587. d.init(l, s, n),
  14588. z.bindEvents(l),
  14589. t.addComponent(h),
  14590. t.addComponent(l),
  14591. t.addComponent(o),
  14592. l.sceneRenderer = t; //xzw add 方便resize
  14593. }
  14594. function E(e, t, i, n) {
  14595. return de.info("Starting player in " + i.mode),
  14596. H.report(t.sid, "started-playing", n, i.quickstart),
  14597. e.start(i)
  14598. }
  14599. function b(e, t) {
  14600. de.error(t),
  14601. k.error(t),
  14602. H.report(e, "error-" + t)
  14603. }
  14604. function w(e) {
  14605. var t = F.details();
  14606. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14607. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14608. H.report(e, "error-webgl-generic"))
  14609. }
  14610. function _(e, t, i) {
  14611. try {
  14612. e.start(t)
  14613. } catch (e) {
  14614. throw de.warn(e.message),
  14615. w(i.sid),
  14616. e
  14617. }
  14618. }
  14619. function T(e) {
  14620. e.stopPropagation(),
  14621. e.preventDefault()
  14622. }
  14623. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14624. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  14625. g_HotImage = {
  14626. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14627. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14628. } ;
  14629. }
  14630. //czj 判断someData 有没有backgroundMusic 添加音乐
  14631. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14632. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  14633. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  14634. $("#volume").show();
  14635. }else if (g_version === "one"){
  14636. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14637. //g_bgAudio.src = manage.dealURL(src) ;
  14638. }
  14639. //隐藏公司logo
  14640. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  14641. showLogo();
  14642. }
  14643. e("./lib/three75-shim"),
  14644. e("./lib/array-polyfill"),
  14645. e("./lib/performance-polyfill"),
  14646. e("./lib/shaders/CopyShader.js"),
  14647. e("./lib/shaders/HorizontalBlurShader.js"),
  14648. e("./lib/shaders/VerticalBlurShader.js"),
  14649. e("./lib/postprocessing/EffectComposer.js"),
  14650. e("./lib/postprocessing/RenderPass.js"),
  14651. e("./lib/postprocessing/MaskPass.js"),
  14652. e("./lib/postprocessing/ShaderPass.js"),
  14653. window.Promise || (window.Promise = e("promise-polyfill"));
  14654. var x = e("three")
  14655. , _x = e("three")
  14656. , S = (e("./util/sentry"),
  14657. e("./player"))
  14658. , M = e("./director")
  14659. , R = e("./controls/CameraControls")
  14660. , P = e("./model/ModelManager")
  14661. , O = e("./DisplayController")
  14662. , L = e("./label/LabelDisplayController")
  14663. , D = e("./enum/Viewmode")
  14664. , N = e("./util/logger")
  14665. , B = e("./showcase")
  14666. , F = e("./util/browser")
  14667. , V = e("./settings")
  14668. , U = e("./gui/gui")
  14669. , k = e("./gui/error")
  14670. , H = e("./analytics")
  14671. , G = e("./util/transitions")
  14672. , z = e("./effects")
  14673. , W = e("./objects/Skybox")
  14674. , j = e("./util/common")
  14675. , Y = (e("./util/PanoramaCollection"),
  14676. e("./util/math"),
  14677. e("./util/showcase"))
  14678. , X = e("./util/camera")
  14679. , Z = (e("./objects/Panorama"),
  14680. e("./cameras/PanoramaCamera"),
  14681. e("./preloaders"))
  14682. , q = e("events").EventEmitter
  14683. , K = e("./featureflags")
  14684. , Q = (e("./util/lerp"),
  14685. e("./util/ajax"))
  14686. , J = e("./ab")
  14687. , ee = e("./sdk/automation.js")
  14688. , te = e("./scene/SceneRenderer")
  14689. , ie = e("./scene/QuickstartManager")
  14690. , ne = e("./tile/QualityManager.js")
  14691. , re = e("./localization/localize")
  14692. , oe = e("./tag/tagManager")
  14693. , ae = e("./tile/TileDownloader")
  14694. , se = e("./tile/PanoRenderer")
  14695. , le = (e("./enum/PanoSizeClass"),
  14696. e("./enum/PanoramaEvents"),
  14697. e("./enum/SceneRendererEvents"))
  14698. , ce = e("./gui/memoryUsage")
  14699. , he = e("./enum/RenderLayers")
  14700. , ue = e("./TimingData")
  14701. , de = new N(t);
  14702. N.level = V.logLevel,
  14703. N.consoleEnabled = V.console,
  14704. i()
  14705. }
  14706. }
  14707. ).call(this, "/js/main.js")
  14708. }
  14709. , {
  14710. "./DisplayController": 1,
  14711. "./TimingData": 2,
  14712. "./ab": 3,
  14713. "./analytics": 4,
  14714. "./cameras/PanoramaCamera": 7,
  14715. "./controls/CameraControls": 9,
  14716. "./director": 15,
  14717. "./effects": 16,
  14718. "./enum/PanoSizeClass": 36,
  14719. "./enum/PanoramaEvents": 37,
  14720. "./enum/RenderLayers": 41,
  14721. "./enum/SceneRendererEvents": 43,
  14722. "./enum/Viewmode": 51,
  14723. "./featureflags": 59,
  14724. "./gui/error": 64,
  14725. "./gui/gui": 65,
  14726. "./gui/memoryUsage": 73,
  14727. "./label/LabelDisplayController": 91,
  14728. "./lib/array-polyfill": 92,
  14729. "./lib/performance-polyfill": 95,
  14730. "./lib/postprocessing/EffectComposer.js": 96,
  14731. "./lib/postprocessing/MaskPass.js": 97,
  14732. "./lib/postprocessing/RenderPass.js": 98,
  14733. "./lib/postprocessing/ShaderPass.js": 99,
  14734. "./lib/shaders/CopyShader.js": 100,
  14735. "./lib/shaders/HorizontalBlurShader.js": 101,
  14736. "./lib/shaders/VerticalBlurShader.js": 102,
  14737. "./lib/three75-shim": 103,
  14738. "./localization/localize": 108,
  14739. "./tag/tagManager": 124,
  14740. "./model/ModelManager": 140,
  14741. "./objects/Panorama": 148,
  14742. "./objects/Skybox": 152,
  14743. "./player": 155,
  14744. "./preloaders": 156,
  14745. "./scene/QuickstartManager": 157,
  14746. "./scene/SceneRenderer": 158,
  14747. "./sdk/automation.js": 164,
  14748. "./settings": 166,
  14749. "./showcase": 168,
  14750. "./tile/PanoRenderer": 169,
  14751. "./tile/QualityManager.js": 170,
  14752. "./tile/TileDownloader": 171,
  14753. "./util/PanoramaCollection": 178,
  14754. "./util/ajax": 181,
  14755. "./util/browser": 182,
  14756. "./util/camera": 183,
  14757. "./util/common": 185,
  14758. "./util/lerp": 188,
  14759. "./util/logger": 189,
  14760. "./util/math": 190,
  14761. "./util/sentry": 192,
  14762. "./util/showcase": 193,
  14763. "./util/transitions": 195,
  14764. events: 202,
  14765. "promise-polyfill": 213,
  14766. three: 217
  14767. }],
  14768. 117: [function(e, t, i) {
  14769. "use strict";
  14770. function n(e) {
  14771. e = e || {},
  14772. r.RawShaderMaterial.call(this, a.extendObject({
  14773. fragmentShader: o.cube.fragmentShader,
  14774. vertexShader: o.cube.vertexShader,
  14775. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14776. name: "CubemapMaterial"
  14777. }, e))
  14778. }
  14779. var r = e("three")
  14780. , o = e("../shaders")
  14781. , a = e("../util/common");
  14782. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14783. n.prototype.constructor = n,
  14784. t.exports = n
  14785. }
  14786. , {
  14787. "../shaders": 167,
  14788. "../util/common": 185,
  14789. three: 217
  14790. }],
  14791. 118: [function(e, t, i) {
  14792. "use strict";
  14793. function n(e) {
  14794. e = e || {},
  14795. r.RawShaderMaterial.call(this, a.extendObject({
  14796. fragmentShader: o.model.fragmentShader,
  14797. vertexShader: o.model.vertexShader,
  14798. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14799. name: "ModelTextureMaterial"
  14800. }, e))
  14801. }
  14802. var r = e("three")
  14803. , o = e("../shaders")
  14804. , a = e("../util/common");
  14805. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14806. n.prototype.constructor = n,
  14807. n.prototype.setProjectedPanos = function(e, t, i) {
  14808. i && (this.uniforms.progress.value = 0),
  14809. e.ensureSkyboxReadyForRender(),
  14810. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14811. this.uniforms.pano0Position.value.copy(e.position),
  14812. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14813. t.ensureSkyboxReadyForRender(),
  14814. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14815. this.uniforms.pano1Position.value.copy(t.position),
  14816. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14817. }
  14818. ,
  14819. t.exports = n
  14820. }
  14821. , {
  14822. "../shaders": 167,
  14823. "../util/common": 185,
  14824. three: 217
  14825. }],
  14826. 119: [function(e, t, i) {
  14827. (function(i) {
  14828. "use strict";
  14829. function n(e, t, i, n) {
  14830. this.div = null,
  14831. this.body = null,
  14832. this.label = e,
  14833. this.description = t,
  14834. this.parsedDescription = [],
  14835. this.media = i || {
  14836. type: null
  14837. },
  14838. this.loadingSpinner = null,
  14839. this.parser = new r({
  14840. supportLinks: !u.valueFromHash("mls"),
  14841. keepLinkLabels: !0
  14842. }),
  14843. this.state = I.CLOSED,
  14844. this.orientation = "",
  14845. this.initialTransform = "",
  14846. this.hovering = !1,
  14847. this.openTransition = null,
  14848. this.closeTransition = null,
  14849. this.openPromise = null,
  14850. this.closePromise = null,
  14851. this.animationTransition = null,
  14852. this.animationScale = 0
  14853. }
  14854. var r = e("../Parser/DescriptionParser")
  14855. , o = e("../Media/Link")
  14856. , a = e("../Media/Image")
  14857. , s = e("../Media/EmbedlyPlayer")
  14858. , l = e("../Media/EmbedlyEmbed")
  14859. , c = e("../../util/transitions")
  14860. , h = e("../../util/lerp")
  14861. , u = e("../../util/browser")
  14862. , d = e("./BillboardEvent")
  14863. , p = e("../Media/MediaEvent")
  14864. , f = e("../Parser/DescriptionChunkType")
  14865. , g = e("events").EventEmitter
  14866. , m = e("./billboardSettings")
  14867. , v = e("./overlaySettings")
  14868. , A = e("../../util/logger")
  14869. , y = new A(i)
  14870. , C = document.getElementById("tag-billboards");
  14871. C.addEventListener("touchend", function(e) {
  14872. C.style.pointerEvents = "none"
  14873. }),
  14874. C.addEventListener("touchcancel", function(e) {
  14875. C.style.pointerEvents = "none"
  14876. });
  14877. var I = {
  14878. CLOSED: "closed",
  14879. OPENING: "opening",
  14880. OPEN: "open",
  14881. CLOSING: "closing",
  14882. ACTIVE: "active"
  14883. };
  14884. n.prototype = Object.create(g.prototype),
  14885. n.prototype.build = function(e) {
  14886. this.parsedDescription = this.parser.parse(this.description);
  14887. var t = document.createElement("div");
  14888. t.className = "tag-container has-hotzone",
  14889. this.div = t,
  14890. this.body = document.createElement("div"),
  14891. this.body.className = "tag-body";
  14892. var i = document.createElement("div");
  14893. i.classList.add("tag-content");
  14894. var n = document.createElement("div");
  14895. n.classList.add("tag-text-content");
  14896. var r = document.createElement("div");
  14897. r.className = "tag-label",
  14898. r.textContent = this.label,
  14899. n.appendChild(r);
  14900. var o = document.createElement("div");
  14901. o.className = "tag-desc",
  14902. n.appendChild(o),
  14903. i.appendChild(n),
  14904. this.body.appendChild(i),
  14905. this.appendDescriptionElements(this.parsedDescription, o),
  14906. this.appendMedia(),
  14907. t.appendChild(this.body),
  14908. C.appendChild(t),
  14909. this.bindEvents(t, this.body)
  14910. }
  14911. ,
  14912. n.prototype.bindEvents = function(e, t) {
  14913. var i = function(e) {
  14914. return function(t) {
  14915. if (!this.div.classList.contains("overlay")) {
  14916. var i, n = document.getElementById("player");
  14917. try {
  14918. i = new MouseEvent(e,t)
  14919. } catch (n) {
  14920. i = document.createEvent("MouseEvents"),
  14921. i.initMouseEvent(e, 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)
  14922. }
  14923. n.dispatchEvent(i)
  14924. }
  14925. }
  14926. };
  14927. t.addEventListener("mousedown", function(e) {
  14928. e.stopPropagation()
  14929. }),
  14930. t.addEventListener("mouseup", function(e) {
  14931. e.stopPropagation()
  14932. }),
  14933. e.addEventListener("touchstart", function(e) {
  14934. C.style.pointerEvents = "auto"
  14935. }),
  14936. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14937. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14938. t.addEventListener("mouseover", function(t) {
  14939. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14940. }
  14941. .bind(this)),
  14942. e.addEventListener("mouseenter", function(e) {
  14943. this.state !== I.CLOSING && (this.hovering = !0,
  14944. this.emit(d.ENTER))
  14945. }
  14946. .bind(this)),
  14947. e.addEventListener("mouseleave", function(e) {
  14948. this.hovering = !1,
  14949. this.emit(d.LEAVE)
  14950. }
  14951. .bind(this)),
  14952. e.addEventListener("gesturestart", function(e) {
  14953. e.preventDefault()
  14954. });
  14955. var n = e.querySelector(".tag-text-content")
  14956. , r = 0;
  14957. n.addEventListener("touchstart", function(e) {
  14958. r = e.changedTouches[0].clientY
  14959. }),
  14960. n.addEventListener("touchmove", function(t) {
  14961. function i(e) {
  14962. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14963. }
  14964. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14965. }),
  14966. e.addEventListener("touchmove", function(e) {
  14967. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14968. })
  14969. }
  14970. ,
  14971. n.prototype.appendDescriptionElements = function(e, t) {
  14972. e.length > 0 && this.div.classList.add("has-text"),
  14973. e.forEach(function(e, i) {
  14974. switch (e.type) {
  14975. case f.TEXT:
  14976. t.appendChild(this.createTextElement(e.text));
  14977. break;
  14978. case f.LINK:
  14979. t.appendChild(this.createLinkElement(e.link))
  14980. }
  14981. }
  14982. .bind(this))
  14983. }
  14984. ,
  14985. n.prototype.appendLoadingSpinner = function() {
  14986. this.loadingSpinner = document.createElement("div"),
  14987. this.loadingSpinner.classList.add("loading-spinner");
  14988. var e = document.createElement("div");
  14989. e.classList.add("gui-spinner-icon"),
  14990. this.loadingSpinner.appendChild(e),
  14991. this.body.appendChild(this.loadingSpinner)
  14992. }
  14993. ,
  14994. n.prototype.onMediaLoadFinished = function() {
  14995. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14996. this.applyOrientation(this.orientation),
  14997. this.loadingSpinner = null)
  14998. }
  14999. ,
  15000. n.prototype.appendMedia = function() {
  15001. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15002. this.appendLoadingSpinner();
  15003. var e = document.createElement("div");
  15004. e.classList.add("tag-media-content");
  15005. var t = document.createElement("i");
  15006. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15007. t.classList.add(e)
  15008. }),
  15009. this.body.appendChild(t),
  15010. this.body.appendChild(e),
  15011. this.media.type) {
  15012. case f.IMAGE:
  15013. e.appendChild(this.createImageElement(this.media, this.body));
  15014. break;
  15015. case f.VIDEO:
  15016. e.appendChild(this.createVideoElement(this.media, this.body));
  15017. break;
  15018. case f.RICH:
  15019. e.appendChild(this.createEmbedElement(this.media, this.body))
  15020. }
  15021. }
  15022. }
  15023. ,
  15024. n.prototype.createTextElement = function(e) {
  15025. var t = document.createElement("span");
  15026. return t.textContent = e,
  15027. t
  15028. }
  15029. ;
  15030. n.prototype.createLinkElement = function(e) {
  15031. var t = new o(e);
  15032. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15033. t.createDomElement()
  15034. }
  15035. ,
  15036. n.prototype.createImageElement = function(e, t) {
  15037. function i() {
  15038. function e() {
  15039. m || (r.classList.remove("view-image"),
  15040. c.classList.add("overlay"),
  15041. i(),
  15042. window.addEventListener("resize", b),
  15043. c.addEventListener("click", a),
  15044. g.addEventListener("click", l),
  15045. f.addEventListener("click", s),
  15046. m = !0,
  15047. o.emit(p.IMAGE_OPENED))
  15048. }
  15049. function i() {
  15050. t.classList.add("show-info"),
  15051. h.classList.remove("collapsible"),
  15052. h.style.height = "";
  15053. var e = parseFloat(getComputedStyle(I).lineHeight)
  15054. , i = y + e
  15055. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15056. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15057. , s = a
  15058. , l = s * n.aspect;
  15059. l > r && (l = r,
  15060. s = l / n.aspect),
  15061. s > a && (s = a,
  15062. l = s * n.aspect),
  15063. l += C,
  15064. s += C + i,
  15065. t.style.width = l + "px",
  15066. t.style.height = s + "px",
  15067. u.style.paddingTop = e + C + "px",
  15068. o.description.length > 0 && (h.classList.add("collapsible"),
  15069. h.style.height = h.clientHeight + 12 + "px",
  15070. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15071. }
  15072. function a(e) {
  15073. e.target === c && s()
  15074. }
  15075. function s() {
  15076. m && (m = !1,
  15077. r.classList.add("view-image"),
  15078. c.classList.remove("overlay"),
  15079. h.style.height = "",
  15080. u.style.paddingTop = "",
  15081. t.style.width = "",
  15082. t.style.height = "",
  15083. window.removeEventListener("resize", b),
  15084. c.removeEventListener("click", a),
  15085. g.removeEventListener("click", l),
  15086. f.removeEventListener("click", s),
  15087. o.emit(p.IMAGE_CLOSED),
  15088. o.close(!0))
  15089. }
  15090. function l(e) {
  15091. t.classList.toggle("show-info")
  15092. }
  15093. var c = o.div
  15094. , h = c.getElementsByClassName("tag-content")[0]
  15095. , u = c.getElementsByClassName("tag-media-content")[0]
  15096. , f = t.getElementsByClassName("close")[0]
  15097. , g = h.getElementsByClassName("tag-label")[0];
  15098. c.classList.add("has-image"),
  15099. r.classList.add("view-image"),
  15100. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15101. o.applyOrientation(o.orientation);
  15102. var m = !1
  15103. , A = getComputedStyle(h)
  15104. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15105. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15106. , I = h.querySelector(".tag-label")
  15107. , E = h.querySelector(".tag-desc")
  15108. , b = function() {
  15109. var e, t, n = 0;
  15110. return function() {
  15111. clearInterval(e),
  15112. clearTimeout(t),
  15113. e = setInterval(function() {
  15114. var e = c.clientHeight;
  15115. n !== e && (i(),
  15116. n = e)
  15117. }, 100),
  15118. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15119. }
  15120. }();
  15121. n.on(p.IMAGE_OPENING, e),
  15122. o.on(d.ACTIVATE, e),
  15123. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15124. o.on(d.CLOSING, s)
  15125. }
  15126. var n = new a
  15127. , r = n.createDomElement();
  15128. this.once(d.OPENED, function() {
  15129. n.load(e.src).then(i).catch(function(t) {
  15130. y.warn("Failed to load image:", e.src),
  15131. y.warn("with error:", t)
  15132. }).then(this.onMediaLoadFinished.bind(this))
  15133. });
  15134. var o = this;
  15135. return r
  15136. }
  15137. ,
  15138. n.prototype.createVideoElement = function(e, t) {
  15139. var i = new s({
  15140. autoPlay: !0,
  15141. autoResume: !0,
  15142. startMuted: !1,
  15143. loop: !1
  15144. })
  15145. , n = i.createDomElement();
  15146. return this.once(d.OPENED, function() {
  15147. i.load(e.src).then(function() {
  15148. this.div.classList.add("has-video"),
  15149. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15150. i.play()),
  15151. this.on(d.OPENING, i.show.bind(i)),
  15152. this.on(d.OPENED, i.play.bind(i)),
  15153. this.on(d.CLOSING, i.pause.bind(i)),
  15154. this.on(d.CLOSED, i.hide.bind(i))
  15155. }
  15156. .bind(this)).catch(function(t) {
  15157. y.warn("Failed to embed video:", e.src),
  15158. y.warn("with error:", t)
  15159. }).then(this.onMediaLoadFinished.bind(this))
  15160. }
  15161. .bind(this)),
  15162. n
  15163. }
  15164. ,
  15165. n.prototype.createEmbedElement = function(e, t) {
  15166. var i = new l
  15167. , n = i.createDomElement();
  15168. return this.once(d.OPENED, function() {
  15169. i.load(e.src).then(function() {
  15170. this.div.classList.add("has-embed"),
  15171. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15172. this.applyOrientation(this.orientation),
  15173. this.on(d.OPENING, i.show.bind(i)),
  15174. this.on(d.CLOSED, i.hide.bind(i))
  15175. }
  15176. .bind(this)).catch(function(t) {
  15177. y.warn("Failed to embed:", e.src),
  15178. y.warn("with error:", t)
  15179. }).then(this.onMediaLoadFinished.bind(this))
  15180. }
  15181. .bind(this)),
  15182. n
  15183. }
  15184. ,
  15185. n.prototype.open = function(e) {
  15186. return this.openPromise = $.Deferred(),
  15187. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15188. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15189. this.state !== I.OPEN && (this.emit(d.OPENING),
  15190. e && this.emit(d.ACTIVATING),
  15191. this.state = I.OPENING,
  15192. this.animateOpen(function() {
  15193. e && this.setActiveState(),
  15194. this.openPromise.resolve()
  15195. }
  15196. .bind(this)))
  15197. }
  15198. .bind(this), m.animation.openDelay),
  15199. c.cancel(this.closeTransition),
  15200. this.closePromise && this.closePromise.reject(),
  15201. this.closeTransition = void 0,
  15202. this.openPromise.promise())
  15203. }
  15204. ,
  15205. n.prototype.close = function(e) {
  15206. return this.closePromise = $.Deferred(),
  15207. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15208. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15209. this.state = I.CLOSING,
  15210. this.animateClose())
  15211. }
  15212. .bind(this), m.animation.closeDelay)),
  15213. c.cancel(this.openTransition),
  15214. this.openPromise && this.openPromise.reject(),
  15215. this.openTransition = void 0,
  15216. this.closePromise.resolve(),
  15217. this.closePromise.promise())
  15218. }
  15219. ,
  15220. n.prototype.setActiveState = function() {
  15221. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15222. this.emit(d.ACTIVATE),
  15223. this.div.classList.remove("has-hotzone"))
  15224. }
  15225. ,
  15226. n.prototype.animateOpen = function(e) {
  15227. if (this.state === I.OPENING) {
  15228. if (c.cancel(this.animationTransition),
  15229. u.detectSamsungNative())
  15230. return this.boardOrientation = null,
  15231. this.div.style.visibility = "visible",
  15232. this.emit(d.OPENED),
  15233. this.state = I.OPEN,
  15234. void (e && e());
  15235. this.div.style.webkitTransform = "scale(0)",
  15236. this.div.style.transform = "scale(0)",
  15237. this.div.style.visibility = "visible",
  15238. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15239. this.emit(d.OPENED),
  15240. this.state = I.OPEN,
  15241. e && e()
  15242. }
  15243. .bind(this))
  15244. }
  15245. }
  15246. ,
  15247. n.prototype.animateClose = function(e) {
  15248. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15249. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15250. this.emit(d.CLOSED),
  15251. this.state = I.CLOSED,
  15252. this.div.style.visibility = "hidden",
  15253. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15254. e && e()
  15255. }
  15256. .bind(this)))
  15257. }
  15258. ,
  15259. n.prototype.needsUpdate = function() {
  15260. return this.state !== I.CLOSED
  15261. }
  15262. ,
  15263. n.prototype.update = function(e, t) {
  15264. if (this.needsUpdate()) {
  15265. var i = (this.updateOrientation(e),
  15266. this.calcScale(t))
  15267. , n = {
  15268. x: (e.x + 1) * $("#player").width() / 2,
  15269. y: (e.y + 1) * $("#player").height() / 2
  15270. };
  15271. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15272. this.div.style.webkitTransform = this.div.screenTransform,
  15273. this.div.style.transform = this.div.screenTransform
  15274. }
  15275. }
  15276. ,
  15277. n.prototype.getDimensions = function() {
  15278. return this.div.getBoundingClientRect()
  15279. }
  15280. ,
  15281. n.prototype.calcScale = function(e) {
  15282. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15283. }
  15284. ,
  15285. n.prototype.updateOrientation = function(e) {
  15286. if (this.state !== I.ACTIVE) {
  15287. var t = 1 / 3
  15288. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15289. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15290. , r = "";
  15291. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15292. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15293. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15294. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15295. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15296. }
  15297. }
  15298. ,
  15299. n.prototype.applyOrientation = function(e) {
  15300. this.div.style.transform = this.div.style.webkitTransform = "",
  15301. this.div.classList.remove("tag-container-" + this.orientation),
  15302. this.div.classList.add("tag-container-" + e);
  15303. var t = window.getComputedStyle(this.div);
  15304. this.initialTransform = t.transform || t.webkitTransform,
  15305. "none" === this.initialTransform && (this.initialTransform = "");
  15306. var i = t.transform.slice(7, -1).split(",")
  15307. , n = -i[4]
  15308. , r = -i[5];
  15309. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15310. this.div.style.transformOrigin = n + "px " + r + "px",
  15311. this.orientation = e
  15312. }
  15313. ,
  15314. t.exports = n
  15315. }
  15316. ).call(this, "/js/tag/Billboard/Billboard.js")
  15317. }
  15318. , {
  15319. "../../util/browser": 182,
  15320. "../../util/lerp": 188,
  15321. "../../util/logger": 189,
  15322. "../../util/transitions": 195,
  15323. "../Media/EmbedlyEmbed": 125,
  15324. "../Media/EmbedlyPlayer": 126,
  15325. "../Media/Image": 128,
  15326. "../Media/Link": 129,
  15327. "../Media/MediaEvent": 131,
  15328. "../Parser/DescriptionChunkType": 133,
  15329. "../Parser/DescriptionParser": 134,
  15330. "./BillboardEvent": 120,
  15331. "./billboardSettings": 121,
  15332. "./overlaySettings": 122,
  15333. events: 202
  15334. }],
  15335. 120: [function(e, t, i) {
  15336. "use strict";
  15337. t.exports = Object.freeze({
  15338. ENTER: "billboard.enter",
  15339. LEAVE: "billboard.leave",
  15340. OPENING: "billboard.opening",
  15341. OPENED: "billboard.open",
  15342. CLOSING: "billboard.closing",
  15343. CLOSED: "billboard.closed",
  15344. ACTIVATING: "billboard.activating",
  15345. ACTIVATE: "billboard.activate"
  15346. })
  15347. }
  15348. , {}],
  15349. 121: [function(e, t, i) {
  15350. "use strict";
  15351. t.exports = Object.freeze({
  15352. animation: Object.freeze({
  15353. hoverOnClosing: !1,
  15354. openDelay: 100,
  15355. closeDelay: 50,
  15356. openDuration: 200,
  15357. closeDuration: 100
  15358. }),
  15359. boardToDiscRatio: 1.2
  15360. })
  15361. }
  15362. , {}],
  15363. 122: [function(e, t, i) {
  15364. "use strict";
  15365. t.exports = Object.freeze({
  15366. boundaryWidth: 30,
  15367. boundaryHeight: 0
  15368. })
  15369. }
  15370. , {}],
  15371. /*********************************创建热点模型************************************************** */
  15372. "hot": [function(e, t, i) {//热点
  15373. "use strict";
  15374. function hot(sid,d,model){
  15375. this.sid = sid;
  15376. /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
  15377. if(d.quaternion){
  15378. this.quaternion = d.quaternion;
  15379. }else{
  15380. this.rotation = this.conversionArray(d.rotation)
  15381. } */
  15382. this.position = this.convertValue(d.position, r.Vector3)
  15383. if(d.quaternion){
  15384. this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
  15385. }else{
  15386. this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
  15387. }
  15388. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15389. this.isSprite = d.isSprite
  15390. this.noAction = d.noAction
  15391. this.linkType = d.linkType || "common"
  15392. this.link = d.link;
  15393. this.model = model;
  15394. this.size = d.size;
  15395. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15396. this.build();
  15397. if(d.infoAttribute.hardware){
  15398. var id = d.infoAttribute.hardware.id;
  15399. if(id!= void 0){
  15400. window.hardwareHotList[id] = this//硬件列表
  15401. }
  15402. //得先获取最新的status 是否在线
  15403. }
  15404. if(d.infoAttribute){
  15405. /* if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  15406. }else{ */
  15407. this.createTitleElem(d.infoAttribute.hardware ? d.infoAttribute.hardware.name : d.infoAttribute.title )
  15408. //}
  15409. }
  15410. this.changeTex()
  15411. this.setVisiblePanos(d.visiblePanos);
  15412. this.infoAttribute = d.infoAttribute;
  15413. }
  15414. var r = e("three")
  15415. , f = e("../shaders")
  15416. , a = e("../settings")
  15417. , s = e("../enum/Viewmode")
  15418. , p = e("../objects/Panorama")
  15419. , math = e("../util/math")
  15420. , te = e("../util/texture");
  15421. var raycaster = new r.Raycaster;
  15422. //热点大小
  15423. var geometry = new r.PlaneBufferGeometry( 1,1,/* g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight */ 1,1);
  15424. var defaultTex1 = te.load(g_HotImage.point);
  15425. var defaultTex2 = te.load(g_HotImage.point2);
  15426. hot.prototype.changeTex = function(){
  15427. var u = this.mesh.material.uniforms
  15428. if(this.styleTex.length){
  15429. u.texture1.value = te.load(this.styleTex[0].src);
  15430. u.texture2.value = te.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  15431. }else{
  15432. u.texture1.value = defaultTex1;
  15433. u.texture2.value = defaultTex2;
  15434. console.log(this.sid)
  15435. }
  15436. }
  15437. hot.prototype.initStyleImg = function(t){
  15438. this.styleTex = []
  15439. t.styleImg = t.styleImg || [];
  15440. t.styleImg.forEach((src)=>{
  15441. this.styleTex.push({src:manage.dealURL(src)})
  15442. })
  15443. this.changeTex()
  15444. }
  15445. hot.prototype.update = function() {
  15446. var i = new r.Vector3
  15447. , o = new r.Vector3
  15448. , l = new r.Vector3
  15449. , c = new r.Vector3
  15450. , h = new r.Vector3;
  15451. return function(e, camera){
  15452. if(this.isSprite){
  15453. this.mesh.quaternion.copy(camera.quaternion)
  15454. }
  15455. if(window.hotNeedUpdatePannel == this){
  15456. this.updatePannel()
  15457. }
  15458. var p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : camera.position.distanceTo(this.mesh.position);
  15459. var d = a.hot.scale
  15460. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15461. i.copy(this.mesh.position).project(camera),
  15462. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15463. l.set(f / 2, 0, 0).add(o),
  15464. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15465. h.copy(c).unproject(camera);
  15466. var g = h.distanceTo(this.mesh.position)
  15467. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (hot.viewportScale() - 1);
  15468. this.discScale = g * m,
  15469. this.mesh.scale.set(this.discScale, this.discScale, this.discScale)
  15470. }
  15471. }()
  15472. hot.viewportScale = function() {
  15473. return hot.viewportWidth === $("#player").width() && hot.viewportHeight === $("#player").height() || (hot.viewportWidth = $("#player").width(),
  15474. hot.viewportHeight = $("#player").height(),
  15475. hot.currentViewportScale = Math.sqrt(Math.min(hot.viewportWidth, hot.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15476. hot.currentViewportScale
  15477. }
  15478. hot.prototype.setVisiblePanos = function(visibleData){
  15479. if (visibleData) {
  15480. this.visiblePanos = visibleData;
  15481. }
  15482. }
  15483. //绘制热点
  15484. hot.prototype.build = function(){
  15485. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15486. var shaderMaterial = new r.ShaderMaterial({
  15487. uniforms: t,
  15488. vertexShader: f.hot.vertexShader,
  15489. fragmentShader: f.hot.fragmentShader,
  15490. transparent: !0,
  15491. side:2
  15492. })
  15493. var sprite = new r.Mesh( geometry, shaderMaterial );
  15494. var hotIconScale = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15495. sprite.dynamic = true;
  15496. sprite.position.copy(this.position);
  15497. sprite.quaternion.copy(this.quaternion)
  15498. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15499. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15500. sprite.name = this.sid;
  15501. sprite.type = "hotSprite";
  15502. sprite.belongHot = this;
  15503. if(this.link) sprite.hotLink = this.link;
  15504. this.mesh = sprite;
  15505. this.model.add(sprite);
  15506. g_HotMeshes.push(sprite);
  15507. }
  15508. hot.prototype.createTitleElem = function(title){
  15509. if(!title)return;
  15510. var root = $("#hot");
  15511. var elem = $(`<div> ${title}</div>`)
  15512. root.append(elem);
  15513. this.titleElem = elem;
  15514. }
  15515. //在线状态
  15516. hot.prototype.setDeviceStatus = function(status){
  15517. if(status){
  15518. this.mesh.material.uniforms.opacity.value = 1
  15519. this.dontShine = false
  15520. }else{
  15521. this.mesh.material.uniforms.opacity.value = 0.5
  15522. this.dontShine = true
  15523. }
  15524. this.deviceStatus = status
  15525. }
  15526. hot.prototype.showPannel = function(o={}){
  15527. var hardware = this.infoAttribute.hardware
  15528. if(hardware && hardware.id!=void 0){
  15529. //获取设备状态
  15530. $(".waiting").addClass('showloading')
  15531. getDeviceInfo(hardware.id, (data)=>{
  15532. this.setDeviceStatus(data[0].status == 2)
  15533. if(this.deviceStatus){//在线
  15534. getAjax(`/api/device/getStatus/${hardware.code}`, (data)=> {
  15535. console.log(data)
  15536. if (data.code === 0) {
  15537. data = data.data;
  15538. var devType = hardwareTypes.find(type=>type.id == hardware.devTypeId).name
  15539. $("#hotPannel>div").addClass("hide")
  15540. if(devType == "灯控"){
  15541. $("#hotPannel>div[name='light']").removeClass("hide")
  15542. var ifOn = data.find(e=>e.paramCode == '02').paramValue == '1'
  15543. $("#hotPannel>div[name='light'] input").prop('checked', ifOn);
  15544. }else if(devType == "温湿度"){
  15545. $("#hotPannel>#temperature").removeClass("hide")
  15546. this.temperature = parseInt(temperature)
  15547. loadTemperature({
  15548. id:"temperature",//dom Id
  15549. val:70 //度数
  15550. })
  15551. }else if(devType == "摄像头"){
  15552. $("#hotPannel>.m-con").removeClass("hide")
  15553. /* "result": [
  15554. {
  15555. "id": "97347887d0dbad459bca30118fe9fae2",
  15556. "devtypeId": "ab073575c1628d2b42e2e915f1bee384",
  15557. "deviceCode": "34020000001320010058",
  15558. "paramCode": "12",
  15559. "paramValue": "0",
  15560. "createBy": "admin",
  15561. "createTime": "2021-03-19",
  15562. "updateBy": null,
  15563. "updateTime": "2021-03-19",
  15564. "paramName": null,
  15565. "devTypeParam": null
  15566. },
  15567. {
  15568. "id": "c8cc2ea0ad2a86c4fa267325caf69c1c",
  15569. "devtypeId": "ab073575c1628d2b42e2e915f1bee384",
  15570. "deviceCode": "34020000001320010058",
  15571. "paramCode": "11",
  15572. "paramValue": "1",
  15573. "createBy": "admin",
  15574. "createTime": "2021-03-19",
  15575. "updateBy": null,
  15576. "updateTime": "2021-03-19",
  15577. "paramName": null,
  15578. "devTypeParam": null
  15579. },
  15580. {
  15581. "id": "e6bc35c5c9ce26509091ca34e21bf237",
  15582. "devtypeId": "ab073575c1628d2b42e2e915f1bee384",
  15583. "deviceCode": "34020000001320010058",
  15584. "paramCode": "10",
  15585. "paramValue": "2",
  15586. "createBy": "admin",
  15587. "createTime": "2021-03-19",
  15588. "updateBy": null,
  15589. "updateTime": "2021-03-19",
  15590. "paramName": null,
  15591. "devTypeParam": null
  15592. }
  15593. {
  15594. "paramCode": "12",
  15595. "name": "类型",
  15596. "paramValue": "{\"0\":\"枪机\",\"1\":\"球机\"}"
  15597. },
  15598. {
  15599. "paramCode": "01",
  15600. "name": "通道号",
  15601. "paramValue": "34020000001320010058"
  15602. },
  15603. {
  15604. "paramCode": "10",
  15605. "name": "云台控制",
  15606. "paramValue": "{\"1\":\"支持\",\"2\":\"不支持\"}"
  15607. },
  15608. {
  15609. "paramCode": "11",
  15610. "name": "方向",
  15611. "paramValue": "{\"1\":\"左\",\"2\":\"右\",\"3\":\"上\",\"4\":\"下\"}"
  15612. }
  15613. ],
  15614. "msg": "操作成功"
  15615. */
  15616. /* "code": 0,
  15617. "data": {
  15618. "external": {
  15619. "rtmp": "rtmp://14.215.216.123:18080/rtp/00A1537C",
  15620. "flv": "http://14.215.216.123:18080/rtp/00A1537C.flv",
  15621. "wsFlv": "ws://14.215.216.123:18080/rtp/00A1537C.flv",
  15622. "rtsp": "rtsp://14.215.216.123:18080/rtp/00A1537C",
  15623. "hls": "http://14.215.216.123:18080/rtp/00A1537C/hls.m3u8"
  15624. },
  15625. "id": "34020000001320010058",
  15626. "interiorIp": "192.168.6.11",
  15627. "interior": {
  15628. "rtmp": "rtmp://192.168.6.11:18080/rtp/00A1537C",
  15629. "flv": "http://192.168.6.11:18080/rtp/00A1537C.flv",
  15630. "wsFlv": "ws://192.168.6.11:18080/rtp/00A1537C.flv",
  15631. "rtsp": "rtsp://192.168.6.11:18080/rtp/00A1537C",
  15632. "hls": "http://192.168.6.11:18080/rtp/00A1537C/hls.m3u8"
  15633. }
  15634. },
  15635. "msg": "操作成功" */
  15636. getAjax(`/api/device/getLive/${hardware.code}`, (data2)=> {
  15637. if(data2.code == 0){
  15638. loadMonitor({
  15639. id:"monitor",
  15640. url: data2.data.external.wsFlv //'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8'
  15641. })
  15642. }
  15643. },"获取视频地址失败" )
  15644. }else if(devType == "空调"){
  15645. $("#hotPannel>.ac-con").removeClass("hide")
  15646. /* 摆叶位置 06 可读写 下拉框 {"1":"上","2":"下","3":"左","4":"右"} - 编辑删除
  15647. 3 温度 05 可读写 文本框 - 编辑删除
  15648. 4 开关机 02 可读写 下拉框 {"0":"关","1":"开"} - 编辑删除
  15649. 5 风速 04 可读写 下拉框 {"1":"低风","2":"中风","3":"高风"} - 编辑删除
  15650. 6 摆叶状态 07 可读写 下拉框 {"0":"关","1":"开"} - 编辑删除
  15651. 7 模式 03 可读写 下拉框 {"0":"自动","1":"除湿","2":"冷风","3":"送风","4":"暖风"} -
  15652. */
  15653. var ifOn = data.find(e=>e.paramCode == '02').paramValue == '1'
  15654. var mode = data.find(e=>e.paramCode == '03').paramValue
  15655. var windSpeed = data.find(e=>e.paramCode == '04').paramValue
  15656. var temperature = data.find(e=>e.paramCode == '05').paramValue
  15657. var fanPos = data.find(e=>e.paramCode == '06').paramValue
  15658. var fanState = data.find(e=>e.paramCode == '07').paramValue == '1'
  15659. this.temperature = parseInt(temperature)
  15660. loadAirConditioner({
  15661. id:"air-conditioner",
  15662. name : hardware.name,
  15663. val:parseInt(temperature),
  15664. type: mode == 0 ? '自动': mode == 1 ? '除湿': mode == 2 ? '冷风': mode == 3 ? '送风' : '暖风',//模式
  15665. ifOn,//开关机
  15666. windSpeed : windSpeed == 1 ? "低风" : windSpeed == 2 ? "中风" : "高风",//风速
  15667. fanPos : fanPos == 1 ? "上" : fanPos == 2 ? "下" : fanPos == 3 ? "左" : "右",//摆叶位置
  15668. fanState //摆叶状态
  15669. })
  15670. }
  15671. $("#hotPannel>div").css("display","block");
  15672. $("#hotPannel .title").text(hardware.name);
  15673. this.updatePannel()
  15674. window.hotNeedUpdatePannel = this
  15675. if(o.focus){
  15676. if(player.mode == 'panorama'){
  15677. this.examine(player)
  15678. }else if(player.mode != 'transitioning'){
  15679. player.focusPoint({/* modelSize: size, */aim: this.mesh.position})
  15680. }
  15681. }
  15682. } else {
  15683. }
  15684. }, '获取数据失败')
  15685. }else{
  15686. $(".waiting").removeClass('showloading')
  15687. alert('该设备不在线')
  15688. }
  15689. })
  15690. return true
  15691. }else{
  15692. $("#hotPannel>div").css("display","");
  15693. }
  15694. }
  15695. hot.prototype.updatePannel = function(){
  15696. var pos = math.getPos2d(this.position, player.camera, $("#player")[0]);
  15697. if(pos.trueSide){
  15698. $("#hotPannel>div").css( {display:'block', "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15699. }else{
  15700. $("#hotPannel>div").css({display:'none'})
  15701. }
  15702. }
  15703. hot.prototype.showTitle = function(){
  15704. if(!this.titleElem)return;
  15705. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15706. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15707. this.titleElem.css("display","block");
  15708. }
  15709. hot.prototype.hideTitle = function(){
  15710. if(!this.titleElem)return;
  15711. this.titleElem.css("display","none");
  15712. }
  15713. hot.prototype.closestPanoTowardTag = function(e, t) {
  15714. var i = []
  15715. , o = []
  15716. , l = this.mesh.position;
  15717. if (e === s.PANORAMA) {
  15718. var c = .5
  15719. , h = t.position.clone().sub(l).normalize();
  15720. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  15721. // i.push(p.filters.isPanoAligned()),
  15722. // i.push(p.filters.inPanoDirection(l, h, c)),
  15723. // i.push(p.filters.isNeighbourPanoTo(t)),
  15724. o.push(p.scoreFunctions.direction(l, h))
  15725. }
  15726. var u = new r.Vector3
  15727. , d = function(e) {
  15728. u.copy(l).sub(e.position);
  15729. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15730. , i = a.tags.navigate.tiltTolerance;
  15731. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15732. }
  15733. , f = function(e) {
  15734. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15735. };
  15736. i.push(f, d, (pano)=>{ // add
  15737. return player.checkHasNeighbor(pano)
  15738. }),
  15739. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15740. var g = t.model.panos.sortByScore(i, o);
  15741. if (g && a.tags.navigate.lineOfSight) {
  15742. for (var m = 0; m < g.length; m++) {
  15743. var v = g[m].pano
  15744. , A = v.position.distanceTo(l);
  15745. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15746. var y = raycaster.intersectObjects(t.model.colliders);
  15747. // return g[0].pano;
  15748. if (0 === y.length || y[0].distance > A) {
  15749. console.log(m);
  15750. return v
  15751. }
  15752. }
  15753. return null
  15754. }
  15755. return g && g.length > 0 && g[0].pano
  15756. }
  15757. var getLink = function(link){
  15758. var src = '';
  15759. var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
  15760. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
  15761. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15762. return src
  15763. }
  15764. hot.prototype.examine = function(e, options) {
  15765. options = options || {}
  15766. var hotPop = document.getElementById('popup');
  15767. var hasHardware;
  15768. if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  15769. hasHardware = this.showPannel();
  15770. if(player.mode != 'panorama' || !player.currentPano)return;
  15771. }else{
  15772. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15773. var src = getLink(this.infoAttribute.iframe[0]);
  15774. if(this.linkType=="jumpLink"){
  15775. /* var newPage = window.open(src, "_blank" );
  15776. newPage.focus(); */
  15777. var href = window.location.href
  15778. var index = href.indexOf("&")
  15779. if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
  15780. history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
  15781. window.location.href = src
  15782. }else if(this.linkType=="iframeDiv"){
  15783. var div = document.createElement("div");
  15784. $("body").append(div);
  15785. div.style.position = 'fixed';
  15786. div.style.width = div.style.height = "100%";
  15787. div.style.left = div.style.top = '0';
  15788. div.style["z-index"] = "999"
  15789. var exit = document.createElement("div");
  15790. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15791. exit.style.position = 'absolute';
  15792. exit.style.width = exit.style.height = "50px";
  15793. exit.style.left = '17px'; exit.style.top = "20px"
  15794. exit.style.cursor = "pointer";
  15795. exit.style["background-repeat"] = "no-repeat";
  15796. exit.style["background-size"] = "25%";
  15797. exit.style["background-position"] = "center center";
  15798. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15799. exit.style["border-radius"] = "50%";
  15800. exit.style["z-index"] = "3"
  15801. exit.onclick = ()=>{
  15802. $(div).remove()
  15803. if(g_bgAudio && g_bgAudio.pauseByHot){
  15804. manage.switchBgmState(true)
  15805. }
  15806. }
  15807. var myElement = document.createElement("iframe");
  15808. myElement.style.position = 'absolute';
  15809. myElement.style.width = myElement.style.height = "100%";
  15810. myElement.style.left = myElement.style.top = '0';
  15811. myElement.src = src
  15812. div.appendChild(exit);
  15813. div.appendChild(myElement)
  15814. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15815. //g_bgAudio && g_bgAudio.pause();
  15816. if(g_bgAudio && !g_bgAudio.paused){
  15817. manage.switchBgmState(false);
  15818. g_bgAudio.pauseByHot = true
  15819. }
  15820. if(g_tourAudio)g_tourAudio.pause()
  15821. }
  15822. return;
  15823. }
  15824. if(!player.currentPano)return;
  15825. //获取那个热点的链接
  15826. if(this.link && !hasHardware){
  15827. g_currentHot = this;
  15828. hotPop.style.display = "block";
  15829. hotPop.classList.add("wait");
  15830. var myElement = document.createElement("iframe");
  15831. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15832. //g_bgAudio && g_bgAudio.pause();
  15833. if(g_bgAudio && !g_bgAudio.paused){
  15834. manage.switchBgmState(false);
  15835. g_bgAudio.pauseByHot = true
  15836. }
  15837. if(g_tourAudio)g_tourAudio.pause()
  15838. var src = getLink(this.link )
  15839. myElement.src = src;
  15840. myElement.id = "id1";
  15841. myElement.allowTransparency = "true";
  15842. // myElement.scrolling = "no";
  15843. var element=document.getElementById("id1"); //判断页面是否有iframe
  15844. if (typeof(element)== "undefined" || element == null){
  15845. document.querySelector(".popup-content").appendChild(myElement);
  15846. //移动端自动播放
  15847. var videoLoaddingResult = false
  15848. window.loaddingSuccess = function() {
  15849. videoLoaddingResult = true
  15850. }
  15851. setTimeout(function func() {
  15852. if (videoLoaddingResult) {
  15853. var $iframe = document.querySelector('#id1').contentWindow.document;
  15854. if($iframe.querySelector('video')){
  15855. $iframe.querySelector('video').play();
  15856. // alert($iframe.querySelector('video'));
  15857. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  15858. $iframe.querySelector('.playPause').classList.add("fa-pause");
  15859. }
  15860. }
  15861. if($iframe.querySelector('audio')){
  15862. $iframe.querySelector('audio').play();
  15863. }
  15864. } else {
  15865. setTimeout(func, 300)
  15866. }
  15867. }, 800);
  15868. }
  15869. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15870. }
  15871. }
  15872. // if(hotListSta) {
  15873. // hotPop.classList.remove("wait");
  15874. // return;
  15875. // }
  15876. var t = e.mode
  15877. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15878. , n = this.mesh.position;
  15879. e.flyingToTag = true;
  15880. var o = function() {
  15881. e.flyingToTag = false;
  15882. if(this.link){
  15883. hotPop && hotPop.classList.remove("wait");
  15884. }
  15885. }.bind(this);
  15886. if(settings.dontExamHot){
  15887. o();
  15888. return;
  15889. }
  15890. if (t === s.PANORAMA){
  15891. var l = {
  15892. pano: i,
  15893. lookAtPoint: n,
  15894. duration: null,
  15895. maxDistanceOverride: null,
  15896. skipWarpingCheck: !1
  15897. };
  15898. e.flyToPano(l, o)
  15899. }else {
  15900. var c = {
  15901. pano: i
  15902. };
  15903. if (n) {
  15904. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15905. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15906. }
  15907. c.callback = o,
  15908. c.duration = 1500,
  15909. c.mode = s.PANORAMA,
  15910. e.flyToNewMode(c)
  15911. }
  15912. },
  15913. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  15914. // if(window.MP_PREFETCHED_MODELDATA.special){
  15915. // specialScene.special().beforeImplement();
  15916. // }
  15917. //czj 判断是否是数组 如果不是将对象转换为数组
  15918. /* hot.prototype.conversionArray = function(obj){
  15919. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15920. var arr = []
  15921. for (var i in obj) {
  15922. arr.push(obj[i]); //属性
  15923. }
  15924. return arr
  15925. } */
  15926. hot.prototype.convertValue = function(v ,Type){
  15927. var value;
  15928. if(v instanceof Array){
  15929. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15930. value = new Type().fromArray(v);
  15931. }else{
  15932. for(let i in v){v[i] = parseFloat(v[i])}
  15933. value = new Type().copy(v);
  15934. }
  15935. return value
  15936. }
  15937. t.exports = hot;
  15938. }
  15939. , {
  15940. three: 217,
  15941. "../shaders":167,
  15942. "../enum/Viewmode":51,
  15943. "../objects/Panorama":148,
  15944. "../util/texture":194,
  15945. "../settings":166,
  15946. "../util/math": 190,
  15947. }],
  15948. /************************************创建热点模型************************************ */
  15949. 123: [function(e, t, i) {//tag
  15950. (function(i) {
  15951. "use strict";
  15952. function n(e, t, i) {
  15953. var n = i.version || "0";
  15954. "0" !== n && I.info("tag defined using version " + n),
  15955. this.model = e,
  15956. this.sid = t,
  15957. this.color = (new r.Color).set(i.color || l.tagDefault),
  15958. this.hoverColor = l._darken(this.color, .2),
  15959. this.floor = null,
  15960. this.floorIndex = i.floor,
  15961. this.mode = s.PANORAMA,
  15962. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15963. this.obj3d = null,
  15964. this.disc = null,
  15965. this.materials = {
  15966. disc: null,
  15967. pole: null
  15968. },
  15969. this.position = (new r.Vector3).copy(i.position),
  15970. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15971. this.discWorldPosition = null,
  15972. this.discScale = .05,
  15973. this.poleEnabled = i.stem.enabled,
  15974. this.billboard = new o(i.label,i.description,i.media,this),
  15975. this.visibleTransition = null,
  15976. this.hoveringDisc = !1
  15977. }
  15978. var r = e("three")
  15979. , o = e("./Billboard/Billboard")
  15980. , a = e("../settings")
  15981. , s = e("../enum/Viewmode")
  15982. , l = e("../enum/Colors")
  15983. , c = e("../enum/RenderLayers")
  15984. , h = e("../enum/RenderOrder")
  15985. , u = (e("../util/common"),
  15986. e("../util/math"))
  15987. , d = e("../util/texture")
  15988. , p = e("../objects/Panorama")
  15989. , f = e("../shaders")
  15990. , g = e("../util/transitions")
  15991. , m = e("../util/lerp")
  15992. , v = e("../util/easing")
  15993. , A = e("./Billboard/BillboardEvent")
  15994. , y = e("events").EventEmitter
  15995. , C = e("../util/logger")
  15996. , I = new C(i)
  15997. , E = d.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==")
  15998. , b = d.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")
  15999. , w = new r.PlaneBufferGeometry(1,1);
  16000. n.prototype = Object.create(y.prototype),
  16001. n.raycaster = new r.Raycaster,
  16002. n.prototype.bindEvents = function() {
  16003. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  16004. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  16005. }
  16006. ,
  16007. n.prototype.build = function() {
  16008. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  16009. this.floor && (this.billboard.build(this.model.sid),
  16010. this.obj3d = this.buildObject3D(),
  16011. this.floor.add(this.obj3d)),
  16012. this
  16013. }
  16014. ,
  16015. n.prototype.buildObject3D = function() {
  16016. var e = new r.Object3D;
  16017. e.position.copy(this.position);
  16018. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  16019. t.bg.value = b,
  16020. t.mask.value = E,
  16021. t.color.value.copy(this.color),
  16022. this.materials.disc = new r.RawShaderMaterial({
  16023. transparent: !0,
  16024. vertexShader: f.tagDisc.vertexShader,
  16025. fragmentShader: f.tagDisc.fragmentShader,
  16026. uniforms: t
  16027. }),
  16028. this.disc = new r.Mesh(w,this.materials.disc),
  16029. this.disc.layers.set(c.TAG),
  16030. this.disc.position.copy(this.discPosition),
  16031. this.disc.renderOrder = h.tagDisc,
  16032. this.disc.tag = this;
  16033. var i = this.buildPole();
  16034. return i.layers.set(c.TAG),
  16035. i.renderOrder = h.tagStem,
  16036. e.add(i),
  16037. e.layers.set(c.TAG),
  16038. e.add(this.disc)
  16039. }
  16040. ,
  16041. n.prototype.buildPole = function() {
  16042. var e = new r.BufferGeometry
  16043. , t = new Float32Array(6);
  16044. return t[0] = t[1] = t[2] = 0,
  16045. t[3] = this.discPosition.x,
  16046. t[4] = this.discPosition.y,
  16047. t[5] = this.discPosition.z,
  16048. e.addAttribute("position", new r.BufferAttribute(t,3)),
  16049. this.materials.pole = new r.LineBasicMaterial({
  16050. linewidth: a.tags.pole.width,
  16051. color: a.tags.pole.color,
  16052. opacity: 0,
  16053. visible: this.poleEnabled,
  16054. transparent: !0,
  16055. depthWrite: !1
  16056. }),
  16057. new r.Line(e,this.materials.pole)
  16058. }
  16059. ,
  16060. n.prototype.setFreeState = function(e) {
  16061. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  16062. this.materials.disc.uniforms.color.value = this.color
  16063. }
  16064. .bind(this))
  16065. }
  16066. ,
  16067. n.prototype.setHoverState = function(e) {
  16068. this.billboard.open(e),
  16069. this.materials.disc.uniforms.color.value = this.hoverColor
  16070. }
  16071. ,
  16072. n.prototype.hide = function(e, t) {
  16073. var i = $.Deferred();
  16074. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  16075. return i.resolve().promise();
  16076. e = e || 0,
  16077. t = t || 0,
  16078. g.cancel(this.visibleTransition);
  16079. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  16080. , r = t + e
  16081. , o = t / r;
  16082. return this.visibleTransition = g.start(function(e) {
  16083. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  16084. , i = m.property(e.materials.pole, "opacity", 0);
  16085. return function(n) {
  16086. t(n),
  16087. e.materials.pole && i(n)
  16088. }
  16089. }(this), r * n, function() {
  16090. i.resolve()
  16091. }, o, v[a.warp.blendEasing]),
  16092. i.promise()
  16093. }
  16094. ,
  16095. n.prototype.show = function(e, t) {
  16096. var i = $.Deferred();
  16097. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  16098. return i.resolve().promise();
  16099. e = e || 0,
  16100. t = t || 0,
  16101. g.cancel(this.visibleTransition);
  16102. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  16103. , r = t + e
  16104. , o = t / r;
  16105. return this.visibleTransition = g.start(function(e) {
  16106. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  16107. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  16108. return function(n) {
  16109. t(n),
  16110. e.materials.pole && i(n)
  16111. }
  16112. }(this), r * n, function() {
  16113. i.resolve()
  16114. }, o, v[a.warp.blendEasing]),
  16115. i.promise()
  16116. }
  16117. ,
  16118. n.prototype.closestPanoTowardTag = function(e, t) {
  16119. var i = []
  16120. , o = []
  16121. , l = this.disc.getWorldPosition();
  16122. if (e === s.PANORAMA) {
  16123. var c = .5
  16124. , h = t.position.clone().sub(l).normalize();
  16125. i.push(p.filters.isPanoAligned()),
  16126. i.push(p.filters.inPanoDirection(l, h, c)),
  16127. i.push(p.filters.isNeighbourPanoTo(t)),
  16128. o.push(p.scoreFunctions.direction(l, h))
  16129. }
  16130. var u = new r.Vector3
  16131. , d = function(e) {
  16132. u.copy(l).sub(e.position);
  16133. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  16134. , i = a.tags.navigate.tiltTolerance;
  16135. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  16136. }
  16137. , f = function(e) {
  16138. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  16139. };
  16140. i.push(f, d),
  16141. o.push(p.scoreFunctions.distanceSquared(this, -2));
  16142. var g = this.model.panos.sortByScore(i, o);
  16143. if (a.tags.navigate.lineOfSight) {
  16144. for (var m = 0; m < g.length; m++) {
  16145. var v = g[m].pano
  16146. , A = v.position.distanceTo(l);
  16147. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  16148. return null;
  16149. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  16150. var y = n.raycaster.intersectObjects(this.model.colliders);
  16151. if (0 === y.length || y[0].distance > A)
  16152. return v
  16153. }
  16154. return null
  16155. }
  16156. return g.length > 0 && g[0].pano
  16157. }
  16158. ,
  16159. n.prototype.examine = function(e) {
  16160. var t = e.mode
  16161. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  16162. , n = this.disc.getWorldPosition();
  16163. this.billboard.setActiveState();
  16164. var o = function() {
  16165. var t = this.billboard.getDimensions()
  16166. , n = new r.Vector3;
  16167. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  16168. n.unproject(e.camera),
  16169. e.flyToPano({
  16170. pano: i,
  16171. lookAtPoint: n
  16172. })
  16173. }
  16174. .bind(this);
  16175. if (t === s.PANORAMA)
  16176. if (i !== e.currentPano) {
  16177. var l = {
  16178. pano: i,
  16179. lookAtPoint: n,
  16180. duration: null,
  16181. maxDistanceOverride: null,
  16182. skipWarpingCheck: !1
  16183. };
  16184. e.flyToPano(l, o)
  16185. } else
  16186. setTimeout(function() {
  16187. this.billboard.open().then(function() {
  16188. o()
  16189. })
  16190. }
  16191. .bind(this), 0);
  16192. else {
  16193. var c = {
  16194. pano: i
  16195. };
  16196. if (n) {
  16197. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  16198. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  16199. }
  16200. c.callback = o,
  16201. c.duration = 1500,
  16202. c.mode = s.PANORAMA,
  16203. e.flyToNewMode(c)
  16204. }
  16205. }
  16206. ,
  16207. n.prototype.update = function(e, t) {
  16208. var i = new r.Vector3;
  16209. return function(e, t) {
  16210. this.discWorldPosition = this.disc.getWorldPosition(),
  16211. this.updateDisc(e, t),
  16212. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  16213. i.z < 1 && (i.y *= -1,
  16214. this.billboard.update(i, this.getDiscRadius(i, t))))
  16215. }
  16216. }(),
  16217. n.prototype.updateDisc = function(e, t) {
  16218. var i = new r.Vector3
  16219. , o = new r.Vector3
  16220. , l = new r.Vector3
  16221. , c = new r.Vector3
  16222. , h = new r.Vector3;
  16223. return function(e, t) {
  16224. var u = a.tags.visibility
  16225. , d = a.tags.disc.scale
  16226. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  16227. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  16228. this.obj3d.visible) {
  16229. this.disc.quaternion.copy(t.quaternion);
  16230. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  16231. i.copy(this.discWorldPosition).project(t),
  16232. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  16233. l.set(f / 2, 0, 0).add(o),
  16234. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  16235. h.copy(c).unproject(t);
  16236. var g = h.distanceTo(this.discWorldPosition)
  16237. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16238. this.discScale = g * m,
  16239. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16240. }
  16241. }
  16242. }(),
  16243. n.prototype.getDiscRadius = function(e, t) {
  16244. var i = new r.Vector3;
  16245. return function(e, t) {
  16246. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16247. Math.abs(e.x - i.x) * $("#player").width()
  16248. }
  16249. }(),
  16250. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16251. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16252. }
  16253. ,
  16254. n.prototype.offScreen = function(e, t) {
  16255. var i = e.getWorldPosition().project(t);
  16256. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16257. }
  16258. ,
  16259. n.viewportScale = function() {
  16260. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16261. n.viewportHeight = $("#player").height(),
  16262. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16263. n.currentViewportScale
  16264. }
  16265. ,
  16266. t.exports = n
  16267. }
  16268. ).call(this, "/js/tag/tag.js")
  16269. }
  16270. , {
  16271. "../enum/Colors": 19,
  16272. "../enum/RenderLayers": 41,
  16273. "../enum/RenderOrder": 42,
  16274. "../enum/Viewmode": 51,
  16275. "../objects/Panorama": 148,
  16276. "../settings": 166,
  16277. "../shaders": 167,
  16278. "../util/common": 185,
  16279. "../util/easing": 186,
  16280. "../util/lerp": 188,
  16281. "../util/logger": 189,
  16282. "../util/math": 190,
  16283. "../util/texture": 194,
  16284. "../util/transitions": 195,
  16285. "./Billboard/Billboard": 119,
  16286. "./Billboard/BillboardEvent": 120,
  16287. events: 202,
  16288. three: 217
  16289. }],
  16290. 124: [function(e, t, i) {
  16291. (function(i) {
  16292. "use strict";
  16293. function n() {
  16294. this.tagState = y.IDLE,
  16295. this.intersectTag = null,
  16296. this.hoveredTag = null,
  16297. this.activeTag = null,
  16298. this.tagDiscs = [],
  16299. this.raycaster = new r.Raycaster,
  16300. this.modelManager = null,
  16301. this.player = null,
  16302. this.totaltags = 0,
  16303. this.navigatingViaTag = !1,
  16304. this.enabled = !1
  16305. }
  16306. var r = e("three")
  16307. , o = e("../util/logger")
  16308. , a = e("../util/common")
  16309. , s = e("../controls/serializer")
  16310. , l = e("../objects/Snapshot")
  16311. , c = e("../settings")
  16312. , h = e("./Billboard/BillboardEvent")
  16313. , u = e("./Media/MediaEvent")
  16314. , d = e("./Media/LinkType")
  16315. , p = e("../enum/Viewmode")
  16316. , f = e("../enum/WarpStyle")
  16317. , g = e("../enum/BlackoutStyle")
  16318. , m = e("../enum/ModelManagerEvents")
  16319. , v = e("../enum/tagEvents")
  16320. , A = e("../enum/PlayerEvents")
  16321. , y = (e("../util/lerp"),
  16322. e("../enum/TagStates"))
  16323. , C = e("events").EventEmitter
  16324. , I = new o(i);
  16325. a.extend(n, C),
  16326. n.prototype.init = function(e, t) {
  16327. this.modelManager = e,
  16328. this.player = t,
  16329. this.updateModel(),
  16330. this.bindEvents()
  16331. }
  16332. ,
  16333. n.prototype.update = function(e) {
  16334. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16335. }
  16336. ,
  16337. n.prototype.updateTags = function(e, t, i, n) {
  16338. for (var r in this.model.tags)
  16339. this.model.tags[r].update(e, t, i, n)
  16340. }
  16341. ,
  16342. n.prototype.updateModel = function() {
  16343. this.model = this.modelManager.getActiveModel(),
  16344. this.gettagsFromModel(),
  16345. this.totaltags = Object.keys(this.model.tags).length
  16346. }
  16347. ,
  16348. n.prototype.gettagsFromModel = function() {
  16349. this.tagDiscs = [];
  16350. for (var e in this.model.tags) {
  16351. var t = this.model.tags[e].disc;
  16352. t && this.tagDiscs.push(t)
  16353. }
  16354. }
  16355. ,
  16356. n.prototype.bindEvents = function() {
  16357. function e() {
  16358. Object.keys(this.model.tags).forEach(function(e) {
  16359. var t = this.model.tags[e];
  16360. t.bindEvents(),
  16361. t.billboard.on(u.LINK_CLICK, function(e) {
  16362. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16363. }
  16364. .bind(this)),
  16365. t.billboard.on(u.IMAGE_OPENED, function() {
  16366. this.tagState = y.EXAMINE,
  16367. this.emit(u.IMAGE_OPENED)
  16368. }
  16369. .bind(this)),
  16370. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16371. }
  16372. .bind(this))
  16373. }
  16374. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16375. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16376. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16377. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16378. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16379. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16380. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16381. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16382. e.call(this)
  16383. }
  16384. ,
  16385. n.prototype.navigateViaLink = function(e) {
  16386. var t = s.deserialize(e);
  16387. if (t)
  16388. if (t.mode === p.PANORAMA) {
  16389. try {
  16390. this.player.model.panos.get(t.panoId)
  16391. } catch (e) {
  16392. return void I.warn("Unable to find panorama location", t.panoId)
  16393. }
  16394. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16395. } else {
  16396. var i = {
  16397. cameraMode: t.mode,
  16398. position: t.position,
  16399. quaternion: t.quaternion,
  16400. scanId: t.panoId,
  16401. orthoZoom: t.zoom,
  16402. floorVisibility: t.floorVisibility,
  16403. thumbUrl: null,
  16404. name: null
  16405. };
  16406. this.player.flyToNewMode({
  16407. mode: t.mode,
  16408. duration: c.warp.outsideTime,
  16409. warpDest: new l(i),
  16410. force: !0
  16411. })
  16412. }
  16413. }
  16414. ,
  16415. n.prototype.handleWarpStart = function(e, t, i, n) {
  16416. this.dismissExaminedTag(),
  16417. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16418. e && (i = g.END),
  16419. this.hideShowTagsForBlackoutStyle(i, n))
  16420. }
  16421. ,
  16422. n.prototype.handleWarpInterruption = function(e, t, i) {
  16423. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16424. this.hideShowTagsForBlackoutStyle(t, i)
  16425. }
  16426. ,
  16427. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16428. var i = 0
  16429. , n = 0
  16430. , r = t / 2;
  16431. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16432. e) {
  16433. case g.END:
  16434. this.hideAlltags(r);
  16435. break;
  16436. case g.BEGINNING:
  16437. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16438. break;
  16439. case g.NONE:
  16440. break;
  16441. case g.MIDDLE:
  16442. i = r,
  16443. n = r,
  16444. this.hideAlltags(n),
  16445. setTimeout(function() {
  16446. this.showAlltags(i)
  16447. }
  16448. .bind(this), n);
  16449. break;
  16450. case g.FADEIN:
  16451. setTimeout(function() {
  16452. this.showAlltags(r)
  16453. }
  16454. .bind(this), r)
  16455. }
  16456. }
  16457. ,
  16458. n.prototype.onPlayerModeChanging = function(e, t) {
  16459. t !== p.PANORAMA && this.dismissExaminedTag(),
  16460. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16461. var i = t !== p.OUTDOOR;
  16462. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16463. }
  16464. ,
  16465. n.prototype.onPanoChange = function(e, t) {
  16466. var i = this.navigatingViaTag;
  16467. if (this.navigatingViaTag = !1,
  16468. !i) {
  16469. this.dismissExaminedTag();
  16470. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16471. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16472. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16473. }
  16474. }
  16475. ,
  16476. n.prototype.onPlayerReady = function(e, t, i) {
  16477. this.startAlltags(e, t ? i : null)
  16478. }
  16479. ,
  16480. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16481. this.updateClosestTags(e)
  16482. }
  16483. ,
  16484. n.prototype.dismissExaminedTag = function() {
  16485. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16486. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16487. this.hoveredTag = null)
  16488. }
  16489. ,
  16490. n.prototype.startAlltags = function(e, t) {
  16491. this.model.shouldShowtags = c.tags.enabled,
  16492. this.enabled = !0,
  16493. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16494. t && setTimeout(function() {
  16495. this.activateTag(this.model.getTagBySid(t))
  16496. }
  16497. .bind(this), c.tags.startup.fadeInDuration / 2))
  16498. }
  16499. ,
  16500. n.prototype.showAlltags = function(e, t, i) {
  16501. function n() {
  16502. o++,
  16503. o === this.totaltags && (this.model.tagsShown = !0,
  16504. r.resolve())
  16505. }
  16506. var r = $.Deferred();
  16507. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16508. return r.resolve().promise();
  16509. var o = 0;
  16510. for (var a in this.model.tags) {
  16511. var s = this.model.tags[a];
  16512. s.show(e, t).done(n.bind(this))
  16513. }
  16514. return r.promise()
  16515. }
  16516. ,
  16517. n.prototype.hideAlltags = function(e, t) {
  16518. function i() {
  16519. r++,
  16520. r === this.totaltags && (this.model.tagsShown = !1,
  16521. n.resolve())
  16522. }
  16523. var n = $.Deferred()
  16524. , r = 0;
  16525. for (var o in this.model.tags) {
  16526. var a = this.model.tags[o];
  16527. a.hide(e, t).done(i.bind(this)),
  16528. a === this.activeTag && this.dismissActiveTag()
  16529. }
  16530. return n.promise()
  16531. }
  16532. ,
  16533. n.prototype.enableHovering = function() {
  16534. this.enabled = !0
  16535. }
  16536. ,
  16537. n.prototype.disableHovering = function() {
  16538. this.enabled = !1
  16539. }
  16540. ,
  16541. n.prototype.activateTag = function(e, t) {
  16542. t = t || y.EXAMINE,
  16543. this.activeTag = e,
  16544. this.activeTag.hoveringDisc = !0,
  16545. this.activeTag.setHoverState(t === y.EXAMINE),
  16546. this.tagState = t,
  16547. this.emit(v.TagActivated, e)
  16548. }
  16549. ,
  16550. n.prototype.dismissActiveTag = function() {
  16551. this.activeTag.hoveringDisc = !1,
  16552. this.activeTag.setFreeState(!0);
  16553. var e = this.activeTag;
  16554. this.activeTag = null,
  16555. this.tagState = y.IDLE,
  16556. this.emit(v.TagDismissed, e)
  16557. }
  16558. ,
  16559. n.prototype.clickedOnTag = function(e) {
  16560. var t = function() {
  16561. this.navigatingViaTag = !0,
  16562. this.activeTag.examine(this.player),
  16563. this.emit(v.TagNavigation, this.activeTag)
  16564. }
  16565. .bind(this);
  16566. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16567. this.activeTag = this.intersectTag,
  16568. t(),
  16569. !0) : (this.dismissActiveTag(),
  16570. !1)
  16571. }
  16572. ,
  16573. n.prototype.intersecttag = function() {
  16574. var e = new r.Vector3
  16575. , t = new r.Vector3
  16576. , i = new r.Vector3;
  16577. return function(n, r, o) {
  16578. if (!this.enabled)
  16579. return null;
  16580. var a = null
  16581. , s = this.tagDiscs.filter(function(e) {
  16582. return e.parent.visible
  16583. });
  16584. if (s.length > 0) {
  16585. var l = this.model.floors.reduce(function(e, t) {
  16586. return t.hidden ? e : e.concat(t.collider.children)
  16587. }, s);
  16588. e.set(n.x, n.y, -1).unproject(o),
  16589. t.set(n.x, n.y, 1).unproject(o),
  16590. i.copy(t).sub(e).normalize(),
  16591. this.raycaster.set(e, i);
  16592. var c = this.raycaster.intersectObjects(l);
  16593. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16594. }
  16595. return this.intersectTag = a,
  16596. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16597. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16598. this.hoveredTag = a
  16599. }
  16600. .bind(this)),
  16601. a.billboard.on(h.LEAVE, function() {
  16602. this.hoveredTag = null
  16603. }
  16604. .bind(this))),
  16605. this.activateTag(a, y.BROWSE))),
  16606. a
  16607. }
  16608. }(),
  16609. n.prototype.rankedtagInDirection = function() {
  16610. var e = []
  16611. , t = []
  16612. , i = new r.Vector3
  16613. , n = new r.Vector3
  16614. , o = new r.Vector3;
  16615. return function(r, a, s, l) {
  16616. var c = 0;
  16617. t.length = 0;
  16618. for (var h = 0; h < this.closesttags.length; h++) {
  16619. var u = this.closesttags[h];
  16620. n.copy(u.position),
  16621. n.add(u.discPosition),
  16622. i.copy(a),
  16623. i.sub(n).negate(),
  16624. i.normalize();
  16625. var d = i.dot(l);
  16626. if (d >= 0) {
  16627. o.copy(n),
  16628. o.project(s);
  16629. var p = this.intersecttag(o, !1, s);
  16630. if (p) {
  16631. if (c >= e.length)
  16632. for (var f = 0; f < 64; f++)
  16633. e.push({
  16634. tag: u,
  16635. dot: d
  16636. });
  16637. var g = e[c];
  16638. g.tag = u,
  16639. g.dot = d,
  16640. g.position = math.projectPositionToCanvas(n, s),
  16641. t.push(g),
  16642. c++
  16643. }
  16644. }
  16645. }
  16646. return t.sort(function(e, t) {
  16647. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16648. }),
  16649. r < t.length ? t[r].tag : null
  16650. }
  16651. }(),
  16652. n.prototype.updateClosestTags = function() {
  16653. var e = new r.Vector3
  16654. , t = 30;
  16655. return function(i) {
  16656. this.closesttags || (this.closesttags = []),
  16657. this.closesttags.length = 0;
  16658. var n = this.model.tags;
  16659. if (n)
  16660. for (var r in n)
  16661. if (n.hasOwnProperty(r)) {
  16662. var o = n[r]
  16663. , a = o.position;
  16664. e.copy(i),
  16665. e.sub(a).negate();
  16666. var s = e.lengthSq();
  16667. s < t && this.closesttags.push(o)
  16668. }
  16669. }
  16670. }(),
  16671. t.exports = n
  16672. }
  16673. ).call(this, "/js/tag/tagManager.js")
  16674. }
  16675. , {
  16676. "../controls/serializer": 14,
  16677. "../enum/BlackoutStyle": 18,
  16678. "../enum/tagEvents": 32,
  16679. "../enum/ModelManagerEvents": 33,
  16680. "../enum/PlayerEvents": 40,
  16681. "../enum/TagStates": 44,
  16682. "../enum/Viewmode": 51,
  16683. "../enum/WarpStyle": 52,
  16684. "../objects/Snapshot": 153,
  16685. "../settings": 166,
  16686. "../util/common": 185,
  16687. "../util/lerp": 188,
  16688. "../util/logger": 189,
  16689. "./Billboard/BillboardEvent": 120,
  16690. "./Media/LinkType": 130,
  16691. "./Media/MediaEvent": 131,
  16692. events: 202,
  16693. three: 217
  16694. }],
  16695. 125: [function(e, t, i) {
  16696. (function(i) {
  16697. "use strict";
  16698. function n() {
  16699. this.embedWrapper = null,
  16700. this.embedElement = null
  16701. }
  16702. var r = e("../../util/ajax")
  16703. , o = e("./mediaSettings")
  16704. , a = e("../../settings")
  16705. , s = e("../../util/logger")
  16706. , l = new s(i);
  16707. n.prototype.createDomElement = function() {
  16708. return this.embedWrapper = document.createElement("div"),
  16709. this.embedWrapper.classList.add("tag-embed"),
  16710. this.embedWrapper.classList.add("hidden"),
  16711. this.embedWrapper
  16712. }
  16713. ,
  16714. n.prototype.load = function(e) {
  16715. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16716. return new Promise(function(e, i) {
  16717. r.get(t).then(function(t) {
  16718. if (t = JSON.parse(t),
  16719. t.html && t.html.indexOf("<script") === -1) {
  16720. this.embedWrapper.innerHTML = t.html;
  16721. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16722. if (this.embedWrapper.style.width = n + "px",
  16723. t.height) {
  16724. var r = t.height / t.width;
  16725. this.embedWrapper.style.height = n * r + "px"
  16726. }
  16727. this.embedElement = this.embedWrapper.firstChild;
  16728. var a = [];
  16729. try {
  16730. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16731. } catch (e) {
  16732. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16733. }
  16734. a.forEach(function(e) {
  16735. e.setAttribute("target", "_blank")
  16736. }),
  16737. this.embedElement.classList.add("hidden"),
  16738. this.embedWrapper.classList.remove("hidden"),
  16739. e()
  16740. } else
  16741. i("Not a valid embed")
  16742. }
  16743. .bind(this), function(e) {
  16744. i(e.response)
  16745. })
  16746. }
  16747. .bind(this))
  16748. }
  16749. ,
  16750. n.prototype.show = function() {
  16751. this.embedElement && this.embedElement.classList.remove("hidden")
  16752. }
  16753. ,
  16754. n.prototype.hide = function() {
  16755. this.embedElement && this.embedElement.classList.add("hidden")
  16756. }
  16757. ,
  16758. t.exports = n
  16759. }
  16760. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16761. }
  16762. , {
  16763. "../../settings": 166,
  16764. "../../util/ajax": 181,
  16765. "../../util/logger": 189,
  16766. "./mediaSettings": 132
  16767. }],
  16768. 126: [function(e, t, i) {
  16769. (function(i) {
  16770. "use strict";
  16771. function n(e) {
  16772. o.call(this),
  16773. this.options = e,
  16774. this.playerControls = null,
  16775. this.state = s.NOT_READY
  16776. }
  16777. var r = e("../../util/browser")
  16778. , o = e("./EmbedlyEmbed")
  16779. , a = e("../../util/logger")
  16780. , s = (new a(i),
  16781. Object.freeze({
  16782. NOT_READY: "player.not.ready",
  16783. CUED: "player.cued",
  16784. PLAYING: "player.playing",
  16785. PAUSED: "player.paused"
  16786. }));
  16787. n.prototype = Object.create(o.prototype),
  16788. n.prototype.createDomElement = function() {
  16789. return this.embedWrapper = document.createElement("div"),
  16790. this.embedWrapper.classList.add("tag-video"),
  16791. this.embedWrapper.classList.add("hidden"),
  16792. this.embedWrapper
  16793. }
  16794. ,
  16795. n.prototype.load = function(e) {
  16796. var t = function() {
  16797. function e(e) {
  16798. this.playerState = s.CUED,
  16799. this.options.startMuted && this.playerControls.mute()
  16800. }
  16801. function t(e) {
  16802. this.playerState = e
  16803. }
  16804. function i(e) {
  16805. this.playerControls.setCurrentTime(0),
  16806. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16807. }
  16808. this.playerControls = new playerjs.Player(this.embedElement),
  16809. this.playerControls.on("ready", e.bind(this)),
  16810. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16811. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16812. this.playerControls.on("ended", i.bind(this))
  16813. }
  16814. .bind(this);
  16815. return o.prototype.load.call(this, e).then(t.bind(this))
  16816. }
  16817. ,
  16818. n.prototype.play = function() {
  16819. var e = r.isMobile();
  16820. return function() {
  16821. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16822. }
  16823. }(),
  16824. n.prototype.pause = function() {
  16825. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16826. }
  16827. ,
  16828. t.exports = n
  16829. }
  16830. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16831. }
  16832. , {
  16833. "../../util/browser": 182,
  16834. "../../util/logger": 189,
  16835. "./EmbedlyEmbed": 125
  16836. }],
  16837. 127: [function(e, t, i) {
  16838. (function(i) {
  16839. "use strict";
  16840. function n(e) {
  16841. function t() {
  16842. return a.debug("requesting file from embedly:", e.href),
  16843. r.get(e.href, {
  16844. responseType: e.responseType
  16845. }).then(function(t) {
  16846. return a.debug("requesting file finished:", e.href),
  16847. t
  16848. })
  16849. }
  16850. function i() {}
  16851. return s = new Promise(function(e, n) {
  16852. s.catch(i).then(function() {
  16853. t().then(e, n)
  16854. })
  16855. }
  16856. )
  16857. }
  16858. var r = e("../../util/ajax")
  16859. , o = (e("./mediaSettings"),
  16860. e("../../util/logger"))
  16861. , a = new o(i)
  16862. , s = Promise.resolve();
  16863. t.exports.enqueue = n
  16864. }
  16865. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16866. }
  16867. , {
  16868. "../../util/ajax": 181,
  16869. "../../util/logger": 189,
  16870. "./mediaSettings": 132
  16871. }],
  16872. 128: [function(e, t, i) {
  16873. (function(i) {
  16874. "use strict";
  16875. function n() {
  16876. this.imageWrapper = null,
  16877. this.width = 0,
  16878. this.height = 0,
  16879. this.aspect = 1
  16880. }
  16881. var r = e("./MediaEvent")
  16882. , o = e("./EmbedlyQueue")
  16883. , a = e("events").EventEmitter
  16884. , s = e("../../util/logger")
  16885. , l = e("../../settings");
  16886. new s(i);
  16887. n.prototype = Object.create(a.prototype),
  16888. n.prototype.createDomElement = function() {
  16889. return this.imageWrapper = document.createElement("div"),
  16890. this.imageWrapper.classList.add("tag-image"),
  16891. this.imageWrapper.classList.add("hidden"),
  16892. this.imageWrapper.addEventListener("click", function(e) {
  16893. e.stopPropagation(),
  16894. this.emit(r.IMAGE_OPENING),
  16895. this.imageWrapper.style.pointerEvents = "none"
  16896. }
  16897. .bind(this)),
  16898. this.imageWrapper
  16899. }
  16900. ,
  16901. n.prototype.onClosed = function() {
  16902. this.imageWrapper.style.pointerEvents = "auto"
  16903. }
  16904. ,
  16905. n.prototype.load = function(e) {
  16906. var t = Math.max(window.screen.height, window.screen.width)
  16907. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16908. return new Promise(function(e, t) {
  16909. function n(t) {
  16910. var i = t.target;
  16911. this.width = i.naturalWidth,
  16912. this.height = i.naturalHeight,
  16913. this.aspect = this.width / this.height;
  16914. var n = t.target.src;
  16915. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16916. this.imageWrapper.style.width = this.width + "px",
  16917. this.imageWrapper.style.height = this.height + "px",
  16918. this.imageWrapper.classList.remove("hidden"),
  16919. e()
  16920. }
  16921. o.enqueue({
  16922. href: i,
  16923. responseType: "arraybuffer"
  16924. }).then(function(e) {
  16925. var t = new Uint8Array(e)
  16926. , i = new Blob([t])
  16927. , r = new window.Image;
  16928. r.addEventListener("load", n.bind(this));
  16929. var o = URL.createObjectURL(i);
  16930. r.src = o
  16931. }
  16932. .bind(this), t)
  16933. }
  16934. .bind(this))
  16935. }
  16936. ,
  16937. t.exports = n
  16938. }
  16939. ).call(this, "/js/tag/Media/Image.js")
  16940. }
  16941. , {
  16942. "../../settings": 166,
  16943. "../../util/logger": 189,
  16944. "./EmbedlyQueue": 127,
  16945. "./MediaEvent": 131,
  16946. events: 202
  16947. }],
  16948. 129: [function(e, t, i) {
  16949. "use strict";
  16950. function n(e) {
  16951. this.label = e.label,
  16952. this.href = e.url,
  16953. this.type = this.updateLinkForType(),
  16954. this.domElement = null,
  16955. this.id = c++
  16956. }
  16957. var r = e("./LinkType")
  16958. , o = e("./MediaEvent")
  16959. , a = e("../../util/browser")
  16960. , s = e("../../analytics")
  16961. , l = e("events").EventEmitter
  16962. , c = 0;
  16963. n.prototype = Object.create(l.prototype),
  16964. n.prototype.updateLinkForType = function() {
  16965. function e(e) {
  16966. var t = new RegExp("[#&?]start=([^#&?]*)")
  16967. , i = t.exec(e);
  16968. return i[1]
  16969. }
  16970. function t(e) {
  16971. return e + "&play=1"
  16972. }
  16973. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16974. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16975. r.NAVIGATION) : (this.href = t(this.href),
  16976. r.MODEL) : r.EXT_LINK
  16977. }
  16978. ;
  16979. var h = {};
  16980. n.prototype.createDomElement = function() {
  16981. function e(e) {
  16982. switch (e.stopPropagation(),
  16983. h[this.id] = !0,
  16984. s.trackAlways("click_tag_link", {
  16985. link_type: this.type,
  16986. link_count: c,
  16987. links_clicked: Object.keys(h).length
  16988. }),
  16989. this.type) {
  16990. case r.MODEL:
  16991. window.location.replace(this.href);
  16992. break;
  16993. case r.EXT_LINK:
  16994. window.open(this.href, "_blank")
  16995. }
  16996. this.emit(o.LINK_CLICK, {
  16997. type: this.type,
  16998. url: this.href
  16999. })
  17000. }
  17001. if (this.domElement = document.createElement("a"),
  17002. this.domElement.classList.add("tag-link"),
  17003. this.domElement.textContent = this.label,
  17004. this.type === r.EXT_LINK) {
  17005. this.domElement.textContent += " ";
  17006. var t = document.createElement("i");
  17007. t.classList.add("icon-ext-link"),
  17008. t.title = "Link to external web site",
  17009. this.domElement.appendChild(t)
  17010. }
  17011. return this.domElement.addEventListener("click", e.bind(this)),
  17012. this.domElement
  17013. }
  17014. ,
  17015. t.exports = n
  17016. }
  17017. , {
  17018. "../../analytics": 4,
  17019. "../../util/browser": 182,
  17020. "./LinkType": 130,
  17021. "./MediaEvent": 131,
  17022. events: 202
  17023. }],
  17024. 130: [function(e, t, i) {
  17025. "use strict";
  17026. t.exports = {
  17027. NAVIGATION: "navigation",
  17028. MODEL: "model",
  17029. EXT_LINK: "ext-link"
  17030. }
  17031. }
  17032. , {}],
  17033. 131: [function(e, t, i) {
  17034. "use strict";
  17035. t.exports = Object.freeze({
  17036. LINK_CLICK: "mtmedia.link",
  17037. IMAGE_LOADED: "mtmedia.image.loaded",
  17038. IMAGE_OPENING: "mtmedia.image.opening",
  17039. IMAGE_OPENED: "mtmedia.image.opened",
  17040. IMAGE_CLOSING: "mtmedia.image.closing",
  17041. IMAGE_CLOSED: "mtmedia.image.closed",
  17042. VIDEO_START: "mtmedia.video.start",
  17043. VIDEO_PAUSE: "mtmedia.video.pause",
  17044. VIDEO_ENDED: "mtmedia.video.end"
  17045. })
  17046. }
  17047. , {}],
  17048. 132: [function(e, t, i) {
  17049. "use strict";
  17050. t.exports = Object.freeze({
  17051. maxEmbedWidth: 350,
  17052. defaultAspectRatio: .75
  17053. })
  17054. }
  17055. , {}],
  17056. 133: [function(e, t, i) {
  17057. "use strict";
  17058. t.exports = Object.freeze({
  17059. TEXT: "text",
  17060. LINK: "link",
  17061. IMAGE: "photo",
  17062. VIDEO: "video",
  17063. RICH: "rich"
  17064. })
  17065. }
  17066. , {}],
  17067. 134: [function(e, t, i) {
  17068. "use strict";
  17069. function n(e) {
  17070. this.capabilities = {
  17071. links: {
  17072. enable: e.supportLinks,
  17073. keepLabels: e.keepLinkLabels
  17074. }
  17075. }
  17076. }
  17077. var r = e("./DescriptionChunkType");
  17078. n.prototype.parse = function(e, t) {
  17079. var i = []
  17080. , n = e.split("[").map(function(e, t) {
  17081. return 0 === t ? e : "[" + e
  17082. });
  17083. return n.forEach(function(e) {
  17084. var n = this.findMarkdown(e);
  17085. if (n) {
  17086. if (n.url.indexOf("javascript:") !== -1)
  17087. return;
  17088. this.addLinkChunk(i, n, t),
  17089. this.addTextChunk(i, e.slice(n.markdown.length))
  17090. } else
  17091. this.addTextChunk(i, e)
  17092. }
  17093. .bind(this)),
  17094. i
  17095. }
  17096. ,
  17097. n.prototype.findMarkdown = function(e) {
  17098. var t = /\[([^\]]*)\]\((.*)\)/
  17099. , i = e.match(t);
  17100. if (i) {
  17101. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  17102. 0 !== r); )
  17103. o++;
  17104. var a = n.length - o;
  17105. return {
  17106. markdown: i[0].substring(0, i[0].length - a),
  17107. label: i[1],
  17108. url: i[2].substring(0, o)
  17109. }
  17110. }
  17111. }
  17112. ,
  17113. n.prototype.addTextChunk = function(e, t) {
  17114. 0 !== t.length && e.push({
  17115. type: r.TEXT,
  17116. text: t
  17117. })
  17118. }
  17119. ,
  17120. n.prototype.addLinkChunk = function(e, t) {
  17121. if (!this.capabilities.links.enable)
  17122. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  17123. var i = {
  17124. label: t.label,
  17125. url: t.url
  17126. };
  17127. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  17128. e.push({
  17129. type: r.LINK,
  17130. link: i
  17131. })
  17132. }
  17133. ,
  17134. t.exports = n
  17135. }
  17136. , {
  17137. "./DescriptionChunkType": 133
  17138. }],
  17139. 135: [function(e, t, i) {
  17140. (function(i) {
  17141. "use strict";
  17142. var n = e("../util/logger")
  17143. , r = new n(i)
  17144. , o = {
  17145. parseIdsFromChunkName: function(e, t) {
  17146. t.floorId = o.parseFloor(e),
  17147. t.roomId = o.parseRoom(e)
  17148. },
  17149. parseFloor: function(e) {
  17150. var t = e.match(/_group([0-9]+)/);
  17151. if (!t)
  17152. return 0;
  17153. try {
  17154. return parseInt(t[1], 10)
  17155. } catch (e) {
  17156. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  17157. 0
  17158. }
  17159. },
  17160. parseRoom: function(e) {
  17161. var t = e.match(/_sub([0-9]+)/);
  17162. if (!t)
  17163. return -1;
  17164. try {
  17165. return parseInt(t[1], 10)
  17166. } catch (e) {
  17167. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  17168. 0
  17169. }
  17170. }
  17171. };
  17172. t.exports = o
  17173. }
  17174. ).call(this, "/js/model/Chunks.js")
  17175. }
  17176. , {
  17177. "../util/logger": 189
  17178. }],
  17179. 136: [function(e, t, i) {
  17180. (function(i) {
  17181. "use strict";
  17182. function n(e) {
  17183. s.call(this),
  17184. this.model = e,
  17185. this.exploded = !1
  17186. }
  17187. var r = e("../objects/Floor")
  17188. , o = (e("../settings"),
  17189. e("../util/logger"))
  17190. , a = e("../util/transitions")
  17191. , s = e("../util/IndexedCollection")
  17192. , l = e("../util/common")
  17193. , c = e("../util/easing");
  17194. new o(i);
  17195. l.inherit(n, s),
  17196. n.prototype.add = function(e) {
  17197. s.prototype.add.call(this, e),
  17198. this.model.add(e)
  17199. }
  17200. ,
  17201. n.prototype.getIndex = function(e) {
  17202. return e.floorIndex
  17203. }
  17204. ,
  17205. n.prototype.build = function() {
  17206. this.list.forEach(function(e) {
  17207. e.build()
  17208. })
  17209. }
  17210. ,
  17211. n.prototype.size = function() {
  17212. return this.length
  17213. }
  17214. ,
  17215. n.prototype.sort = function() {
  17216. s.prototype.sort.call(this, function(e, t) {
  17217. return e.floorIndex - t.floorIndex
  17218. })
  17219. }
  17220. ,
  17221. n.prototype.nextFloor = function(e, t) {
  17222. return this.index[e.floorIndex + t] || null
  17223. }
  17224. ,
  17225. n.prototype.getFloorAtPoint = function(e) {
  17226. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  17227. var r = this.list[n]
  17228. , o = r.distanceToPoint(e);
  17229. (!t || i > o) && (i = o,
  17230. t = r)
  17231. }
  17232. return t
  17233. }
  17234. ,
  17235. n.prototype.getOrMakeFloor = function(e) {
  17236. var t = this.index[e];
  17237. return t || (t = new r(this.model,e),
  17238. this.add(t)),
  17239. t
  17240. }
  17241. ,
  17242. n.prototype.hide = function() {
  17243. this.list.forEach(function(e) {
  17244. e.hide()
  17245. })
  17246. }
  17247. ,
  17248. n.prototype.show = function() {
  17249. this.list.forEach(function(e) {
  17250. e.show()
  17251. })
  17252. }
  17253. ,
  17254. n.prototype.names = function() {
  17255. return this.list.reduce(function(e, t) {
  17256. return e.concat(t.name)
  17257. }, [])
  17258. }
  17259. ,
  17260. n.prototype.toggleExplodeHorizontal = function() {
  17261. function e(e, t) {
  17262. r.copy(e.position),
  17263. e.position.x = i[e.floorIndex] * t,
  17264. e.position.y = 1 * e.floorIndex * t,
  17265. r.sub(e.position).multiplyScalar(-1),
  17266. e.panos.forEach(function(e) {
  17267. e.translate(r)
  17268. })
  17269. }
  17270. var t, i = [], n = 0;
  17271. this.list.forEach(function(e, r, o) {
  17272. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17273. n += t,
  17274. i[r] = n
  17275. }),
  17276. i = i.map(function(e) {
  17277. return e - n / 2
  17278. });
  17279. var r = this.list[0].position.clone();
  17280. this.exploded ? this.list.forEach(function(t) {
  17281. a.start(function(i) {
  17282. e(t, 1 - i)
  17283. }, 1500, null, 0, c.easeOutExpo)
  17284. }) : this.list.forEach(function(t) {
  17285. a.start(function(i) {
  17286. e(t, i)
  17287. }, 1500, null, 0, c.easeOutExpo)
  17288. }),
  17289. this.exploded = !this.exploded
  17290. }
  17291. ,
  17292. n.prototype.toggleExplodeVertical = function() {
  17293. function e(e, i) {
  17294. var n = n.copy(e.position);
  17295. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17296. n.sub(e.position).multiplyScalar(-1),
  17297. e.panos.forEach(function(e) {
  17298. e.translate(n)
  17299. })
  17300. }
  17301. var t = this.model.size;
  17302. this.list[0].position.clone();
  17303. this.exploded ? this.list.forEach(function(t) {
  17304. a.start(function(i) {
  17305. e(t, 1 - i)
  17306. }, 1500, null, 0, c.easeOutExpo)
  17307. }) : this.list.forEach(function(t) {
  17308. a.start(function(i) {
  17309. e(t, i)
  17310. }, 1500, null, 0, c.easeOutExpo)
  17311. }),
  17312. this.exploded = !this.exploded
  17313. }
  17314. ,
  17315. t.exports = n
  17316. }
  17317. ).call(this, "/js/model/FloorCollection.js")
  17318. }
  17319. , {
  17320. "../objects/Floor": 146,
  17321. "../settings": 166,
  17322. "../util/IndexedCollection": 175,
  17323. "../util/common": 185,
  17324. "../util/easing": 186,
  17325. "../util/logger": 189,
  17326. "../util/transitions": 195
  17327. }],
  17328. 137: [function(e, t, i) {
  17329. (function(i) {
  17330. "use strict";
  17331. function n() {
  17332. c.call(this)
  17333. }
  17334. var r = e("../settings")
  17335. , o = e("../util/logger")
  17336. , a = e("../enum/Viewmode")
  17337. , s = e("../objects/Snapshot")
  17338. , l = (e("../util/math"),
  17339. e("../util/common"))
  17340. , c = e("../util/IndexedCollection")
  17341. , h = new o(i);
  17342. l.inherit(n, c),
  17343. n.prototype.getImage = function(e) {
  17344. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17345. }
  17346. ,
  17347. n.prototype.filterByModesAndReel = function(e, t) {
  17348. for (var i = [], n = 0; n < t.length; n += 1) {
  17349. var r = t[n]
  17350. , o = this.index[r.sid];
  17351. o && i.push(o)
  17352. }
  17353. var s = e[a.DOLLHOUSE]
  17354. , l = e[a.FLOORPLAN];
  17355. i = i.filter(function(e) {
  17356. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17357. return !0;
  17358. var t;
  17359. try {
  17360. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17361. } catch (e) {
  17362. return h.debug(e.message),
  17363. !1
  17364. }
  17365. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17366. }),
  17367. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17368. this.list = i,
  17369. this.reIndex()
  17370. }
  17371. ,
  17372. n.prototype.getHeroLocations = function(e) {
  17373. if (0 === this.list.length)
  17374. return [];
  17375. for (var t = [], i = 0; i < this.list.length; ++i) {
  17376. var o = this.list[i]
  17377. , l = o.thumbnail_signed_src
  17378. , c = o.name || '';
  17379. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  17380. if (!r.show360Views.enabled && o.metadata.scan_id) {
  17381. var h = e.get(o.metadata.scan_id);
  17382. if (h && !h.isAligned())
  17383. continue
  17384. }
  17385. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  17386. if (u === a.MESH)
  17387. continue;
  17388. if(window.isLocal)var src = manage.dealURL(l)
  17389. else var src = g_version === "one" ? g_Prefix + l + "?"+ randomTime().getTime() : (l.substr(0,4)=="http" ? l + "?"+ randomTime().getTime() : '//' + l + "?"+ randomTime().getTime())
  17390. var d = {
  17391. cameraMode: u,
  17392. position: o.metadata.camera_position,
  17393. quaternion: o.metadata.camera_quaternion,
  17394. zoom: o.metadata.zoom,
  17395. panoId: o.metadata.scan_id,
  17396. orthoZoom: o.metadata.ortho_zoom,
  17397. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  17398. thumbUrl: src,
  17399. name: n.filterImageName(c),
  17400. sid: o.sid //xzw add g_tourAudio要用,
  17401. }
  17402. , p = new s(d);
  17403. t.push(p)
  17404. }
  17405. }
  17406. return t
  17407. }
  17408. ,
  17409. n.prototype.getIndex = function(e) {
  17410. return e.sid
  17411. }
  17412. ,
  17413. n.filterImageName = function(e) {
  17414. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17415. }
  17416. ,
  17417. t.exports = n
  17418. }
  17419. ).call(this, "/js/model/ImageCollection.js")
  17420. }
  17421. , {
  17422. "../enum/Viewmode": 51,
  17423. "../objects/Snapshot": 153,
  17424. "../settings": 166,
  17425. "../util/IndexedCollection": 175,
  17426. "../util/common": 185,
  17427. "../util/logger": 189,
  17428. "../util/math": 190
  17429. }],
  17430. 138: [function(e, t, i) {
  17431. (function(i) {
  17432. "use strict";
  17433. function n() {
  17434. u.call(this)
  17435. }
  17436. var r = e("../label/Label")
  17437. , o = e("../settings")
  17438. , a = e("../util/logger")
  17439. , s = e("../util/math")
  17440. , l = e("../util/ajax")
  17441. , c = e("./RoomCollection")
  17442. , h = e("../util/common")
  17443. , u = e("../util/IndexedCollection");
  17444. new a(i);
  17445. h.inherit(n, u),
  17446. n.prototype.getIndex = function(e) {
  17447. return e.labelId
  17448. }
  17449. ,
  17450. n.prototype.associateWithRooms = function(e) {
  17451. this.forEach(function(t) {
  17452. e.forEach(function(e) {
  17453. e.roomId === t.roomId && (t.room = e)
  17454. })
  17455. })
  17456. }
  17457. ,
  17458. n.prototype.createFromLabelData = function(e) {
  17459. e.forEach(function(e) {
  17460. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17461. t = c.generateRoomId(e.floorId, t);
  17462. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17463. i.position = s.convertWorkshopVector(i.position),
  17464. this.add(i),
  17465. i.build()
  17466. }
  17467. .bind(this))
  17468. }
  17469. ,
  17470. n.prototype.load = function(e, t) {
  17471. return l.get(e, {
  17472. responseType: "json",
  17473. auth: t ? o.authorizationHeader : null
  17474. }).done(function(e) {
  17475. var t = [];
  17476. for (var i in e) {
  17477. var n = e[i];
  17478. t.push(n)
  17479. }
  17480. this.createFromLabelData(t)
  17481. }
  17482. .bind(this))
  17483. }
  17484. ,
  17485. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17486. var t = -1;
  17487. if (e) {
  17488. var i = e.split("_");
  17489. t = parseInt(i[0])
  17490. }
  17491. return t
  17492. }
  17493. ,
  17494. t.exports = n
  17495. }
  17496. ).call(this, "/js/model/LabelCollection.js")
  17497. }
  17498. , {
  17499. "../label/Label": 90,
  17500. "../settings": 166,
  17501. "../util/IndexedCollection": 175,
  17502. "../util/ajax": 181,
  17503. "../util/common": 185,
  17504. "../util/logger": 189,
  17505. "../util/math": 190,
  17506. "./RoomCollection": 141
  17507. }],
  17508. 139: [function(e, t, i) {
  17509. (function(i) {
  17510. "use strict";
  17511. function n(e, t) {
  17512. o.Object3D.call(this)
  17513. this.sid = window.number;//t.sid,
  17514. this.data = t,
  17515. this.options = e,
  17516. this.urls = new s(e.urlFiles),
  17517. this.isPublic = void 0 !== t.is_public && t.is_public,
  17518. this.images = new _(this),
  17519. this.images.extend(t.images),
  17520. this.heroImage = this.images.getImage(t.icon),
  17521. this.heroLocations = [],
  17522. this.outdoorPanoLocations = [],
  17523. this.floors = new d(this),
  17524. this.floorsEnabled = void 0 === e.floors || e.floors,
  17525. this.changingFloor = !1,
  17526. this.chunks = [],
  17527. this.panos = new A,
  17528. this.colliders = [],
  17529. this.loadPanosPromise = null,
  17530. this.loadMeshTexturesPromise = null,
  17531. this.auxDataPromise = null,
  17532. this.meshTexturesLoaded = !1,
  17533. this.meshTextures = [],
  17534. this.tags = {},
  17535. this.tagsShown = !1,
  17536. this.shouldShowtags = !1,
  17537. this.has360Views = !1,
  17538. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17539. this.supportedModes = {},
  17540. this.supportedModes[c.PANORAMA] = !0,
  17541. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17542. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17543. this.supportedModes[c.TRANSITIONING] = !0,
  17544. this.supportsTiles = this.configureTiling(),
  17545. // this.supportsVR = t.is_vr,
  17546. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17547. this.mode = c.DOLLHOUSE,
  17548. this.size = null,
  17549. this.center = null,
  17550. this.boundingBox = new o.Box3,
  17551. this.currentFloor = null,
  17552. this.allFloorsVisible = !0,
  17553. this.projectedPano0 = null,
  17554. this.projectedPano1 = null,
  17555. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17556. this.addFloor(new u(this,t,e.trim()))
  17557. }
  17558. .bind(this)),
  17559. this.waitQueue = [],
  17560. this.on("load", function(e) {
  17561. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17562. return !e.isLoadedCallback()
  17563. }),
  17564. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17565. }
  17566. .bind(this)),
  17567. this.setupCustomProperties()
  17568. this.hots = {};
  17569. }
  17570. function r() {
  17571. try {
  17572. var e = document.createElement("canvas")
  17573. , t = e.getContext("webgl");
  17574. t || (t = e.getContext("experimental-webgl"));
  17575. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17576. return i
  17577. } catch (e) {
  17578. return 0
  17579. }
  17580. }
  17581. var o = e("three")
  17582. , a = e("../util/ajax")
  17583. , s = e("../util/ModelUrls")
  17584. , l = e("../objects/BoundingTextureSkybox")
  17585. , c = e("../enum/Viewmode")
  17586. , h = e("../enum/RenderOrder")
  17587. , u = (e("../enum/AlignmentType"),
  17588. e("../objects/Floor"))
  17589. , d = e("./FloorCollection")
  17590. , p = e("../objects/Chunk")
  17591. , f = (e("../objects/Room"),
  17592. e("../objects/Snapshot"),
  17593. e("../label/Label"),
  17594. e("../util/math"),
  17595. e("../settings"))
  17596. ,ss = e("../shaders")
  17597. , g = e("../util/logger")
  17598. , m = e("../tag/tag")
  17599. , v = (e("../tag/tagManager"),
  17600. e("../objects/Panorama"))
  17601. , A = e("../util/PanoramaCollection")
  17602. , y = e("../loaders/ModelLoader")
  17603. , C = e("../loaders/ModelTextureLoader")
  17604. , I = e("../loaders/SweepDataLoader")
  17605. , E = e("../util/transitions")
  17606. , b = e("../util/common")
  17607. , es = e("../util/easing")
  17608. ,lerp = e("../util/lerp")
  17609. ,tex = e("../util/texture")
  17610. , w = e("./../util/browser")
  17611. , _ = e("./ImageCollection")
  17612. , T = e("./RoomCollection")
  17613. , x = e("./LabelCollection")
  17614. , S = e("./Chunks")
  17615. , M = e("./../util/showcase")
  17616. , R = e("../exception/BasicException")
  17617. , P = (e("../constants")
  17618. ,e("events").EventEmitter)
  17619. ,Hot = e("hot")
  17620. , O = new g(i);
  17621. n.prototype = Object.create(o.Object3D.prototype),
  17622. b.extend(n, P),
  17623. n.prototype.setupCustomProperties = function() {
  17624. var e = f.modelAlpha;
  17625. Object.defineProperty(this, "alpha", {
  17626. get: function() {
  17627. return e
  17628. },
  17629. set: function(t) {
  17630. e = t,
  17631. this.chunks.forEach(function(t) {
  17632. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17633. })
  17634. }
  17635. })
  17636. }
  17637. ,
  17638. n.prototype.configureTiling = function() {
  17639. var e = r();
  17640. if (e < 2048)
  17641. return !1;
  17642. O.warn("Max cube texture size: " + e);
  17643. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17644. var i = f.tiling.tilingFlagNames[t];
  17645. if ("1" === w.valueFromHash(i, null))
  17646. return !0;
  17647. if ("0" === w.valueFromHash(i, null))
  17648. return !1
  17649. }
  17650. //--------------------------------------------许钟文-------------------------------------------
  17651. //return true;
  17652. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17653. //--------------------------------------------e n d -------------------------------------------
  17654. }
  17655. ,
  17656. n.prototype.toggleAlpha = function() {
  17657. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17658. }
  17659. ,
  17660. n.prototype.load = function(e) {
  17661. var t = function() {
  17662. return $.when(this.loadPanos(), this.loadMesh())
  17663. }
  17664. , i = this.urls.init().then(t.bind(this));
  17665. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17666. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17667. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17668. }
  17669. ,
  17670. n.prototype.loadMesh = function() {
  17671. function e(e) {
  17672. O.error(e),
  17673. n.reject("loading-failed")
  17674. }
  17675. function t(e, t) {
  17676. n.notify(e, t)
  17677. }
  17678. function i(e, t) {
  17679. if (0 === e.length) {
  17680. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17681. r.supportedModes[c.DOLLHOUSE] = !1,
  17682. r.supportedModes[c.FLOORPLAN] = !1;
  17683. var i = new p({
  17684. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17685. });
  17686. i.material.visible = !1,
  17687. i.rotateX(-Math.PI / 2),
  17688. i.geometry.computeBoundingBox(),
  17689. e = [i]
  17690. }
  17691. e.forEach(function(e) {
  17692. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17693. r.addChunk(t, e)
  17694. }),
  17695. r.floors.sort(),
  17696. n.resolve(r)
  17697. }
  17698. var n = $.Deferred()
  17699. , r = this;
  17700. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17701. n.promise()
  17702. }
  17703. ,
  17704. n.prototype.loadMeshTextures = function() {
  17705. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17706. this.meshTexturesLoaded = !0
  17707. }
  17708. .bind(this)),
  17709. this.loadTexturesPromise)
  17710. }
  17711. ,
  17712. /* n.prototype.loadtags = function() {//xzw改
  17713. var e = $.Deferred();
  17714. if (!f.tags.enabled)
  17715. return e.resolve();
  17716. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17717. t = "data/" + this.sid + "/tags.json"
  17718. return a.get(t, {
  17719. responseType: "json",
  17720. auth: this.isPublic ? null : f.authorizationHeader
  17721. }).done(function(t) {
  17722. var i = 0
  17723. , n = 0;
  17724. for (var r in t) {
  17725. var o = t[r];
  17726. o.enabled && (n++,
  17727. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17728. i++))
  17729. }
  17730. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17731. e.resolve()
  17732. }
  17733. .bind(this)).fail(function() {
  17734. O.warn("Getting tags failed, not displaying tags."),
  17735. e.resolve()
  17736. }),
  17737. e
  17738. } */
  17739. n.prototype.shineHots = function(){ //xzw
  17740. E.trigger({
  17741. func: function(e) {
  17742. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17743. for(var i in this.hots){
  17744. this.hots[i].dontShine || (this.hots[i].mesh.material.uniforms.opac.value = opa);
  17745. }
  17746. }.bind(this),
  17747. cycling: true,
  17748. duration: 3000,
  17749. //easing: "easeInOutQuad",
  17750. name: "hotShine"
  17751. })
  17752. },
  17753. n.prototype.createHotItem = function(data, hots) {
  17754. var docFragment = document.createDocumentFragment();
  17755. var keyAry = Object.keys(data);
  17756. for(var i = 0; i < keyAry.length; i++){
  17757. var li = document.createElement('li');
  17758. var span = document.createElement('span');
  17759. span.innerHTML = data[keyAry[i]].title || data[keyAry[i]].infoAttribute.title || '热点';
  17760. // console.log(span.innerHTML);
  17761. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  17762. li.appendChild(span);
  17763. docFragment.appendChild(li);
  17764. }
  17765. var ul = document.querySelector('#hotListContent ul');
  17766. ul.appendChild(docFragment);
  17767. console.log(docFragment);
  17768. }
  17769. n.prototype.loadOverlays = function(overlays){
  17770. var overlays = window.data2 && window.data2.overlays
  17771. overlays && overlays.forEach((info)=>{
  17772. new Overlay(info)
  17773. })
  17774. }
  17775. n.prototype.loadhots = function() {//xzw
  17776. var e = $.Deferred();
  17777. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17778. return a.get(t, {
  17779. responseType: "json",
  17780. auth: this.isPublic ? null : f.authorizationHeader
  17781. }).done(function(t) {
  17782. window.data2 = t;
  17783. if(!t){
  17784. console.error("data2 is null")
  17785. }else{
  17786. g_data2 = hotMatcher(t);
  17787. this.hotsCount = 0;
  17788. /* for(var i in t.hots){
  17789. this.hotsCount ++;
  17790. this.hots[i] = new Hot(i, t.hots[i], this);
  17791. t.hots[i].infoAttribute || (t.hots[i].infoAttribute = {})
  17792. this.hots[i].initStyleImg(t.hots[i].infoAttribute);
  17793. };
  17794. window.hotData = t.hots
  17795. t.hots && this.createHotItem(t.hots, this.hots); */
  17796. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17797. window.hotData = {}
  17798. if(t.hots){
  17799. var sids = Object.keys(t.hots).sort((a,b)=>{return t.hots[a].order - t.hots[b].order});
  17800. sids.forEach((sid)=>{
  17801. this.hotsCount++,
  17802. this.hots[sid] = new Hot(sid,t.hots[sid] ,this);
  17803. t.hots[sid].infoAttribute || (t.hots[sid].infoAttribute = {})
  17804. this.hots[sid].initStyleImg(t.hots[sid].infoAttribute);
  17805. window.hotData[sid] = t.hots[sid];
  17806. })
  17807. }
  17808. this.createHotItem(window.hotData, this.hots);
  17809. /* {
  17810. "code": "34020000001320010024",
  17811. "name": "鹰眼",
  17812. "devTypeName": "摄像头",
  17813. "id": "2855ab1ed6e7a9d3b35467673796bfa9",
  17814. "devTypeId": "ab073575c1628d2b42e2e915f1bee384",
  17815. "status": "2"
  17816. },
  17817. {
  17818. "code": "34020000001320010025",
  17819. "name": "鹰眼广角",
  17820. "devTypeName": "摄像头",
  17821. "id": "bd6eca7d285ee120b9f5e59f259d7bc5",
  17822. "devTypeId": "ab073575c1628d2b42e2e915f1bee384",
  17823. "status": "2"
  17824. }, */
  17825. getDeviceInfo(null,(data)=>{//更新状态
  17826. for(var id in hardwareHotList){
  17827. var hot = hardwareHotList[id];
  17828. var info = data.find(item=>item.id == id)
  17829. if(info){
  17830. hot.setDeviceStatus(info.status == 2)
  17831. }
  17832. }
  17833. })
  17834. g_index = w.valueFromHash("m");
  17835. if(t.tourAudio){
  17836. g_tourAudio = new Audio;
  17837. g_tourAudio.loop = false;
  17838. g_tourAudio.addEventListener('ended', function () {
  17839. var ev = document.createEvent("MouseEvent");
  17840. ev.initEvent("tourAudioEnded",true,true);
  17841. window.dispatchEvent(ev);
  17842. });
  17843. };
  17844. }
  17845. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17846. /* var dataJsPromise = $.Deferred();
  17847. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17848. a.get(dataJsUrl,{
  17849. responseType: "json",
  17850. auth: this.isPublic ? null : f.authorizationHeader
  17851. }).done(function(data) {
  17852. window.hotData = data;
  17853. this.createHotItem(data, this.hots);
  17854. for(let i in this.hots){//add
  17855. data[i] && this.hots[i].initStyleImg(data[i]);
  17856. }
  17857. dataJsPromise.resolve();
  17858. }.bind(this)).fail(function(){
  17859. console.log('Data.js is empty');
  17860. dataJsPromise.resolve();
  17861. }) */
  17862. e.resolve();
  17863. }.bind(this)).fail(function() {
  17864. console.log('没有热点');
  17865. e.resolve()
  17866. }),
  17867. e
  17868. }
  17869. ,
  17870. n.prototype.loadPanos = function() {
  17871. if (this.loadPanosPromise)
  17872. return this.loadPanosPromise;
  17873. var e = new I(this);
  17874. return this.loadPanosPromise = e.load().then(function(e) {
  17875. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17876. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17877. else console.log(e.uuid)
  17878. }
  17879. .bind(this))),
  17880. this.panos.extend(e.map(function(e) {
  17881. return new v(this,e.uuid,e,this.supportsTiles)
  17882. }
  17883. .bind(this))),
  17884. this.panos.forEach(function(e) {
  17885. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17886. var i = this.panos.get(t);
  17887. i && this.panos.setNeighbour(e, i, !0)
  17888. }
  17889. .bind(this)),
  17890. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17891. }
  17892. .bind(this)),
  17893. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17894. this.supportedModes[c.PANORAMA] = !1),
  17895. $.when(this)
  17896. }
  17897. .bind(this)),
  17898. this.loadPanosPromise
  17899. }
  17900. ,
  17901. n.prototype.loadHighlightReel = function() {//xzw
  17902. var e = $.Deferred()
  17903. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17904. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17905. return a.get(t, {
  17906. responseType: "json",
  17907. auth: this.isPublic ? null : f.authorizationHeader
  17908. }).done(function(t) {
  17909. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17910. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17911. e.resolve()
  17912. }
  17913. .bind(this)).fail(function() {
  17914. O.warn("Getting highlight reel failed, no highlights available"),
  17915. e.resolve()
  17916. }),
  17917. e
  17918. }
  17919. ,
  17920. n.prototype.waitForLoad = function(e, t) {
  17921. t() || (this.waitQueue.push({
  17922. object: e,
  17923. isLoadedCallback: t
  17924. }),
  17925. 1 === this.waitQueue.length && this.emit("waiting"))
  17926. }
  17927. ,
  17928. n.prototype.hide = function() {
  17929. this.floors.hide()
  17930. }
  17931. ,
  17932. n.prototype.show = function() {
  17933. this.floors.show()
  17934. }
  17935. ,
  17936. n.prototype.floorNames = function() {
  17937. return this.floors.names()
  17938. }
  17939. ,
  17940. n.prototype.warpDestFloors = function(e, t) {
  17941. if (!e || this.floors.length !== e.length)
  17942. return void this.toggleAllFloors(!0);
  17943. var i = e.findIndex(function(e) {
  17944. return e
  17945. }
  17946. .bind(this));
  17947. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17948. }
  17949. ,
  17950. n.prototype.setFloor = function(e, t, i) {
  17951. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17952. this.allFloorsVisible = !1,
  17953. this._setFloor(e, t, i)
  17954. }
  17955. ,
  17956. n.prototype.toggleAllFloors = function(e) {
  17957. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17958. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17959. this._setFloor(this.currentFloor)
  17960. }
  17961. ,
  17962. n.prototype._setFloor = function(e, t, i) {
  17963. t = t || this.mode,
  17964. this.emit("floor.changed", e, t, this.currentFloor),
  17965. this.currentFloor = e;
  17966. var n;
  17967. if (t === c.PANORAMA) {
  17968. if (this.show(),
  17969. this.shouldShowtags && this.tagsShown)
  17970. for (n in this.tags)
  17971. this.tags[n].show(f.showFloorDuration)
  17972. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17973. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17974. }
  17975. .bind(this)),
  17976. this.shouldShowtags && this.tagsShown))
  17977. for (n in this.tags) {
  17978. var r = this.tags[n];
  17979. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17980. }
  17981. var o = this
  17982. , a = e;
  17983. E.start(function() {}, f.showFloorDelay, function() {
  17984. o.floors.forEach(function(e) {
  17985. e.chunks.forEach(function(t) {
  17986. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17987. })
  17988. })
  17989. }
  17990. .bind(this))
  17991. }
  17992. ,
  17993. n.prototype.toggleExplode = function() {
  17994. this.floors.toggleExplodeHorizontal()
  17995. }
  17996. ,
  17997. n.prototype.toggleExplodeUp = function() {
  17998. this.floors.toggleExplodeVertical()
  17999. }
  18000. ,
  18001. n.prototype.nextFloor = function(e) {
  18002. return this.floors.nextFloor(this.currentFloor, e)
  18003. }
  18004. ,
  18005. n.prototype.addFloor = function(e) {
  18006. this.floors.add(e)
  18007. }
  18008. ,
  18009. n.prototype.getFloorAtPoint = function(e) {
  18010. return this.floors.getFloorAtPoint(e)
  18011. }
  18012. ,
  18013. n.prototype.getTagBySid = function(e) {
  18014. return this.tags[e]
  18015. }
  18016. ,
  18017. n.prototype.addChunk = function(e, t) {
  18018. this.floors.getOrMakeFloor(e).addChunk(t),
  18019. this.chunks.push(t)
  18020. }
  18021. ,
  18022. n.prototype.setMode = function(e) {
  18023. if (!this.supportedModes[e])
  18024. throw new R("Mode not supported for this model: " + e);
  18025. this.mode = e;
  18026. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  18027. this.chunks.forEach(function(t) {
  18028. t.setMode(e)
  18029. })
  18030. }
  18031. ,
  18032. n.prototype.build = function() {
  18033. this.heroLocations = this.images.getHeroLocations(this.panos);
  18034. var e = function() {
  18035. 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()
  18036. }
  18037. .bind(this)();
  18038. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  18039. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  18040. }
  18041. .bind(this)) || e,
  18042. null === this.heroImage && O.warn("No hero image defined."),
  18043. this.currentFloor = this.floors.last(),
  18044. this.floors.build(),
  18045. this.colliders = this.floors.reduce(function(e, t) {
  18046. return e.concat(t.collider.children)
  18047. }, []),
  18048. this.panos.forEach(function(e) {
  18049. e.build1(),
  18050. e.on("enter", function() {
  18051. e.floor !== this.currentFloor && this.setFloor(e.floor)
  18052. }
  18053. .bind(this))
  18054. }
  18055. .bind(this)),
  18056. this.panos.forEach(function(e) {
  18057. e.build2()
  18058. }),
  18059. this.floors.forEach(function(e) {
  18060. this.boundingBox.union(e.boundingBox)
  18061. }
  18062. .bind(this)),
  18063. this.size = this.boundingBox.size(),
  18064. this.center = this.boundingBox.center(),
  18065. this.floors.forEach(function(e) {
  18066. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  18067. }
  18068. .bind(this)),
  18069. this.panos.populate_path_graph(),
  18070. this.skybox = new l(this.boundingBox),
  18071. this.skybox.matrixWorldNeedsUpdate = !0,
  18072. this.add(this.skybox);
  18073. setTimeout(function(){
  18074. this.hotsCount && this.shineHots();
  18075. }.bind(this),1300);//xzw 热点开始闪烁
  18076. for (var t in this.tags)
  18077. this.tags[t].build();
  18078. this.createFloorLogo()
  18079. return O.debug("Done building model"),
  18080. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  18081. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  18082. this.buildRooms(),
  18083. this.labels.associateWithRooms(this.rooms),
  18084. $.when(this)
  18085. }
  18086. ,
  18087. n.prototype.createFloorLogo = function(){
  18088. console.log('createFloorLogo')
  18089. if(this.floorLogos || !settings.floorlogoURL)return;
  18090. var url = settings.floorlogoURL
  18091. var map = tex.load(url);//可以追加done
  18092. this.floorLogos = [];
  18093. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  18094. var material = new o.MeshBasicMaterial({
  18095. opacity:0,
  18096. map:map,
  18097. side: o.DoubleSide,
  18098. transparent: !0,
  18099. depthWrite: !1,
  18100. depthTest:false//改 在chunk\skybox外也可看到
  18101. });
  18102. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  18103. //var s = (Store.metadata.floorLogoSize || 100)/100;
  18104. //logo.scale.set(s,s,s);
  18105. logo.position.set(0,-1.5,0);
  18106. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  18107. logo.renderOrder = 100;//cover the videoSkybox
  18108. //logo.layers.set(0)
  18109. this.add(logo);
  18110. this.floorLogos.push(logo);
  18111. }
  18112. this.floorLogos[1].visible = false;
  18113. }
  18114. n.prototype.adjustfloorLogoHeight = function(o){
  18115. var h = player.currentPano.floorPosition.y + 0.01;
  18116. this.floorLogos[1].position.setY(h);
  18117. this.floorLogos[0].position.setY(h);
  18118. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  18119. },
  18120. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  18121. if(!this.floorLogos) return;
  18122. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  18123. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  18124. if(!o.dur){//立刻
  18125. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  18126. this.floorLogos[o.index].material.opacity = o.opa;
  18127. }else{
  18128. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  18129. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  18130. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  18131. }
  18132. },
  18133. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  18134. var lastQ, lastP;
  18135. var equals = function(v1, v2, min){
  18136. return Math.abs(v1-v2) < min
  18137. }
  18138. var isSame = function(now, last, k){//如果和上次相同就不改变
  18139. if(!last)return false;
  18140. var R = k.sceneRenderer;
  18141. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  18142. //暂时:
  18143. var min = 0.0008
  18144. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  18145. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  18146. return same;
  18147. }
  18148. return function(Q, k){
  18149. if(!Q)return;
  18150. /* if(Config.ifFish && window.lowFPS){
  18151. this.fLCompute++;
  18152. if(R.AFPS < 38){
  18153. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  18154. else if(k.flying && k.fLCompute%2 !=1) return;
  18155. k.fLCompute %= 4;
  18156. }else if(R.AFPS < 45){
  18157. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  18158. else if(k.flying && k.fLCompute%2 !=1) return;
  18159. k.fLCompute %= 6;
  18160. }else{
  18161. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  18162. //else if(k.flying && k.fLCompute%2 !=1) return;
  18163. k.fLCompute %= 2;
  18164. }
  18165. } */
  18166. var sameQ, sameP, quaternion, visible;
  18167. for(var i=0;i<2;i++){
  18168. var logo = this.floorLogos[i];
  18169. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18170. visible = true;
  18171. }
  18172. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18173. var c = k.cameraControls.activeControl;
  18174. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18175. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18176. for(var i=0;i<2;i++){
  18177. var logo = this.floorLogos[i];
  18178. if(!sameQ){
  18179. if(!quaternion){
  18180. var a = new THREE.Vector3(0,0,-1);
  18181. a.applyQuaternion(Q);
  18182. a.setY(0);
  18183. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18184. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18185. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18186. quaternion.multiply(a);
  18187. }
  18188. logo.quaternion.copy(quaternion);
  18189. }
  18190. }
  18191. }
  18192. }()
  18193. n.prototype.loadLabels = function() {//xzw
  18194. this.labels = new x(this);
  18195. var e = $.Deferred();
  18196. //加载俯视图的标签 注释这个备注就会加载
  18197. /* window.MP_PREFETCHED_MODELDATA.model.player_options.labels ? this.showingLabels = true : '';
  18198. if (!this.showingLabels) */
  18199. return e.resolve();
  18200. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18201. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18202. console.log(t);
  18203. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18204. O.warn("Getting labels failed, not displaying labels."),
  18205. e.resolve()
  18206. }),
  18207. e
  18208. }
  18209. ,
  18210. n.prototype.buildRooms = function() {
  18211. this.rooms = new T(this),
  18212. this.rooms.createFromChunks(this.chunks),
  18213. this.rooms.calcRoomBoundaries()
  18214. }
  18215. ,
  18216. n.prototype.updateProjectedPanos = function() {
  18217. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18218. }
  18219. ,
  18220. n.prototype.setProjectedPanos = function(e, t, i) {
  18221. void 0 !== i && null !== i || (i = !0),
  18222. i = !!i,
  18223. this.projectedPano0 = e,
  18224. this.projectedPano1 = t,
  18225. this.skybox.material.setProjectedPanos(e, t, i),
  18226. this.chunks.forEach(function(n) {
  18227. n.materialInside.setProjectedPanos(e, t, i)
  18228. })
  18229. }
  18230. ,
  18231. n.prototype.setSide = function(e) {
  18232. this.floors.forEach(function(t) {
  18233. t.collider.material.side = e
  18234. })
  18235. }
  18236. ,
  18237. n.prototype.heroCount = function() {
  18238. return this.heroLocations ? this.heroLocations.length : 0
  18239. }
  18240. ,
  18241. n.prototype.getHeroDescriptorByIndex = function(e) {
  18242. if (e < 0)
  18243. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18244. null;
  18245. var t = this.heroCount();
  18246. if (t < 1)
  18247. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18248. null;
  18249. var i = this.heroLocations[e];
  18250. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18251. null) : i
  18252. }
  18253. ,
  18254. n.prototype.findPanoramicHero = function() {
  18255. for (var e in this.heroLocations)
  18256. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18257. return this.heroLocations[e];
  18258. return null
  18259. }
  18260. ,
  18261. n.prototype.listImagePanos = function() {
  18262. var e = []
  18263. , t = this;
  18264. return this.images.forEach(function(i) {
  18265. if (i.metadata && i.metadata.scan_id) {
  18266. var n = t.panos.get(i.metadata.scan_id);
  18267. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18268. }
  18269. }),
  18270. e
  18271. }
  18272. ,
  18273. n.prototype.fadePanoMarkers = function(e, t) {
  18274. this.panos.fadeMarkerOpacity(e, t)
  18275. }
  18276. ,
  18277. n.prototype.setSweepVisibility = function(e) {
  18278. this.panos.forEach(function(t) {
  18279. t.marker && (t.marker.visible = e)
  18280. })
  18281. }
  18282. ,
  18283. n.prototype.outsideAllowed = function() {
  18284. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18285. }
  18286. ,
  18287. t.exports = n
  18288. }
  18289. ).call(this, "/js/model/Model.js")
  18290. }
  18291. , {
  18292. "../constants": 8,
  18293. "../enum/AlignmentType": 17,
  18294. "../enum/RenderOrder": 42,
  18295. "../enum/Viewmode": 51,
  18296. "../exception/BasicException": 55,
  18297. "../label/Label": 90,
  18298. "../loaders/ModelLoader": 105,
  18299. "../loaders/ModelTextureLoader": 106,
  18300. "../loaders/SweepDataLoader": 107,
  18301. "../tag/tag": 123,
  18302. "../tag/tagManager": 124,
  18303. "../objects/BoundingTextureSkybox": 143,
  18304. "../objects/Chunk": 144,
  18305. "../objects/Floor": 146,
  18306. "../objects/Panorama": 148,
  18307. "../objects/Room": 150,
  18308. "../objects/Snapshot": 153,
  18309. "../settings": 166,
  18310. "../shaders": 167,
  18311. "../util/ModelUrls": 177,
  18312. "../util/PanoramaCollection": 178,
  18313. "../util/ajax": 181,
  18314. "../util/common": 185,
  18315. "../util/easing": 186,
  18316. "../util/lerp": 188,
  18317. "../util/logger": 189,
  18318. "../util/math": 190,
  18319. "../util/texture": 194,
  18320. "../util/transitions": 195,
  18321. "./../util/browser": 182,
  18322. "./../util/showcase": 193,
  18323. "./Chunks": 135,
  18324. "./FloorCollection": 136,
  18325. "./ImageCollection": 137,
  18326. "./LabelCollection": 138,
  18327. "./RoomCollection": 141,
  18328. events: 202,
  18329. three: 217,
  18330. "hot": "hot"
  18331. }],
  18332. 140: [function(e, t, i) {
  18333. "use strict";
  18334. function n() {
  18335. this.modelMap = {},
  18336. this.activeModel = null,
  18337. this.modelCount = 0,
  18338. this.tileDownloader = null,
  18339. this.panoRenderer = null
  18340. }
  18341. var r = (e("three"),
  18342. e("../util/common"))
  18343. , o = e("../exception/BasicException")
  18344. , a = e("../enum/ModelManagerEvents")
  18345. , s = e("../enum/PanoRendererEvents")
  18346. , l = e("events").EventEmitter;
  18347. n.prototype.init = function(e, t, i) {
  18348. this.tileDownloader = e,
  18349. this.panoRenderer = t,
  18350. this.qualityManager = i,
  18351. this.bindEvents()
  18352. }
  18353. ,
  18354. n.prototype.bindEvents = function() {
  18355. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18356. }
  18357. ,
  18358. n.prototype.onTileRendered = function(e, t, i, n) {}
  18359. ,
  18360. n.prototype.addModel = function(e) {
  18361. this.modelMap[e.sid] = e,
  18362. 0 === this.modelCount && this.activateModel(e.sid),
  18363. this.modelCount++,
  18364. this.emit(a.ModelAdded)
  18365. }
  18366. ,
  18367. n.prototype.getModel = function(e) {
  18368. return this.modelMap[e]
  18369. }
  18370. ,
  18371. n.prototype.activateModel = function(e) {
  18372. var t = this.modelMap[e];
  18373. if (!t)
  18374. throw new o("Tried to activate invalid model!");
  18375. var i = this.activeModel;
  18376. this.activeModel = t,
  18377. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18378. this.tileDownloader.setUrls(t.urls),
  18379. t.panos.forEach(function(e) {
  18380. e.attachToPanoRenderer(this.panoRenderer),
  18381. e.tileDownloader = this.tileDownloader,
  18382. e.qualityManager = this.qualityManager
  18383. }
  18384. .bind(this)),
  18385. this.emit(a.ActiveModelChanged, {
  18386. oldModel: i,
  18387. model: t
  18388. })
  18389. }
  18390. ,
  18391. n.prototype.getActiveModel = function() {
  18392. return this.activeModel
  18393. }
  18394. ,
  18395. r.extend(n, l),
  18396. t.exports = n
  18397. }
  18398. , {
  18399. "../enum/ModelManagerEvents": 33,
  18400. "../enum/PanoRendererEvents": 35,
  18401. "../exception/BasicException": 55,
  18402. "../util/common": 185,
  18403. events: 202,
  18404. three: 217
  18405. }],
  18406. 141: [function(e, t, i) {
  18407. (function(i) {
  18408. "use strict";
  18409. function n() {
  18410. s.call(this)
  18411. }
  18412. var r = e("../objects/Room")
  18413. , o = (e("../settings"),
  18414. e("../util/logger"))
  18415. , a = (e("../util/transitions"),
  18416. e("../util/easing"),
  18417. e("../util/common"))
  18418. , s = e("../util/IndexedCollection")
  18419. , l = e("./Chunks");
  18420. new o(i);
  18421. a.inherit(n, s),
  18422. n.prototype.getIndex = function(e) {
  18423. return e.roomId
  18424. }
  18425. ,
  18426. n.prototype.calcRoomBoundaries = function() {
  18427. this.forEach(function(e) {
  18428. e.calcBoundaries()
  18429. })
  18430. }
  18431. ,
  18432. n.prototype.createFromChunks = function(e) {
  18433. var t = {
  18434. floorId: -1,
  18435. roomId: -1
  18436. }
  18437. , i = {};
  18438. e.forEach(function(e) {
  18439. l.parseIdsFromChunkName(e.name, t);
  18440. var o = i[t.roomId];
  18441. if (!o) {
  18442. var a = n.generateRoomId(t.floorId, t.roomId);
  18443. o = new r(t.floorId,a),
  18444. this.add(o),
  18445. i[t.roomId] = o
  18446. }
  18447. o.addChunk(e)
  18448. }
  18449. .bind(this)),
  18450. this.calcRoomBoundaries()
  18451. }
  18452. ,
  18453. n.generateRoomId = function(e, t) {
  18454. return e + "_" + t
  18455. }
  18456. ,
  18457. t.exports = n
  18458. }
  18459. ).call(this, "/js/model/RoomCollection.js")
  18460. }
  18461. , {
  18462. "../objects/Room": 150,
  18463. "../settings": 166,
  18464. "../util/IndexedCollection": 175,
  18465. "../util/common": 185,
  18466. "../util/easing": 186,
  18467. "../util/logger": 189,
  18468. "../util/transitions": 195,
  18469. "./Chunks": 135
  18470. }],
  18471. 142: [function(e, t, i) {
  18472. "use strict";
  18473. function n(e, t, i) {
  18474. e = e.clone().expandByScalar(0.01);//改
  18475. var n = e.size()
  18476. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18477. o.boundingBox = e,
  18478. r.Mesh.call(this, o, t),
  18479. this.position.copy(e.center()),
  18480. this.frustumCulled = !1,
  18481. i && this.add(new r.WireframeHelper(this))
  18482. }
  18483. var r = e("three");
  18484. n.prototype = Object.create(r.Mesh.prototype),
  18485. n.prototype.constructor = n,
  18486. t.exports = n
  18487. }
  18488. , {
  18489. three: 217
  18490. }],
  18491. 143: [function(e, t, i) {
  18492. (function(i) {
  18493. "use strict";
  18494. function n(e) {
  18495. h.time("Computing a nice bounding cubemap");
  18496. var t = new a({
  18497. side: r.BackSide,
  18498. transparent: !0
  18499. });
  18500. t.uniforms.modelAlpha.value = 0,
  18501. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18502. this.renderOrder = l.boundingSkybox,
  18503. o.call(this, e, t),
  18504. h.timeEnd("Computing a nice bounding cubemap")
  18505. }
  18506. var r = e("three")
  18507. , o = (e("../enum/Viewmode"),
  18508. e("../shaders"),
  18509. e("./BoundingMesh"))
  18510. , a = e("../materials/ModelTextureMaterial")
  18511. , s = e("../settings")
  18512. , l = e("../enum/RenderOrder")
  18513. , c = e("../util/logger")
  18514. , h = new c(i);
  18515. n.prototype = Object.create(o.prototype),
  18516. n.prototype.constructor = n,
  18517. t.exports = n
  18518. }
  18519. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18520. }
  18521. , {
  18522. "../enum/RenderOrder": 42,
  18523. "../enum/Viewmode": 51,
  18524. "../materials/ModelTextureMaterial": 118,
  18525. "../settings": 166,
  18526. "../shaders": 167,
  18527. "../util/logger": 189,
  18528. "./BoundingMesh": 142,
  18529. three: 217
  18530. }],
  18531. 144: [function(e, t, i) {
  18532. "use strict";
  18533. function n(e) {
  18534. this.materialInside = new s({
  18535. side: r.DoubleSide
  18536. });
  18537. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18538. this.materialOutside = new r.RawShaderMaterial({
  18539. fragmentShader: o.modelOutside.fragmentShader,
  18540. vertexShader: o.modelOutside.vertexShader,
  18541. uniforms: t,
  18542. side: r.FrontSide,
  18543. name: "chunkOut"
  18544. }),
  18545. r.Mesh.call(this, e.geometry, this.materialInside),
  18546. this.name = e.name || "",
  18547. this.textureName = e.textureName,
  18548. this.meshUrl = e.meshUrl
  18549. }
  18550. var r = e("three")
  18551. , o = e("../shaders")
  18552. , a = e("../enum/Viewmode")
  18553. , s = e("../materials/ModelTextureMaterial");
  18554. n.prototype = Object.create(r.Mesh.prototype),
  18555. n.prototype.setTextureMap = function(e) {
  18556. this.materialInside.uniforms.map.value = e,
  18557. this.materialOutside.uniforms.map.value = e
  18558. }
  18559. ,
  18560. n.prototype.setMode = function(e) {
  18561. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18562. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18563. t.transparent = this.material.transparent,
  18564. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18565. this.material = t
  18566. }
  18567. ,
  18568. t.exports = n
  18569. }
  18570. , {
  18571. "../enum/Viewmode": 51,
  18572. "../materials/ModelTextureMaterial": 118,
  18573. "../shaders": 167,
  18574. three: 217
  18575. }],
  18576. 145: [function(e, t, i) {
  18577. "use strict";
  18578. function n(e) {
  18579. this.chunksize = e || 10,
  18580. this.chunks = {},
  18581. this.boundingBoxes = {},
  18582. this.children = [],
  18583. this.offset = new r.Vector3(0,.5,0),
  18584. this.material = new r.MeshBasicMaterial({
  18585. color: 16777215 * Math.random(),
  18586. side: r.DoubleSide
  18587. })
  18588. }
  18589. var r = e("three");
  18590. e("../enum/Viewmode");
  18591. n.prototype.add = function(e) {
  18592. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18593. m ? (t = m.position.array,
  18594. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18595. n = e.faces);
  18596. var v = new r.Vector3;
  18597. if (i)
  18598. for (o = 0,
  18599. a = i.length; o < a; o += 3) {
  18600. var A = 3 * i[o]
  18601. , y = 3 * i[o + 1]
  18602. , C = 3 * i[o + 2];
  18603. s = (t[A] + t[y] + t[C]) / 3,
  18604. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18605. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18606. h = Math.floor(s / this.chunksize),
  18607. u = Math.floor(l / this.chunksize),
  18608. d = Math.floor(c / this.chunksize),
  18609. p = h + "." + u + "." + d,
  18610. p in this.chunks ? (g = this.chunks[p],
  18611. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18612. f = this.boundingBoxes[p] = new r.Box3),
  18613. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  18614. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18615. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18616. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18617. }
  18618. else
  18619. for (o = 0,
  18620. a = t.length; o < a; o += 9)
  18621. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18622. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18623. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18624. h = Math.floor(s / this.chunksize),
  18625. u = Math.floor(l / this.chunksize),
  18626. d = Math.floor(c / this.chunksize),
  18627. p = h + "." + u + "." + d,
  18628. p in this.chunks ? (g = this.chunks[p],
  18629. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18630. f = this.boundingBoxes[p] = new r.Box3),
  18631. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  18632. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18633. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18634. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18635. }
  18636. ,
  18637. n.prototype.build = function() {
  18638. var e = new r.Object3D;
  18639. e.material = this.material;
  18640. for (var t in this.chunks) {
  18641. var i = this.chunks[t]
  18642. , n = new r.BufferGeometry;
  18643. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18644. n.boundingBox = this.boundingBoxes[t];
  18645. var o = new r.Mesh(n,this.material);
  18646. o.material.visible = !1,
  18647. e.add(o),
  18648. this.chunks[t] = []
  18649. }
  18650. return e
  18651. }
  18652. ,
  18653. t.exports = n
  18654. }
  18655. , {
  18656. "../enum/Viewmode": 51,
  18657. three: 217
  18658. }],
  18659. 146: [function(e, t, i) {
  18660. "use strict";
  18661. var r = e("three")
  18662. , o = e("../settings")
  18663. , a = e("../util/common")
  18664. , s = e("../util/lerp")
  18665. , l = e("./ChunkedCollider")
  18666. , c = e("../util/transitions")
  18667. , h = e("../util/easing")
  18668. , u = (e("../objects/Panorama"),
  18669. e("../enum/RenderOrder"))
  18670. , d = e("../localization/localize");
  18671. function n(e, t, i) {
  18672. r.Object3D.call(this),
  18673. this.model = e,
  18674. this.floorIndex = t,
  18675. this.lang = o.languageTag,
  18676. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18677. this.panos = [],
  18678. this.chunks = [],
  18679. this.colliderBuilder = new l(3),
  18680. this.collider = null,
  18681. this.center = null,
  18682. this.boundingBox = new r.Box3,
  18683. this.size = null,
  18684. this.hidden = !1,
  18685. this.conservativeBoundingBox = new r.Box3,
  18686. this.debugColor = 16777215 * Math.random(),
  18687. this.transition = null
  18688. }
  18689. n.prototype = Object.create(r.Object3D.prototype),
  18690. n.prototype.enter = function(e) {
  18691. this.model.setFloor(this, e)
  18692. }
  18693. ,
  18694. n.prototype.hide = function(e) {
  18695. if (!this.hidden || this.transition) {
  18696. this.chunks.forEach(function(e) {
  18697. e.material.transparent = !0
  18698. }),
  18699. c.cancel(this.transition);
  18700. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18701. , i = e ? 0 : o.hideFloorDelay / t;
  18702. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18703. this.hidden = !0
  18704. }
  18705. .bind(this), i, h.easeInOutQuad)
  18706. }
  18707. }
  18708. ,
  18709. n.prototype.show = function(e) {
  18710. if (this.hidden || this.transition) {
  18711. this.hidden = !1,
  18712. c.cancel(this.transition);
  18713. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18714. , i = e ? 0 : o.showFloorDelay / t;
  18715. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18716. this.hidden || this.chunks.forEach(function(e) {
  18717. e.material.transparent = !1
  18718. })
  18719. }
  18720. .bind(this), i, h.easeInOutQuad)
  18721. }
  18722. }
  18723. ,
  18724. n.prototype.toggle = function(e, t) {
  18725. e = void 0 === e ? this.hidden : e,
  18726. e ? this.show(t) : this.hide(t)
  18727. }
  18728. ,
  18729. n.prototype.containsPoint = function(e) {
  18730. return this.collider.children.some(function(t) {
  18731. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18732. t.geometry.boundingBox.containsPoint(e)
  18733. })
  18734. }
  18735. ,
  18736. n.prototype.distanceToPoint = function(e) {
  18737. var t = null
  18738. , i = 1 / 0;
  18739. return this.collider.children.forEach(function(n) {
  18740. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18741. var r = n.geometry.boundingBox.distanceToPoint(e);
  18742. (!t || i > r) && (i = r,
  18743. t = n)
  18744. }),
  18745. i
  18746. }
  18747. ,
  18748. n.prototype.addChunk = function(e) {
  18749. e.renderOrder = u.ghostFloor,
  18750. this.add(e),
  18751. this.chunks.push(e),
  18752. this.boundingBox.union(e.geometry.boundingBox),
  18753. this.size = this.boundingBox.size(),
  18754. this.colliderBuilder.add(e.geometry)
  18755. }
  18756. ,
  18757. n.prototype.addPano = function(e) {
  18758. this.panos.push(e),
  18759. this.add(e.skyboxMesh),
  18760. e.marker && this.add(e.marker);
  18761. var t = new r.Vector3(1,1,1)
  18762. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18763. this.boundingBox.union(i)
  18764. }
  18765. ,
  18766. n.prototype.build = function() {
  18767. this.collider = this.colliderBuilder.build(!0),
  18768. this.add(this.collider),
  18769. this.center = this.boundingBox.center(),
  18770. this.conservativeBoundingBox.copy(this.boundingBox),
  18771. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18772. return e.geometry.boundingBox.min.y
  18773. }), 5),
  18774. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18775. return e.geometry.boundingBox.max.y
  18776. }), 5),
  18777. this.colliderBuilder = null
  18778. }
  18779. ,
  18780. n.prototype.toShortString = function() {
  18781. return a.nth(this.floorIndex + 1)
  18782. }
  18783. ,
  18784. n.prototype.toString = function() {
  18785. return this.name
  18786. }
  18787. ,
  18788. t.exports = n
  18789. }
  18790. , {
  18791. "../enum/RenderOrder": 42,
  18792. "../localization/localize": 108,
  18793. "./strings-cn-CN": 109,
  18794. "../objects/Panorama": 148,
  18795. "../settings": 166,
  18796. "../util/common": 185,
  18797. "../util/easing": 186,
  18798. "../util/lerp": 188,
  18799. "../util/transitions": 195,
  18800. "./ChunkedCollider": 145,
  18801. three: 217
  18802. }],
  18803. 147: [function(e, t, i) {
  18804. "use strict";
  18805. function n(e) {
  18806. this.player = e,
  18807. this.obj3d = null,
  18808. this.UP = new r.Vector3(0,1,0)
  18809. }
  18810. var r = e("three")
  18811. , o = e("../settings");
  18812. n.prototype.prefs = {
  18813. linewidth: 3,
  18814. height: .07,
  18815. opacity: .45,
  18816. endScale: .05
  18817. },
  18818. n.prototype.discard = function() {
  18819. if (this.obj3d) {
  18820. var e = this.obj3d.parent;
  18821. e && e.remove(this.obj3d)
  18822. }
  18823. this.obj3d = null
  18824. }
  18825. ,
  18826. n.prototype.draw = function() {
  18827. if (this.discard(),
  18828. o.showNeighbors) {
  18829. var e = this.player.currentPano.floor;
  18830. this.obj3d = new r.Object3D;
  18831. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18832. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18833. i.y += this.prefs.height;
  18834. var n = .1525
  18835. , a = .127
  18836. , s = .0127
  18837. , l = .1
  18838. , c = .19
  18839. , h = .2032
  18840. , u = .2286
  18841. , d = .255
  18842. , p = new r.Matrix4;
  18843. for (var f in t)
  18844. if (t[f]) {
  18845. var g = this.player.model.panos.get(f)
  18846. , m = (g.position.clone().sub(this.player.model.position),
  18847. g.position.clone().sub(g.floorPosition))
  18848. , v = g.floorPosition.clone().sub(this.player.model.position);
  18849. v.y += this.prefs.height;
  18850. var A = new r.Geometry;
  18851. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  18852. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  18853. p.identity().setPosition(m),
  18854. A.applyMatrix(p),
  18855. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18856. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  18857. p.lookAt(v, i, this.UP).setPosition(v),
  18858. A.applyMatrix(p),
  18859. A.vertices.push(v, i);
  18860. var y = new r.Line(A,new r.LineBasicMaterial({
  18861. color: g.debugColor.getHex(),
  18862. transparent: !0,
  18863. opacity: this.prefs.opacity,
  18864. depthWrite: !1,
  18865. name: "sLine" + f,
  18866. linewidth: this.prefs.linewidth
  18867. }));
  18868. this.obj3d.add(y)
  18869. }
  18870. e.add(this.obj3d)
  18871. }
  18872. }
  18873. ,
  18874. n.prototype.update = function() {
  18875. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18876. }
  18877. ,
  18878. t.exports = n
  18879. }
  18880. , {
  18881. "../settings": 166,
  18882. three: 217
  18883. }],
  18884. 148: [function(e, t, i) {
  18885. (function(i) {
  18886. "use strict";
  18887. function n(e, t, i, n) {
  18888. this.model = e,
  18889. this.id = t,
  18890. this.alignmentType = i.alignmentType || l.ALIGNED,
  18891. this.neighbourUUIDs = i.neighbours || null,
  18892. this.neighbourPanos = null,
  18893. this.floor = null,
  18894. this.floorIndex = i.floor,
  18895. this.failedLoadingAt = 0,
  18896. this.maxLoadRetries = 4,
  18897. this.origin = i.position.clone(),
  18898. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18899. this.quaternion = i.quaternion.clone(),
  18900. this.skyboxMesh = new r.Mesh(E),
  18901. this.skyboxMesh.position.copy(this.position),
  18902. this.skyboxMesh.quaternion.copy(this.quaternion),
  18903. this.skyboxMesh.name = "skybox",
  18904. this.skyboxMesh.visible = !1,
  18905. this.skyboxMesh.updateMatrix(),
  18906. this.skyboxMesh.updateMatrixWorld(),
  18907. this.marker = null,
  18908. this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker;
  18909. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18910. map: w,
  18911. side: r.DoubleSide,
  18912. opacity: 0,
  18913. transparent: !0,
  18914. depthWrite: !1
  18915. })),
  18916. this.marker.visible = this.showFloorMarker,
  18917. this.marker.renderOrder = s.panoMarker,
  18918. this.marker.name = "marker",
  18919. this.marker.pano = this,
  18920. this.marker.layers.set(v.PANOMARKERS),
  18921. this.marker.updateMatrixWorld(),
  18922. a.colorMarkerOnLoad && this.on("load", function() {
  18923. this.marker.material.color.set(65280)
  18924. })),
  18925. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18926. this.floorPosition = i.puck ? i.puck.clone() : null,
  18927. this.tiled = n,
  18928. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18929. this.solidSkybox.flipY = !1,
  18930. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18931. this.solidSkybox.magFilter = r.LinearFilter,
  18932. this.solidSkybox.generateMipmaps = !1)),
  18933. this.zoomed = !1,
  18934. this.panoRenderer = null,
  18935. this.qualityManager = null,
  18936. this.tileDownloader = null,
  18937. this.tiledPanoRenderTarget = null,
  18938. this.minimumTiledPanoLoaded = !1,
  18939. this.highestPartialTileRenderOpCompleted = 0,
  18940. this.highestFullTileRenderOpCompleted = 0,
  18941. this.shouldRedrawOnBaseLoaded = !1,
  18942. this.lockUntilRenderingComplete = !1,
  18943. a.colorMarkerOnLoad && this.on("load", function() {
  18944. this.marker.material.color.set(65280)
  18945. });
  18946. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18947. var e = new r.TextureLoader;
  18948. e.setCrossOrigin(!0);
  18949. var g = e.load("images/texture.jpg");
  18950. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18951. color: 16777215,
  18952. transparent: !0,
  18953. opacity: .75,
  18954. map: g
  18955. })),
  18956. this.vrMarker.boluoType = "vr",
  18957. this.vrMarker.position.z = 1,
  18958. this.vrMarker.enabled = !0,
  18959. this.vrMarker.visible = !1,
  18960. window.vrMarkers = window.vrMarkers || [],
  18961. window.vrMarkers.push(this.vrMarker),
  18962. this.marker && this.marker.add(this.vrMarker),
  18963. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18964. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18965. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18966. this.adjustAngleEnable) {
  18967. var i = new r.Quaternion;
  18968. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18969. this.skyboxMesh.quaternion.multiply(i);
  18970. var m = new r.Quaternion;
  18971. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18972. this.skyboxMesh.quaternion.multiply(m);
  18973. var n = new r.Quaternion;
  18974. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18975. this.skyboxMesh.quaternion.multiply(n),
  18976. this.skyboxMesh.updateMatrix(),
  18977. this.skyboxMesh.updateMatrixWorld(),
  18978. this.model.updateProjectedPanos()
  18979. }
  18980. /**************************************************************************************************************************************/
  18981. }
  18982. var r = e("three")
  18983. , o = e("../util/logger")
  18984. , a = e("../settings")
  18985. , s = (e("../enum/Viewmode"),
  18986. e("../enum/RenderOrder"))
  18987. , l = e("../enum/AlignmentType")
  18988. , c = (e("../util/common"),
  18989. e("../util/transitions"))
  18990. , h = e("../util/lerp")
  18991. , u = e("../util/ajax")
  18992. , d = e("../util/texture")
  18993. , p = e("../util/panorama")
  18994. , f = (e("../enum/TileDownloaderEvents"),
  18995. e("../enum/PanoramaEvents"))
  18996. , g = e("../enum/PanoRendererEvents")
  18997. , m = e("../enum/PanoSizeClass")
  18998. , v = e("../enum/RenderLayers")
  18999. , A = (e("../scene/SceneRenderer"),
  19000. e("../enum/GLCubeFaces"),
  19001. e("../exception/BasicException"))
  19002. , y = e("../tile/TileUtils")
  19003. , C = e("events").EventEmitter
  19004. , I = new o(i)
  19005. , E = new r.SphereBufferGeometry(.1)
  19006. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  19007. , w = d.load("images/marker-256x256.png");
  19008. n.prototype = Object.create(C.prototype),
  19009. n.prototype.enter = function() {
  19010. var e = null;
  19011. return function() {
  19012. this.setZoomed(!1),
  19013. this.emit("enter", {
  19014. oldPano: e,
  19015. newPano: this
  19016. }),
  19017. e = this
  19018. }
  19019. }(),
  19020. n.prototype.exit = function() {
  19021. this.tiled ? (this.clearWaitDeferreds(),
  19022. this.minimumTiledPanoLoaded = !1,
  19023. this.tiledPanoRenderTarget = null,
  19024. this.setZoomed(!1),
  19025. this.panoRenderer.deactivateTiledPano(this),
  19026. this.highestPartialTileRenderOpCompleted = 0,
  19027. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19028. this.solidSkybox.loaded = !1,
  19029. this.solidSkybox.version = 0),
  19030. this.emit("exit")
  19031. }
  19032. ,
  19033. n.prototype.hoverOn = function(e) {
  19034. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19035. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19036. }
  19037. ,
  19038. n.prototype.hoverOff = function(e) {
  19039. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19040. }
  19041. ,
  19042. n.prototype.build1 = function() {
  19043. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  19044. this.floor.addPano(this),
  19045. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19046. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19047. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19048. }
  19049. ,
  19050. n.prototype.build2 = function() {
  19051. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19052. this.height = this.position.distanceTo(this.floorPosition),
  19053. this.placeMarker()
  19054. }
  19055. ,
  19056. n.prototype.interpolateFloorPosition = function() {
  19057. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19058. return !!e.floorPosition
  19059. }).sort(function(e, t) {
  19060. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19061. }
  19062. .bind(this))
  19063. , t = this.position.clone();
  19064. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19065. t
  19066. }
  19067. ,
  19068. n.prototype.raycastFloorPosition = function() {
  19069. I.warn("Performance warning: Raycasting to find floor position");
  19070. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19071. , t = e.intersectObjects(this.model.colliders);
  19072. return t.length ? t[0].point : null
  19073. }
  19074. ,
  19075. n.prototype.raycastToFindFloor = function() {
  19076. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  19077. return function() {
  19078. // I.warn("Performance warning: Raycasting to find floor index");
  19079. for (var t = 0; t < e.length; t++) {
  19080. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19081. , n = i.intersectObjects(this.model.colliders);
  19082. if (n.length)
  19083. return n[0].object.parent.parent
  19084. }
  19085. return null
  19086. }
  19087. }(),
  19088. n.prototype.placeMarker = function() {
  19089. this.marker && (this.marker.position.copy(this.floorPosition),
  19090. this.marker.position.y += .05,
  19091. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19092. }
  19093. ,
  19094. n.prototype.translate = function(e) {
  19095. this.position.add(e),
  19096. this.floorPosition.add(e)
  19097. }
  19098. ,
  19099. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19100. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19101. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19102. }
  19103. ,
  19104. n.prototype.attachToPanoRenderer = function(e) {
  19105. this.panoRenderer = e,
  19106. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19107. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19108. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19109. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19110. }
  19111. ;
  19112. var _ = {};
  19113. n.prototype.getWaitDeferred = function(e) {
  19114. var t = _[this.id];
  19115. t || (t = {},
  19116. _[this.id] = t);
  19117. var i = t[e];
  19118. return i || (i = {
  19119. deferred: $.Deferred(),
  19120. active: !1
  19121. },
  19122. t[e] = i),
  19123. i
  19124. }
  19125. ,
  19126. n.prototype.resetWaitDeferred = function(e) {
  19127. var t = this.getWaitDeferred(e);
  19128. t.active = !1,
  19129. t.deferred = $.Deferred()
  19130. }
  19131. ,
  19132. n.prototype.clearWaitDeferreds = function() {
  19133. var e = _[this.id];
  19134. e || (e = {},
  19135. _[this.id] = e);
  19136. for (var t in e)
  19137. if (e.hasOwnProperty(t)) {
  19138. var i = e[t];
  19139. i.active = !1,
  19140. i.deferred = $.Deferred()
  19141. }
  19142. }
  19143. ,
  19144. n.prototype.loadTiledPano = function() {
  19145. var e = (new r.Vector3,
  19146. [])
  19147. , t = [];
  19148. return function(i, n, r, o, a, s) {
  19149. null !== o && void 0 !== o || (o = !0),
  19150. null !== a && void 0 !== a || (a = !0);
  19151. var l = this.getWaitDeferred(i)
  19152. , c = l.deferred
  19153. , h = null
  19154. , u = null;
  19155. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19156. u = r.vFov)),
  19157. !this.isLoaded(i)) {
  19158. if (!l.active) {
  19159. if (l.active = !0,
  19160. r) {
  19161. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19162. e[this.id + ":" + i] = {
  19163. tileCount: 0,
  19164. targetTileCount: d
  19165. },
  19166. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19167. }
  19168. t[this.id] || (t[this.id] = !0,
  19169. this.on(f.LoadComplete, function(e, t) {
  19170. var i = this.getWaitDeferred(e).deferred;
  19171. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19172. this.resetWaitDeferred(e))
  19173. }
  19174. .bind(this)),
  19175. this.on(f.LoadFailed, function(e) {
  19176. var t = this.getWaitDeferred(e).deferred;
  19177. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19178. this.resetWaitDeferred(e))
  19179. }
  19180. .bind(this)),
  19181. this.on(f.TileLoaded, function(t, i, n) {
  19182. var r = this.getWaitDeferred(t).deferred;
  19183. if (r && "pending" === r.state()) {
  19184. r.notify(t, i, n);
  19185. var o = e[this.id + ":" + t];
  19186. o && (o.tileCount++,
  19187. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19188. r.resolve(t, n),
  19189. this.resetWaitDeferred(t)))
  19190. }
  19191. }
  19192. .bind(this)))
  19193. }
  19194. this.tileDownloader.clearForceQueue(),
  19195. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19196. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  19197. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19198. }
  19199. return c.promise()
  19200. }
  19201. }(),
  19202. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19203. if (e === this.id) {
  19204. var n = this.qualityManager.getPanoSize(m.BASE);
  19205. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19206. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19207. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19208. }
  19209. }
  19210. ,
  19211. n.prototype.onTileRendered = function(e, t, i, n) {
  19212. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19213. }
  19214. ,
  19215. n.prototype.onPanoRendered = function(e, t, i, n) {
  19216. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19217. this.updateSkyboxForZoomLevel(),
  19218. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19219. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19220. this.emit("load", t),
  19221. this.model.emit("load", this),
  19222. this.emit(f.LoadComplete, t, i))
  19223. }
  19224. ,
  19225. n.prototype.setZoomed = function(e) {
  19226. this.zoomed = e,
  19227. this.updateSkyboxForZoomLevel()
  19228. }
  19229. ,
  19230. n.prototype.ensureSkyboxReadyForRender = function() {
  19231. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19232. this.solidSkybox.loaded = !0)
  19233. }
  19234. ,
  19235. n.prototype.updateSkyboxForZoomLevel = function() {
  19236. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19237. }
  19238. ,
  19239. n.prototype.getSkyboxTexture = function() {
  19240. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19241. }
  19242. ,
  19243. n.prototype.onTileRenderFail = function(e, t, i) {
  19244. e === this.id && this.emit(f.LoadFailed, t)
  19245. }
  19246. ,
  19247. n.prototype.isLoaded = function(e) {
  19248. if (this.tiled) {
  19249. if (e && "string" == typeof e)
  19250. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19251. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19252. }
  19253. if (e && "number" == typeof e)
  19254. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19255. return !!this.solidSkybox.high || e in this.solidSkybox
  19256. }
  19257. ,
  19258. n.prototype.loadCube = function(e) {
  19259. if (this.isLoaded(e))
  19260. return I.info("Skipping load of pano, already loaded"),
  19261. $.when();
  19262. this.emit("loading", e),
  19263. this.model.emit("loading", this);
  19264. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19265. , i = t.filter(function(e) {
  19266. return !e
  19267. });
  19268. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19269. e = "high",
  19270. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19271. var n = 0
  19272. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19273. return u.getImage(t[i])
  19274. }
  19275. .bind(this));
  19276. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19277. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19278. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19279. this.solidSkybox.low = null),
  19280. this.solidSkybox.needsUpdate = !0,
  19281. this.emit("load", e),
  19282. this.model.emit("load", this),
  19283. this
  19284. }
  19285. .bind(this), function() {
  19286. I.error("Downloading cubemap for pano", this.id, "failed"),
  19287. this.failedLoadingAt = Date.now()
  19288. }
  19289. .bind(this), function() {
  19290. return $.when(++n, 6)
  19291. })
  19292. }
  19293. ,
  19294. n.raycastsSkipped = 0,
  19295. n.raycastsDone = 0,
  19296. n.prototype.findNeighourPanos = function() {
  19297. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19298. this.model.panos.forEach(function(e) {
  19299. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19300. var t = this.position.distanceTo(e.position);
  19301. if (t > a.panoramaNeighbourMaxDistance)
  19302. return this.model.panos.setNeighbour(this, e, !1),
  19303. void n.raycastsSkipped++;
  19304. var i = e.position.clone().sub(this.position).normalize()
  19305. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19306. , s = o.intersectObjects(this.model.colliders);
  19307. n.raycastsDone++,
  19308. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19309. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  19310. }
  19311. }
  19312. .bind(this)),
  19313. this.model.panos.neighbourMap[this.id]
  19314. }
  19315. ,
  19316. n.prototype.worldPosition = function() {
  19317. return this.position
  19318. }
  19319. ,
  19320. n.prototype.addTextSprite = function(e, t) {
  19321. this.removeTextSprite();
  19322. var i = document.createElement("canvas")
  19323. , n = i.getContext("2d");
  19324. i.width = 256,
  19325. i.height = 256;
  19326. var o = "Arial"
  19327. , a = 60;
  19328. n.font = "bold " + a + "px " + o,
  19329. n.fillStyle = "white";
  19330. var s = n.measureText(e).width;
  19331. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19332. var l = new r.Texture(i);
  19333. l.needsUpdate = !0;
  19334. var c = new r.SpriteMaterial({
  19335. map: l,
  19336. color: t || 16428055
  19337. });
  19338. this.text3d = new r.Sprite(c),
  19339. this.text3d.position.copy(this.skyboxMesh.position),
  19340. this.floor.add(this.text3d)
  19341. }
  19342. ,
  19343. n.prototype.removeTextSprite = function() {
  19344. this.text3d && (this.floor.remove(this.text3d),
  19345. this.text3d = null)
  19346. }
  19347. ,
  19348. n.prototype.isAligned = function() {
  19349. return this.alignmentType === l.ALIGNED
  19350. }
  19351. ,
  19352. n.filters = {
  19353. inDirection: function(e, t, i) {
  19354. return function(n) {
  19355. var r = n.position.clone().sub(e).normalize();
  19356. return r.dot(t) > i
  19357. }
  19358. },
  19359. inFloorDirection: function(e, t, i) {
  19360. return function(n) {
  19361. var r = n.floorPosition.clone().sub(e).normalize();
  19362. return r.dot(t) > i
  19363. }
  19364. },
  19365. inPanoDirection: function(e, t, i) {
  19366. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19367. function(n) {
  19368. var r = n.floorPosition.clone().sub(e).normalize()
  19369. , o = n.position.clone().sub(e).normalize();
  19370. return r.dot(t) > i || o.dot(t) > i
  19371. }
  19372. },
  19373. atFloor: function(e) {
  19374. return function(t) {
  19375. return !e || t.floor === e
  19376. }
  19377. },
  19378. not: function(e) {
  19379. return function(t) {
  19380. return t !== e
  19381. }
  19382. },
  19383. notIn: function(e) {
  19384. return function(t) {
  19385. return e.indexOf(t) === -1
  19386. }
  19387. },
  19388. isLoaded: function() {
  19389. return function(e) {
  19390. return e.isLoaded()
  19391. }
  19392. },
  19393. isNotLoaded: function() {
  19394. return function(e) {
  19395. return !e.isLoaded()
  19396. }
  19397. },
  19398. isCloseEnoughTo: function(e, t) {
  19399. return function(i) {
  19400. return e.distanceTo(i.floorPosition) < t
  19401. }
  19402. },
  19403. hasMinimumHeightDifferenceTo: function(e, t) {
  19404. return function(i) {
  19405. return Math.abs(i.position.y - e.y) > t
  19406. }
  19407. },
  19408. isNotBehindNormal: function(e, t) {
  19409. var i = new r.Vector3;
  19410. return t = t.clone(),
  19411. function(n) {
  19412. var r = i.copy(n.position).sub(e).normalize();
  19413. return r.dot(t) > 0
  19414. }
  19415. },
  19416. isNeighbourPanoTo: function(e) {
  19417. return function(t) {
  19418. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19419. }
  19420. },
  19421. isNeighbourOfNeighbourTo: function(e) {
  19422. return function(t) {
  19423. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19424. var n = e.model.panos.get(i);
  19425. return !!n && n.neighbourPanos[t.id]
  19426. })
  19427. }
  19428. },
  19429. isNotRecentlyFailed: function(e) {
  19430. return function(t) {
  19431. return Date.now() - t.failedLoadingAt > e
  19432. }
  19433. },
  19434. isOnVisibleFloor: function() {
  19435. return function(e) {
  19436. return !e.floor.hidden
  19437. }
  19438. },
  19439. isPanoAligned: function() {
  19440. return function(e) {
  19441. return e.isAligned()
  19442. }
  19443. }
  19444. },
  19445. n.sortFunctions = {
  19446. distanceToPoint: function(e) {
  19447. return function(t, i) {
  19448. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19449. }
  19450. },
  19451. floorDistanceToPoint: function(e) {
  19452. return function(t, i) {
  19453. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19454. }
  19455. },
  19456. choose: function(e) {
  19457. return function(t, i) {
  19458. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19459. }
  19460. }
  19461. },
  19462. n.scoreFunctions = {
  19463. distance: function(e, t) {
  19464. return t = t || a.navigation.distanceFactor,
  19465. function(i) {
  19466. return e ? e.position.distanceTo(i.position) * t : 0
  19467. }
  19468. },
  19469. distanceSquared: function(e, t) {
  19470. return t = t || a.navigation.distanceFactor,
  19471. function(i) {
  19472. return e ? e.position.distanceToSquared(i.position) * t : 0
  19473. }
  19474. },
  19475. direction: function(e, t) {
  19476. return function(i) {
  19477. var n = i.position.clone().sub(e).normalize();
  19478. return n.dot(t) * a.navigation.directionFactor
  19479. }
  19480. },
  19481. angle: function(e, t) {
  19482. return function(i) {
  19483. var n = i.position.clone().sub(e).normalize();
  19484. return n.angleTo(t) * a.navigation.angleFactor
  19485. }
  19486. },
  19487. inFieldOfView: function(e, t) {
  19488. return function(i) {
  19489. var n = i.position.clone().sub(e).normalize();
  19490. return n.dot(t) > .75 ? 10 : -1
  19491. }
  19492. },
  19493. optionality: function(e) {
  19494. return function(t) {
  19495. var i = t.neighbourUUIDs.filter(function(t) {
  19496. return !(t in e.neighbourUUIDs) && t !== e.id
  19497. });
  19498. return i.length * a.navigation.optionalityFactor
  19499. }
  19500. },
  19501. penalizeHeightDifferenceUnder: function(e, t) {
  19502. return function(i) {
  19503. return e.y - i.position.y < t ? -20 : 0
  19504. }
  19505. }
  19506. },
  19507. t.exports = n
  19508. }
  19509. ).call(this, "/js/objects/Panorama.js")
  19510. }
  19511. , {
  19512. "../enum/AlignmentType": 17,
  19513. "../enum/GLCubeFaces": 25,
  19514. "../enum/PanoRendererEvents": 35,
  19515. "../enum/PanoSizeClass": 36,
  19516. "../enum/PanoramaEvents": 37,
  19517. "../enum/RenderLayers": 41,
  19518. "../enum/RenderOrder": 42,
  19519. "../enum/TileDownloaderEvents": 45,
  19520. "../enum/Viewmode": 51,
  19521. "../exception/BasicException": 55,
  19522. "../scene/SceneRenderer": 158,
  19523. "../settings": 166,
  19524. "../tile/TileUtils": 174,
  19525. "../util/ajax": 181,
  19526. "../util/common": 185,
  19527. "../util/lerp": 188,
  19528. "../util/logger": 189,
  19529. "../util/panorama": 191,
  19530. "../util/texture": 194,
  19531. "../util/transitions": 195,
  19532. events: 202,
  19533. three: 217
  19534. }],
  19535. 149: [function(e, t, i) {
  19536. "use strict";
  19537. function n(e) {
  19538. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19539. t.map.value = d,
  19540. t.opacity.value = 0,
  19541. t.color.value.set(o.reticuleColor),
  19542. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  19543. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19544. side: r.DoubleSide,
  19545. depthWrite: !1,
  19546. depthTest: !1,
  19547. transparent: !0,
  19548. vertexShader: c.waypoint.vertexShader,
  19549. fragmentShader: c.waypoint.fragmentShader,
  19550. uniforms: t,
  19551. name: "waypoint",
  19552. opacity: 0,
  19553. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19554. })),
  19555. this.layers.set(h.RETICULE),
  19556. this.renderOrder = u.reticule,
  19557. this.player = e,
  19558. this.direction = new r.Vector3,
  19559. this.hidden = !0,
  19560. this.mouseLastMoveTime = Date.now()
  19561. }
  19562. var r = e("three")
  19563. , o = e("../settings")
  19564. , a = e("../util/transitions")
  19565. , s = e("../util/texture")
  19566. , l = e("../util/lerp")
  19567. , c = e("../shaders")
  19568. , h = e("../enum/RenderLayers")
  19569. , u = e("../enum/RenderOrder")
  19570. , d = s.load("images/reticule-256x256.png");
  19571. n.prototype = Object.create(r.Mesh.prototype),
  19572. n.prototype.move = function(e, t, i) {
  19573. this.hidden = i,
  19574. this.mouseLastMoveTime = Date.now()
  19575. }
  19576. ,
  19577. n.prototype.hide = function() {
  19578. this.hidden || (this.hidden = !0,
  19579. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19580. }
  19581. ,
  19582. n.prototype.show = function() {
  19583. this.hidden = !1,
  19584. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19585. }
  19586. ,
  19587. n.prototype.update = function() {
  19588. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19589. }
  19590. ,
  19591. n.prototype.updatePosition = function(e, t) {
  19592. if (!this.hidden) {
  19593. if (!t)
  19594. return this.hide();
  19595. var i = t.point
  19596. , n = e.distanceTo(i)
  19597. , r = 1 + .01 * n;
  19598. n < 1 && (r -= 1 - n),
  19599. this.show(),
  19600. this.scale.set(r, r, r),
  19601. this.direction = this.direction.multiplyScalar(.8),
  19602. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19603. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19604. this.lookAt(this.position.clone().add(this.direction))
  19605. }
  19606. }
  19607. ,
  19608. n.prototype.writeAstag = function() {
  19609. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19610. , t = new Date;
  19611. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19612. var i = {
  19613. enabled: !0,
  19614. version: "0",
  19615. created: t.toISOString(),
  19616. created_by: "APITest",
  19617. position: this.position.clone(),
  19618. stem: {
  19619. enabled: o.tags.pole.enabled,
  19620. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19621. },
  19622. label: "tag " + this.tagCount,
  19623. description: "Description " + e,
  19624. floor: function(e) {
  19625. if (e.currentFloor) {
  19626. var t = e.floors.indexOf(e.currentFloor);
  19627. return t > -1 ? t : void 0
  19628. }
  19629. }(this.player.model),
  19630. type: "info",
  19631. metadata: {
  19632. preferred_camera: {
  19633. mode: this.player.mode
  19634. }
  19635. }
  19636. };
  19637. console.log("--------------------------"),
  19638. console.log(JSON.stringify(i));
  19639. var n = this.player.model.addtag(e, i).build();
  19640. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19641. n.visible || n.show(o.tags.startup.fadeInDuration))
  19642. }
  19643. ,
  19644. t.exports = n
  19645. }
  19646. , {
  19647. "../enum/RenderLayers": 41,
  19648. "../enum/RenderOrder": 42,
  19649. "../settings": 166,
  19650. "../shaders": 167,
  19651. "../util/lerp": 188,
  19652. "../util/texture": 194,
  19653. "../util/transitions": 195,
  19654. three: 217
  19655. }],
  19656. 150: [function(e, t, i) {
  19657. "use strict";
  19658. function n(e, t) {
  19659. this.chunks = [],
  19660. this.floorId = e,
  19661. this.roomId = t,
  19662. this.position = new r.Vector3
  19663. }
  19664. var r = e("three");
  19665. n.prototype.addChunk = function(e) {
  19666. this.chunks.push(e)
  19667. }
  19668. ,
  19669. n.prototype.calcBoundaries = function() {
  19670. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  19671. var s = this.chunks[a]
  19672. , l = s.geometry.attributes.position;
  19673. if (l)
  19674. for (var c = 0; c < l.array.length; c += 3)
  19675. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19676. t.add(e),
  19677. 0 === c ? (i.copy(e),
  19678. n.copy(e)) : (i.max(e),
  19679. n.min(e)),
  19680. o++
  19681. }
  19682. o > 0 ? (t.multiplyScalar(1 / o),
  19683. this.average = t) : this.average = null,
  19684. this.boundsMax = i,
  19685. this.boundsMin = n,
  19686. this.center = new r.Vector3,
  19687. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19688. }
  19689. ,
  19690. t.exports = n
  19691. }
  19692. , {
  19693. three: 217
  19694. }],
  19695. 151: [function(e, t, i) {
  19696. (function(i) {
  19697. "use strict";
  19698. function n(e, t, i) {
  19699. this.obj3d = null,
  19700. this.nodes = [],
  19701. this.colorHull = [],
  19702. this.shortPaths = {},
  19703. this.floorHull = null,
  19704. this.cameraHull = null,
  19705. this.floorPathDistance = 0,
  19706. this.floorCurvePoints = null,
  19707. this.floorCurveColors = null,
  19708. this.camCurvePoints = null,
  19709. this.warpDestHeroLoc = null,
  19710. this.warpDestPano = null,
  19711. this.warpPathPoints = null,
  19712. this.warpPathLengths = [0],
  19713. this.warpLength = 0,
  19714. this.closeWarpDistance = 4,
  19715. this.UP = A.UP.clone(),
  19716. this.longestStep = 0,
  19717. this.upcomingTransType = null,
  19718. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19719. this.prevNextDist = 0,
  19720. this.nextI = 0,
  19721. this.activeTransType = null,
  19722. this.lastTransType = null,
  19723. this.bunnyObj = null,
  19724. this.director = e,
  19725. this.player = t,
  19726. this.playerControls = i,
  19727. this.modelManager = t.modelManager,
  19728. this.updateModel(),
  19729. this.updateDefaultsFromModelData(),
  19730. this.bindEvents(),
  19731. this.warping = !1,
  19732. this.waitingToWarp = !1,
  19733. this.warpInterrupted = !1,
  19734. this.warpInterruptionBlackoutStyle = null,
  19735. this.warpInterruptionTravelTime = null
  19736. }
  19737. var r = e("three")
  19738. , o = e("../util/logger")
  19739. , a = e("../enum/Viewmode")
  19740. , s = e("../enum/RenderOrder")
  19741. , l = e("../enum/WarpStyle")
  19742. , c = e("../settings")
  19743. , h = e("../util/math")
  19744. , u = e("../util/lerp")
  19745. , d = e("../util/easing")
  19746. , p = e("../util/transitions")
  19747. , f = e("../objects/Snapshot")
  19748. , g = e("../effects")
  19749. , m = e("../shaders")
  19750. , v = (e("../gui/gui"),
  19751. e("../util/texture"))
  19752. , A = e("../enum/Vectors")
  19753. , y = (e("../model/ModelManager"),
  19754. new o(i))
  19755. , C = e("../enum/PlayerEvents")
  19756. , I = e("../enum/BlackoutStyle")
  19757. , E = e("../enum/ModelManagerEvents")
  19758. , b = e("../constants")
  19759. , w = {
  19760. path: v.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"),
  19761. pathEnd: v.load("images/End.png"),
  19762. pathStart: v.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==")
  19763. };
  19764. n.prototype.setScene = function(e) {
  19765. this.createCpm(e),
  19766. this.createBunnyObj(e)
  19767. }
  19768. ,
  19769. n.prototype.updateModel = function() {
  19770. this.model = this.modelManager.getActiveModel()
  19771. }
  19772. ,
  19773. n.prototype.bindEvents = function() {
  19774. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19775. }
  19776. ,
  19777. n.prototype.updateDefaultsFromModelData = function() {
  19778. this.model.data
  19779. }
  19780. ,
  19781. n.prototype.pointPathDistance = function(e) {
  19782. for (var t = 0, i = 1; i < e.length; i += 1)
  19783. t += e[i - 1].distanceTo(e[i]);
  19784. return t
  19785. }
  19786. ,
  19787. n.prototype.pointPathLengths = function(e) {
  19788. for (var t = [0], i = 1; i < e.length; i += 1)
  19789. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19790. return t
  19791. }
  19792. ,
  19793. n.prototype.interpAlongPath = function(e, t, i) {
  19794. var n, o = new r.Vector3, a = t[t.length - 1];
  19795. if (i < 1) {
  19796. n = i * a;
  19797. for (var s = 1; s < t.length; s += 1)
  19798. if (t[s] > n) {
  19799. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19800. return o.copy(e[s]),
  19801. o.sub(e[s - 1]),
  19802. o.multiplyScalar(l),
  19803. o.add(e[s - 1]),
  19804. o
  19805. }
  19806. } else
  19807. o.copy(e[e.length - 1]);
  19808. return o
  19809. }
  19810. ,
  19811. n.prototype.pathHeight = function() {
  19812. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19813. }
  19814. ,
  19815. n.prototype.createBunnyObj = function(e) {
  19816. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19817. this.bunnyObj.visible = c.warp.showBunny),
  19818. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19819. e.add(this.bunnyObj)
  19820. }
  19821. ,
  19822. n.prototype.createCpm = function(e) {
  19823. if (!this.currentPanoMarker) {
  19824. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19825. t.material.uniforms.opacity.value = 0,
  19826. this.currentPanoMarker = {
  19827. mesh: t,
  19828. placed: !1
  19829. }
  19830. }
  19831. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19832. this.placeCpm(),
  19833. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19834. }
  19835. ,
  19836. n.prototype.placeCpm = function() {
  19837. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19838. var e = this.player.currentPano.floor;
  19839. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19840. e.add(this.currentPanoMarker.mesh)),
  19841. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19842. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19843. this.currentPanoMarker.placed = !0
  19844. } else
  19845. this.popOutCpm()
  19846. }
  19847. ,
  19848. n.prototype.fadeInCpm = function(e) {
  19849. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  19850. }
  19851. ,
  19852. n.prototype.fadeOutCpm = function(e) {
  19853. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19854. }
  19855. ,
  19856. n.prototype.popInCpm = function() {
  19857. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19858. }
  19859. ,
  19860. n.prototype.popOutCpm = function() {
  19861. this.fadeOutCpm(2)
  19862. }
  19863. ,
  19864. n.prototype.brushPrefs = {
  19865. linewidth: 7,
  19866. strokeWidth: 15,
  19867. cvSegments: 48,
  19868. paveStep: .1,
  19869. paveWidth: .2,
  19870. lookBlendDist: 3,
  19871. maxTurn: r.Math.degToRad(2)
  19872. },
  19873. n.prototype.panoPathDistance = function(e) {
  19874. var t = this.model.panos;
  19875. if (!e || e.length < 2)
  19876. return 0;
  19877. for (var i = [], n = 0; n < e.length; n += 1)
  19878. i.push(t.get(e[n]).floorPosition);
  19879. return this.pointPathDistance(i)
  19880. }
  19881. ,
  19882. n.prototype.loadTileTexture = function(e) {
  19883. var t = v.load(e, function(t) {
  19884. t.wrapS = r.RepeatWrapping,
  19885. t.wrapT = r.RepeatWrapping,
  19886. t.needsUpdate = !0,
  19887. y.debug('path texture "' + e + '" is ready')
  19888. }, function() {
  19889. y.error('path texture "' + e + '" failed')
  19890. });
  19891. return t.mapping = r.UVMapping,
  19892. t
  19893. }
  19894. ,
  19895. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19896. var a = {
  19897. cameraMode: n,
  19898. position: e,
  19899. quaternion: t,
  19900. panoId: i,
  19901. orthoZoom: o,
  19902. floorVisibility: r,
  19903. thumbUrl: null,
  19904. name: null
  19905. };
  19906. return new f(a)
  19907. }
  19908. ,
  19909. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19910. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19911. }
  19912. ,
  19913. n.prototype.setWarpDestination = function(e) {
  19914. this.warpDestHeroLoc = e
  19915. }
  19916. ,
  19917. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19918. var t = this.getHeroDescriptorByHeroIndex(e);
  19919. return null !== t && (this.setWarpDestination(t),
  19920. !0)
  19921. }
  19922. ,
  19923. n.prototype.setWarpDestinationByPano = function(e, t) {
  19924. var i = this.model.panos.get(e.id);
  19925. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19926. }
  19927. ,
  19928. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19929. var i = this.model.panos.get(e);
  19930. if (i) {
  19931. t = t || new r.Quaternion;
  19932. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19933. return this.setWarpDestination(n),
  19934. !0
  19935. }
  19936. return !1
  19937. }
  19938. ,
  19939. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19940. var t = this.model.heroCount();
  19941. if (null !== this.warpDestHeroLoc && t < 2)
  19942. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19943. this.model.getHeroDescriptorByIndex(0);
  19944. var i = this.model.getHeroDescriptorByIndex(e);
  19945. if (i) {
  19946. var n = i.isPano() ? i.panoId : i.cameraMode;
  19947. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19948. }
  19949. return i
  19950. }
  19951. ,
  19952. n.prototype.getHeroDescriptorByPano = function(e) {
  19953. var t = this.model.panos.get(e.id);
  19954. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19955. }
  19956. ,
  19957. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19958. var t = this.getHeroIndexFromPanoId(e);
  19959. return this.getHeroDescriptorByHeroIndex(t)
  19960. }
  19961. ,
  19962. n.prototype.getHeroIndexFromPanoId = function(e) {
  19963. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19964. var i = this.model.heroLocations[t]
  19965. , n = this.getHeroId(i);
  19966. if (n && n === e)
  19967. return t
  19968. }
  19969. return -1
  19970. }
  19971. ,
  19972. n.prototype.getHeroPano = function(e) {
  19973. if (null === e)
  19974. return y.warn("getHeroPano(): no destination"),
  19975. null;
  19976. var t = this.getHeroId(e)
  19977. , i = this.model.panos.get(t);
  19978. return void 0 === i && (i = null,
  19979. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19980. i
  19981. }
  19982. ,
  19983. n.prototype.getHeroId = function(e) {
  19984. return e.panoId
  19985. }
  19986. ,
  19987. n.prototype.setWarpDestPano = function() {
  19988. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19989. this.warpDestPano
  19990. }
  19991. ,
  19992. n.prototype.brushToWarpPano = function(e, t) {
  19993. if (this.discardPathObject(),
  19994. !this.setWarpDestPano())
  19995. return !1;
  19996. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19997. !this.warpDestPano)
  19998. return y.info("No brush"),
  19999. !1;
  20000. if (!this.player.currentPano)
  20001. return y.debug("No current pano, visibility undefined"),
  20002. !1;
  20003. if (!this.warpDestPano)
  20004. return y.info("No wPano, visibility undefined"),
  20005. !1;
  20006. if (!this.warpDestPano.isAligned())
  20007. return y.debug("Cannot brush to unaligned pano"),
  20008. !1;
  20009. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20010. , n = !0;
  20011. if (this.player.currentPano.id === this.warpDestPano.id)
  20012. y.debug("Already at destination pano");
  20013. else {
  20014. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20015. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20016. this.obj3d = new r.Object3D,
  20017. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20018. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20019. e = t) : (this.setPathHulls(this.nodes),
  20020. this.setFloorCurves(),
  20021. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  20022. this.player.currentPano.floor.add(this.obj3d);
  20023. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20024. , s = e === l.STD;
  20025. if (!n && (i || s)) {
  20026. if (o) {
  20027. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20028. this.obj3d.add(h)
  20029. }
  20030. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20031. this.obj3d.add(u)
  20032. }
  20033. this.appearSlow()
  20034. }
  20035. return this.upcomingTransType = e,
  20036. !n
  20037. }
  20038. ,
  20039. n.prototype.findShortestPath = function(e, t) {
  20040. if (!e || !t)
  20041. return null;
  20042. var i = c.warp.walkExtraPanosDistance
  20043. , n = e.id + ":" + t.id + ":" + i;
  20044. if (this.shortPaths.hasOwnProperty(n))
  20045. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20046. var r = t.id + ":" + e.id + ":" + i;
  20047. if (this.shortPaths.hasOwnProperty(r))
  20048. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20049. var o = this.model.panos.aStarSearch(e, t);
  20050. return this.model.panos.includeNodesNearPath(o, i),
  20051. this.shortPaths[n] = o ? o.slice() : null,
  20052. o
  20053. }
  20054. ,
  20055. n.prototype.makePathHulls = function(e) {
  20056. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20057. t = u.get(e[0]),
  20058. r = t.floor.floorIndex;
  20059. for (var d = 0; d < e.length; d += 1)
  20060. t = u.get(e[d]),
  20061. i = t.floorPosition.clone().sub(this.model.position),
  20062. i.y += this.pathHeight(),
  20063. s.push(i),
  20064. l.push(t.position.clone()),
  20065. n = t.floor.floorIndex,
  20066. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20067. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20068. o > a && (a = o));
  20069. return a > this.longestStep && (this.longestStep = a,
  20070. y.debug("path contains " + a + " meter segment")),
  20071. {
  20072. floor: s,
  20073. camera: l,
  20074. color: h
  20075. }
  20076. }
  20077. ,
  20078. n.prototype.makeFloorCurves = function(e, t, i) {
  20079. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20080. , o = this.pointPathDistance(e) - 2 * n
  20081. , s = e.slice(0)
  20082. , l = s[1].clone().sub(s[0]);
  20083. l.y = 0,
  20084. l.normalize().multiplyScalar(n),
  20085. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20086. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20087. l.y = 0,
  20088. l.normalize().multiplyScalar(n),
  20089. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20090. var h = new r.CatmullRomCurve3(s)
  20091. , u = Math.floor(o / i);
  20092. u = 4 * Math.floor(u / 4),
  20093. u = Math.max(4, u);
  20094. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20095. f = 0,
  20096. d = g[A].distanceTo(e[0]);
  20097. for (var y = 1; y < e.length; y += 1)
  20098. v.copy(g[A]).sub(e[y]),
  20099. v.y *= 4,
  20100. p = v.length(),
  20101. p < d && (f = y);
  20102. m.push(t[f])
  20103. }
  20104. return {
  20105. distance: o,
  20106. points: g,
  20107. colors: m
  20108. }
  20109. }
  20110. ,
  20111. n.prototype.makeCameraCurvePoints = function(e, t) {
  20112. var i = this.pointPathDistance(e)
  20113. , n = new r.CatmullRomCurve3(e);
  20114. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20115. }
  20116. ,
  20117. n.prototype.makeCameraCurveTangents = function(e, t) {
  20118. var i = this.pointPathDistance(e)
  20119. , n = new r.CatmullRomCurve3(e)
  20120. , o = Math.max(2, Math.floor(i / t));
  20121. o || (o = 5);
  20122. for (var a = [], s = 0; s <= o; s++)
  20123. a.push(n.getTangentAt(s / o));
  20124. return a
  20125. }
  20126. ,
  20127. n.prototype.setPathHulls = function(e) {
  20128. var t = this.makePathHulls(e);
  20129. this.floorHull = t.floor,
  20130. this.cameraHull = t.camera,
  20131. this.colorHull = t.color
  20132. }
  20133. ,
  20134. n.prototype.setFloorCurves = function() {
  20135. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20136. this.floorPathDistance = e.distance,
  20137. this.floorCurvePoints = e.points,
  20138. this.floorCurveColors = e.colors
  20139. }
  20140. ,
  20141. n.prototype.setCameraCurvePoints = function() {
  20142. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20143. }
  20144. ,
  20145. n.prototype.chooseWarpPath = function(e) {
  20146. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20147. if (this.player.currentPano === this.warpDestPano || !e)
  20148. return this.warpPathPoints = null,
  20149. this.warpLength = 0,
  20150. !1;
  20151. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20152. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20153. t = this.warpDestPano.position.clone().sub(o.position),
  20154. i = t.clone().negate(),
  20155. t.multiplyScalar(.15).add(o.position),
  20156. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20157. t.y = o.position.y,
  20158. i.y = this.warpDestPano.position.y,
  20159. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20160. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20161. this.setCameraCurvePoints(),
  20162. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20163. this.warpLength = 0,
  20164. this.warpPathLengths = [0];
  20165. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  20166. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20167. var p = s.length();
  20168. s.y *= c.warp.climbEffort;
  20169. var f = s.length() / p;
  20170. if (d > 1) {
  20171. s.setY(0).normalize(),
  20172. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20173. var g = Math.min(1, s.dot(l))
  20174. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20175. f = Math.max(m, f)
  20176. }
  20177. this.warpLength += p * f,
  20178. this.warpPathLengths[d] = this.warpLength
  20179. }
  20180. return !0
  20181. }
  20182. ,
  20183. n.prototype.drawPathRibbon = function(e, t) {
  20184. this.bunnyObj.visible = c.warp.showBunny;
  20185. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  20186. h.copy(e[u]),
  20187. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20188. h.normalize(),
  20189. n.crossVectors(h, A.UP),
  20190. n.multiplyScalar(i);
  20191. var d = (new r.Vector3).copy(e[u]).add(o);
  20192. d.sub(n),
  20193. l.vertices.push(d),
  20194. d = (new r.Vector3).copy(e[u]).add(o),
  20195. d.add(n),
  20196. l.vertices.push(d)
  20197. }
  20198. var p, f = 0;
  20199. for (u = 0; u < e.length - 1; u += 1) {
  20200. var g = 2 * u
  20201. , v = f;
  20202. f += e[u + 1].distanceTo(e[u]);
  20203. var y = f
  20204. , C = t[u]
  20205. , I = t[u + 1];
  20206. p = new r.Face3(g,g + 1,g + 2),
  20207. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20208. l.faces.push(p),
  20209. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20210. p = new r.Face3(g + 2,g + 1,g + 3),
  20211. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20212. l.faces.push(p),
  20213. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20214. }
  20215. l.computeFaceNormals(),
  20216. l.computeVertexNormals();
  20217. var E, b;
  20218. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20219. b.map.value = w.path,
  20220. b.opacity.value = 0,
  20221. b.color.value.set(c.path.color),
  20222. E = new r.RawShaderMaterial({
  20223. side: r.DoubleSide,
  20224. depthWrite: !1,
  20225. transparent: !0,
  20226. vertexShader: m.ribbon.vertexShader,
  20227. fragmentShader: m.ribbon.fragmentShader,
  20228. uniforms: b,
  20229. name: "ribbonT",
  20230. opacity: 0
  20231. })) : E = new r.MeshBasicMaterial({
  20232. color: 16777215,
  20233. side: r.DoubleSide,
  20234. name: "ribbonOut",
  20235. vertexColors: r.VertexColors
  20236. });
  20237. var _ = new r.Mesh(l,E);
  20238. return _.name = "ribbon",
  20239. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20240. _
  20241. }
  20242. ,
  20243. n.prototype.drawPathPavement = function(e) {
  20244. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20245. s.copy(e[l]),
  20246. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20247. s.normalize(),
  20248. n.crossVectors(s, A.UP),
  20249. n.multiplyScalar(this.brushPrefs.paveWidth),
  20250. t = (new r.Vector3).copy(e[l]),
  20251. t.sub(n),
  20252. o.vertices.push(t),
  20253. o.vertices.push((new r.Vector3).copy(e[l])),
  20254. t = (new r.Vector3).copy(e[l]),
  20255. t.add(n),
  20256. o.vertices.push(t);
  20257. var h, u, d;
  20258. for (l = 0; l < e.length - 1; l += 1)
  20259. h = 3 * l + 1,
  20260. u = l * i,
  20261. d = u + i,
  20262. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20263. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20264. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20265. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20266. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20267. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20268. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20269. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20270. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20271. color: c.path.color,
  20272. side: r.DoubleSide,
  20273. transparent: !0,
  20274. depthWrite: !1,
  20275. opacity: 0,
  20276. name: "paveT",
  20277. map: w.path
  20278. }) : new r.MeshBasicMaterial({
  20279. color: c.path.color,
  20280. side: r.DoubleSide,
  20281. transparent: !0,
  20282. depthWrite: !1,
  20283. opacity: 1,
  20284. name: "paveO",
  20285. map: w.path
  20286. });
  20287. return new r.Mesh(o,p)
  20288. }
  20289. ,
  20290. n.prototype.hintPrefs = {
  20291. rad: .18,
  20292. width: .0125,
  20293. depth: .0625,
  20294. setBack: -.04,
  20295. markRad: .25,
  20296. markInnerRad: .16
  20297. },
  20298. n.prototype.makeWaypointObj = function(e, t) {
  20299. var i = new r.Geometry
  20300. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20301. , o = this.pathHeight();
  20302. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  20303. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20304. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20305. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20306. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20307. s.map.value = e,
  20308. s.opacity.value = 0,
  20309. s.color.value.set(c.path.color);
  20310. var l = {
  20311. side: r.DoubleSide,
  20312. depthWrite: !1,
  20313. transparent: !0,
  20314. vertexShader: m.waypoint.vertexShader,
  20315. fragmentShader: m.waypoint.fragmentShader,
  20316. uniforms: s,
  20317. name: "waypoint",
  20318. opacity: 0
  20319. };
  20320. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20321. l.name = "wayPtOut");
  20322. var h = new r.RawShaderMaterial(l)
  20323. , u = new r.Mesh(i,h);
  20324. return u.name = t,
  20325. u
  20326. }
  20327. ,
  20328. n.prototype.makeStartMarker = function(e, t) {
  20329. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20330. i.y = 0,
  20331. i.normalize();
  20332. var n = Math.acos(i.x)
  20333. , o = this.makeWaypointObj(w.pathStart, "Start");
  20334. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20335. o.position.copy(e),
  20336. o
  20337. }
  20338. ,
  20339. n.prototype.makeEndMarker = function(e) {
  20340. var t = this.makeWaypointObj(w.pathEnd, "End")
  20341. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20342. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20343. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20344. t.position.copy(e),
  20345. t
  20346. }
  20347. ,
  20348. n.prototype.pathClean = function(e) {
  20349. if (e) {
  20350. for (var t in e.children)
  20351. this.pathClean(e.children[t]);
  20352. e.geometry && e.geometry.dispose(),
  20353. e.material && e.material.dispose()
  20354. }
  20355. }
  20356. ,
  20357. n.prototype.discardPathObject = function() {
  20358. if (this.obj3d) {
  20359. var e = this.obj3d.parent;
  20360. e && e.remove(this.obj3d),
  20361. this.pathClean(this.obj3d)
  20362. }
  20363. this.obj3d = null,
  20364. this.popInCpm()
  20365. }
  20366. ,
  20367. n.prototype.discardSlow = function() {
  20368. if (this.obj3d) {
  20369. if (this.player.mode !== a.PANORAMA)
  20370. return void this.discardPathObject();
  20371. for (var e, t = this, i = 0, n = function() {
  20372. this.discardPathObject()
  20373. }
  20374. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20375. e = t.obj3d.children[r],
  20376. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  20377. i += 1,
  20378. n = null);
  20379. 0 === i && this.discardPathObject(),
  20380. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20381. }
  20382. }
  20383. ,
  20384. n.prototype.appearSlow = function() {
  20385. var e, t = this;
  20386. this.fadeOutCpm(c.path.fadeInTime);
  20387. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20388. e = t.obj3d.children[n],
  20389. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  20390. }
  20391. ,
  20392. n.prototype.update = function() {
  20393. this.obj3d && this.obj3d.updateMatrixWorld()
  20394. }
  20395. ,
  20396. n.prototype.calcBurnsAmount = function(e) {
  20397. var t = r.Math.degToRad(c.warp.burnsAngle);
  20398. if (this.player.mode === a.PANORAMA) {
  20399. var i = this.burnsDir * t;
  20400. if (this.upcomingTransType === l.BLACK)
  20401. return i;
  20402. var n = e;
  20403. if (null === n)
  20404. return y.warn("Transition request for non-highlight"),
  20405. i;
  20406. var o = this.getHeroDescriptorByHeroIndex(n);
  20407. if (null === o)
  20408. return i;
  20409. if (!o.isPano())
  20410. return i;
  20411. var s = this.getHeroPano(o)
  20412. , h = this.playerControls.cameras[a.PANORAMA]
  20413. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20414. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20415. , p = function(e) {
  20416. var i = Math.acos(Math.min(1, e.dot(u)))
  20417. , n = (new r.Vector3).crossVectors(u, e);
  20418. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20419. };
  20420. if (s === this.player.currentPano)
  20421. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20422. var f = this.findShortestPath(this.player.currentPano, s);
  20423. if (void 0 === f || null === f || f.length < 1)
  20424. return y.debug("Empty path ahead..."),
  20425. i;
  20426. var g = this.makePathHulls(f)
  20427. , m = new r.CatmullRomCurve3(g.camera)
  20428. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20429. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20430. }
  20431. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20432. }
  20433. ,
  20434. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20435. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20436. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20437. var n = new r.Euler
  20438. , o = new r.Vector3;
  20439. y.debug("Starting wait: " + (void 0 !== t));
  20440. var s = this.calcBurnsAmount(e)
  20441. , h = function() {
  20442. this.endWarpState(),
  20443. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20444. t && t()
  20445. }
  20446. .bind(this)
  20447. , u = function(e, t) {
  20448. if (this.warpInterrupted)
  20449. return h(),
  20450. !0;
  20451. var r = t || 1e3 / 60;
  20452. if (c.warp.doBurns)
  20453. if (this.player.mode === a.PANORAMA) {
  20454. var l = this.playerControls.cameras[a.PANORAMA];
  20455. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20456. var u = r * s / i;
  20457. n.y += u,
  20458. o.set(0, 0, -1),
  20459. o.applyEuler(n),
  20460. o.add(l.position),
  20461. l.controls.lookAt(o),
  20462. l.controls.lookVector.copy(o)
  20463. ,l.lookAt(o)
  20464. } else
  20465. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20466. }
  20467. .bind(this);
  20468. this.startWarpState(),
  20469. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20470. //zoom动画
  20471. //这是啥?
  20472. var currentGuide = player.model.heroLocations[app.director.currentItem];
  20473. if(currentGuide.zoom){
  20474. this.player.zoomEnabled = true;
  20475. var zoom = function(e, d) {
  20476. this.player.zoomTo(e * currentGuide.zoom.toFixed(2), true)
  20477. }.bind(this)
  20478. p.start(zoom, 2000, null, 0, d.easeOutQuad, "zoom")
  20479. }
  20480. }
  20481. ,
  20482. n.prototype.warpToNonPano = function(e) {
  20483. if (this.discardPathObject(),
  20484. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20485. var t = function() {
  20486. e && e()
  20487. }
  20488. .bind(this);
  20489. this.player.flyToNewMode({
  20490. mode: this.warpDestHeroLoc.cameraMode,
  20491. duration: c.warp.outsideTime,
  20492. warpDest: this.warpDestHeroLoc,
  20493. callback: t,
  20494. force: !0
  20495. })
  20496. } else
  20497. y.warn("no warp destination!!!"),
  20498. e && e()
  20499. }
  20500. ,
  20501. n.prototype._resetWarpShaderParams = function(e) {
  20502. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20503. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20504. }
  20505. ,
  20506. n.prototype._clearWarpShading = function() {
  20507. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20508. this._resetWarpShaderParams(e[t]),
  20509. e[t].visible = !0;
  20510. this._resetWarpShaderParams(this.model.skybox)
  20511. }
  20512. ,
  20513. n.prototype._warpStopFlying = function() {
  20514. this.activeTransType = null,
  20515. this.placeCpm()
  20516. }
  20517. ,
  20518. n.prototype._wrapupTravelOnlyBits = function() {
  20519. this._warpStopFlying(),
  20520. this.warpPathPoints && (this.player.currentPano.exit(),
  20521. this.warpDestPano.enter(),
  20522. this.player.currentPano = this.warpDestPano),
  20523. this.player.spider.draw(),
  20524. this.placeCpm()
  20525. }
  20526. ,
  20527. n.prototype._wrapupTravel = function(e) {
  20528. this._wrapupTravelOnlyBits(),
  20529. this.warpCameraAim(e)
  20530. }
  20531. ,
  20532. n.prototype._wrapupWarpShading = function(e) {
  20533. this._clearWarpShading(),
  20534. this._wrapupTravel(e)
  20535. }
  20536. ,
  20537. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20538. t !== I.END && this._clearWarpShading(),
  20539. this._wrapupTravelOnlyBits(),
  20540. this.upcomingTransType = null,
  20541. e && e()
  20542. }
  20543. ,
  20544. n.prototype._warpCameraAim = function(e, t) {
  20545. var i = this.warpDestHeroLoc.quaternion
  20546. , n = this.playerControls.cameras[a.PANORAMA]
  20547. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20548. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20549. , l = s.dot(o)
  20550. , u = r.Math.radToDeg(Math.acos(l))
  20551. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20552. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20553. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20554. m.y = h.constrainedTurn(m.y),
  20555. this.burnsDir = Math.sign(m.y);
  20556. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20557. , A = new r.Vector3
  20558. , C = function(e, t) {
  20559. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20560. v.y = g.y + e * m.y,
  20561. v.z = g.z + e * m.z,
  20562. A.set(0, 0, -1),
  20563. A.applyEuler(v),
  20564. A.add(n.position),
  20565. n.controls.lookAt(A),
  20566. n.controls.lookVector.copy(A),
  20567. void n.lookAt(A))
  20568. }
  20569. .bind(this);
  20570. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20571. ,void (t && t())
  20572. )
  20573. }
  20574. ,
  20575. n.prototype._warpBendAim = function(e, t, i, n) {
  20576. var o = n || 0
  20577. , s = this.playerControls.cameras[a.PANORAMA]
  20578. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20579. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20580. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20581. f.y = h.constrainedTurn(f.y);
  20582. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20583. f.x = g * Math.sign(f.x),
  20584. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20585. this.burnsDir = Math.sign(f.y),
  20586. g *= Math.sign(f.y),
  20587. f.y = g;
  20588. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20589. , v = new r.Vector3
  20590. , A = function(e, t) {
  20591. if (e < .5)
  20592. m.x = u.x + e * f.x,
  20593. m.y = u.y + e * f.y,
  20594. m.z = u.z + e * f.z;
  20595. else {
  20596. var i = (1 - e) * c.warp.softBendEnd;
  20597. m.x = l.x - i * f.x,
  20598. m.y = l.y - i * f.y,
  20599. m.z = l.z - i * f.z
  20600. }
  20601. v.set(0, 0, -1),
  20602. v.applyEuler(m),
  20603. v.add(s.position);
  20604. s.controls.lookAt(v),
  20605. s.controls.lookVector.copy(v),
  20606. s.lookAt(v);
  20607. }
  20608. .bind(this);
  20609. return p.start(A, t, i, o, d[c.warp.movementEasing])
  20610. }
  20611. ,
  20612. n.prototype._warpStepCameraAim = function(e, t, i) {
  20613. var n = this.playerControls.cameras[a.PANORAMA]
  20614. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20615. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20616. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20617. l.y = h.constrainedTurn(l.y),
  20618. this.burnsDir = Math.sign(l.y);
  20619. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20620. , f = new r.Vector3
  20621. , g = function(e, t) {
  20622. e < .5 ? u.copy(s) : u.copy(o),
  20623. f.set(0, 0, -1),
  20624. f.applyEuler(u),
  20625. f.add(n.position),
  20626. n.controls.lookAt(f),
  20627. n.controls.lookVector.copy(f),
  20628. n.lookAt(f)
  20629. }
  20630. .bind(this);
  20631. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20632. }
  20633. ,
  20634. n.prototype.setBurnsDir = function() {
  20635. var e = this.playerControls.cameras[a.PANORAMA]
  20636. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20637. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20638. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20639. n.y = h.constrainedTurn(n.y),
  20640. this.burnsDir = Math.sign(n.y)
  20641. }
  20642. ,
  20643. n.prototype.stepWarpPath = function(e, t) {
  20644. var i = this.playerControls.cameras[a.PANORAMA];
  20645. if (!this.warpPathPoints)
  20646. return i.position.copy(this.warpDestPano.position),
  20647. !0;
  20648. var n = this.warpPathPoints[0]
  20649. , o = this.warpDestPano.position;
  20650. if (null !== this.nodes && this.cameraHull.length > 1) {
  20651. var s = new r.Vector3;
  20652. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  20653. i.position.copy(s)
  20654. } else
  20655. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20656. }
  20657. ,
  20658. n.prototype.interruptAndFastForward = function(e, t) {
  20659. this.warping && (this.warpInterrupted = !0,
  20660. this.warpInterruptionBlackoutStyle = e,
  20661. this.warpInterruptionTravelTime = t,
  20662. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20663. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20664. }
  20665. ,
  20666. n.prototype.warpCameraAim = function(e) {
  20667. var t = c.warp.minWarpTime;
  20668. if (this.upcomingTransType === l.BLACK)
  20669. t = c.warp.teleportTime;
  20670. else {
  20671. var i = this.playerControls.cameras[a.PANORAMA]
  20672. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20673. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20674. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20675. s.y = h.constrainedTurn(s.y);
  20676. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20677. t = Math.max(t, u)
  20678. }
  20679. var d = function() {
  20680. this._warpStopFlying(),
  20681. this.discardSlow(),
  20682. e && e()
  20683. }
  20684. .bind(this);
  20685. this._warpCameraAim(t, d)
  20686. }
  20687. ,
  20688. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20689. this.model.skybox.material.uniforms.blackout.value = n;
  20690. var r = u.uniform(this.model.skybox, "progress", 1)
  20691. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20692. , a = !1
  20693. , s = function() {
  20694. if (this.warpInterrupted)
  20695. return a = !0,
  20696. !0
  20697. }
  20698. .bind(this)
  20699. , l = function(e, t) {
  20700. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20701. !0) : void r(e, t)
  20702. }
  20703. .bind(this)
  20704. , h = function(e, t) {
  20705. return i && a ? (o(0),
  20706. !0) : void o(e, t)
  20707. }
  20708. .bind(this);
  20709. p.start(s, e, null, t, null, "safeHaltWatch"),
  20710. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20711. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20712. }
  20713. ,
  20714. n.prototype.warpTravel_STD = function(e) {
  20715. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  20716. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  20717. w += this.warpLength * c.warp.timePerMeter,
  20718. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20719. var _ = !1
  20720. , T = this.warpDestHeroLoc.quaternion
  20721. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20722. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20723. , M = S.dot(x)
  20724. , R = r.Math.radToDeg(Math.acos(M))
  20725. , P = function(e) {
  20726. var t = o
  20727. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20728. return i
  20729. }
  20730. , O = function() {
  20731. return E.lookAt(C, t, A.UP),
  20732. s.setFromRotationMatrix(E, c.warp.eOrder),
  20733. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20734. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20735. h.constrainedTurn(b.y)
  20736. }
  20737. .bind(this)
  20738. , L = function(e, t) {
  20739. if (this.warpInterrupted)
  20740. return _ = !0,
  20741. !0
  20742. }
  20743. .bind(this)
  20744. , D = function(e, t) {
  20745. return _ || !this.warpPathPoints ? (g.blur(0),
  20746. !0) : void g.blur(e)
  20747. }
  20748. .bind(this)
  20749. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20750. , B = function(e, t) {
  20751. return _ || !this.warpPathPoints ? (N(0),
  20752. !0) : void N(e, t)
  20753. }
  20754. .bind(this)
  20755. , F = function(e, t) {
  20756. if (!this.warpPathPoints)
  20757. return n.position.copy(this.warpDestPano.position),
  20758. !0;
  20759. if (_)
  20760. return !0;
  20761. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20762. n.position.copy(i),
  20763. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20764. }
  20765. .bind(this)
  20766. , V = function(e, n) {
  20767. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20768. !0)
  20769. }
  20770. .bind(this)
  20771. , U = function(e, o) {
  20772. if (_)
  20773. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20774. !0;
  20775. if (!this.warpPathPoints)
  20776. return !0;
  20777. var a = this.warpLength * e
  20778. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20779. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20780. c.warp.matchCam && (l *= 1 - u),
  20781. E.lookAt(C, t, A.UP),
  20782. s.setFromRotationMatrix(E, c.warp.eOrder),
  20783. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20784. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20785. b.y = h.constrainedTurn(b.y),
  20786. s.x = m.x + l * b.x,
  20787. s.y = m.y + l * b.y,
  20788. s.z = m.z + l * b.z,
  20789. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20790. b.y = h.constrainedTurn(b.y);
  20791. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20792. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20793. v.x = v.x + b.x * c.warp.turnFriction,
  20794. v.y = v.y + b.y * c.warp.turnFriction,
  20795. v.z = v.z + b.z * c.warp.turnFriction,
  20796. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20797. var p = t.clone().sub(C).normalize();
  20798. if (R < c.warp.maxAimRotation && u > 0) {
  20799. var g = 1 - u;
  20800. p.x = p.x * g + u * S.x,
  20801. p.y = p.y * g + u * S.y,
  20802. p.z = p.z * g + u * S.z,
  20803. p.normalize()
  20804. }
  20805. this.bunnyObj.position.copy(n.position).add(p),
  20806. f.set(0, 0, -1).applyEuler(v).normalize(),
  20807. f.multiplyScalar(8),
  20808. f.add(n.position),
  20809. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20810. n.controls.lookVector.copy(f),
  20811. n.lookAt(f))
  20812. }
  20813. .bind(this)
  20814. , k = function() {
  20815. _ ? (this.discardSlow(),
  20816. this.upcomingTransType = l.BLACK,
  20817. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20818. }
  20819. .bind(this);
  20820. V(0);
  20821. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20822. w += H;
  20823. var G = H / w;
  20824. this.warpCommonParameters(w, G, !0, I.NONE),
  20825. p.start(L, w, null, 0, null, "_haltWatcher"),
  20826. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20827. p.start(D, w, null, G, P, "blurring")),
  20828. p.start(B, w, null, G, P, "modelAlpha"),
  20829. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20830. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20831. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20832. }
  20833. ,
  20834. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20835. var r = e || 0;
  20836. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  20837. this.warpCommonParameters(t, r, !1, i),
  20838. this.model.chunks.forEach(function(e) {
  20839. e.material.uniforms.blackout.value = i
  20840. }),
  20841. this._warpBendAim(null, t, null, r);
  20842. var o = function() {
  20843. this.wrapupWarpShadingOnly(n, i);
  20844. }
  20845. .bind(this);
  20846. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20847. }
  20848. ,
  20849. n.prototype.flightStepWalk = function(e, t, i) {
  20850. var n = .001
  20851. , o = 1
  20852. , a = 1.2
  20853. , s = new r.Vector3
  20854. , h = new r.Vector3
  20855. , u = function(e, t) {
  20856. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20857. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20858. h.copy(A.FORWARD),
  20859. this.player.getDirection(h),
  20860. s.copy(t).sub(e.position).normalize();
  20861. var l = s.dot(h)
  20862. , u = Math.acos(l)
  20863. , d = u / r;
  20864. return d > n && (r *= d / n,
  20865. u < o && (r *= a)),
  20866. r
  20867. };
  20868. return function(e, t, i) {
  20869. if (this.warpInterrupted)
  20870. i && i();
  20871. else if (this.activeTransType !== l.WALK)
  20872. this._clearWarpShading(),
  20873. this._warpStopFlying(),
  20874. this.player.spider.draw(),
  20875. this.placeCpm(),
  20876. i && i();
  20877. else if (this.player.currentPano !== e) {
  20878. var n = {
  20879. pano: e,
  20880. lookAtPoint: t,
  20881. duration: null,
  20882. maxDistanceOverride: c.warp.walkMaxDist,
  20883. skipWarpingCheck: !1,
  20884. constantMoveSpeed: !0
  20885. };
  20886. n.duration = u.call(this, e, t),
  20887. this.player.nonInterruptingFlyToPano(n, i)
  20888. } else
  20889. i && i()
  20890. }
  20891. }(),
  20892. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20893. return this.flightStepWalk.bind(this, e, t, i)
  20894. }
  20895. ,
  20896. n.prototype.warpTravel_WALK = function() {
  20897. var e = [];
  20898. return function(t) {
  20899. var i = this.player.model.panos;
  20900. e.length = 0;
  20901. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20902. var s = this.nodes[a]
  20903. , l = i.get(s);
  20904. a === this.nodes.length - 1;
  20905. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20906. n && o || (e.push(s),
  20907. n = l)
  20908. }
  20909. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20910. var h = e.length
  20911. , u = i.get(e[h - 1])
  20912. , d = new Array(h + 1);
  20913. d[d.length - 1] = function() {
  20914. t && t()
  20915. }
  20916. .bind(this);
  20917. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20918. var g = e[p];
  20919. u = i.get(g);
  20920. var m = new r.Vector3;
  20921. this.getLookAtForWalkingTourNode(e, p, m),
  20922. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20923. p--
  20924. }
  20925. d[0]()
  20926. }
  20927. }(),
  20928. n.prototype.getLookAtForWalkingTourNode = function() {
  20929. var e = new r.Vector3
  20930. , t = new r.Vector3
  20931. , i = new r.Vector3
  20932. , n = new r.Vector3
  20933. , o = new r.Vector3
  20934. , a = .65
  20935. , s = .75
  20936. , l = .2
  20937. , c = .4
  20938. , h = .2
  20939. , u = 3;
  20940. return function(r, d, p) {
  20941. var f = r.length;
  20942. if (d >= f)
  20943. return !1;
  20944. var g = 1
  20945. , m = 1;
  20946. t.set(0, 0, 0),
  20947. o.set(0, 0, 0);
  20948. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20949. if (v = this.player.model.panos.get(r[A]),
  20950. this.getOrientationForWalkingTourNode(r, A, i),
  20951. A === d && e.copy(i),
  20952. n.copy(i),
  20953. A > d) {
  20954. var y = n.dot(e) < a;
  20955. g *= y ? l : s,
  20956. m *= y ? h : c
  20957. }
  20958. i.multiplyScalar(g),
  20959. t.add(i),
  20960. o.lerp(v.position, m)
  20961. }
  20962. return t.normalize(),
  20963. p.copy(o),
  20964. p.add(t),
  20965. !0
  20966. }
  20967. }(),
  20968. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20969. var n = e.length;
  20970. if (t >= n)
  20971. return !1;
  20972. if (t === n - 1)
  20973. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20974. else {
  20975. var r = this.player.model.panos.get(e[t])
  20976. , o = this.player.model.panos.get(e[t + 1]);
  20977. i.copy(o.position).sub(r.position)
  20978. }
  20979. return i.normalize(),
  20980. !0
  20981. }
  20982. ,
  20983. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20984. if (this.activeTransType = this.upcomingTransType,
  20985. this.lastTransType = this.activeTransType,
  20986. this.upcomingTransType = null,
  20987. !e) {
  20988. var r = function() {
  20989. this._wrapupTravel(n)
  20990. }
  20991. .bind(this)
  20992. , o = {
  20993. pano: this.warpDestPano,
  20994. lookAtPoint: null,
  20995. duration: null,
  20996. maxDistanceOverride: null,
  20997. skipWarpingCheck: !1
  20998. };
  20999. return void this.player.flyToPano(o, r)
  21000. }
  21001. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21002. this._clearWarpShading(),
  21003. this._warpStopFlying(),
  21004. this.player.spider.draw(),
  21005. this.placeCpm(),
  21006. n && n()
  21007. }
  21008. .bind(this)) : this.warpTravel_STD(n)
  21009. }
  21010. ,
  21011. n.prototype.startWarpState = function() {
  21012. this.warping = !0,
  21013. this.warpInterrupted = !1,
  21014. this.warpInterruptionBlackoutStyle = null,
  21015. this.warpInterruptionTravelTime = null
  21016. }
  21017. ,
  21018. n.prototype.endWarpState = function() {
  21019. this.warping = !1
  21020. }
  21021. ,
  21022. n.prototype.warpToPano = function(e, t, i, n) {
  21023. if (this.warping)
  21024. return void y.warn("Cannot warp when already warping");
  21025. if (this.upcomingTransType = e,
  21026. this.activeTransType = null,
  21027. !this.setWarpDestPano())
  21028. return this.upcomingTransType = null,
  21029. void this.warpToNonPano(n);
  21030. if (this.player.mode !== a.PANORAMA)
  21031. return this.upcomingTransType = null,
  21032. this.discardSlow(),
  21033. void this.player.flyToNewMode({
  21034. mode: a.PANORAMA,
  21035. pano: this.warpDestPano,
  21036. duration: c.warp.outsideTime,
  21037. warpDest: this.warpDestHeroLoc,
  21038. callback: n,
  21039. force: !0
  21040. });
  21041. if (!this.warpDestPano)
  21042. return y.warn("no warp destination, callback dropped"),
  21043. void (this.upcomingTransType = null);
  21044. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  21045. , o = this.chooseWarpPath(r);
  21046. if (o && this.upcomingTransType !== l.WALK) {
  21047. var s = function() {
  21048. this.waitingToWarp = !1,
  21049. this.warpToPano(e, t, i, n)
  21050. }
  21051. .bind(this);
  21052. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21053. return void (this.waitingToWarp = !0)
  21054. }
  21055. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21056. this.player.currentPano = this.warpDestPano,
  21057. this.placeCpm(),
  21058. this.fadeOutCpm(c.path.fadeOutTime),
  21059. this.player.spider.draw()),
  21060. y.debug("Warping to pano ", this.warpDestPano.position),
  21061. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21062. this.startWarpState();
  21063. var h = function() {
  21064. this.endWarpState(),
  21065. n && n()
  21066. }
  21067. .bind(this);
  21068. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21069. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21070. }
  21071. ,
  21072. t.exports = n
  21073. }
  21074. ).call(this, "/js/objects/ShowPath.js")
  21075. }
  21076. , {
  21077. "../constants": 8,
  21078. "../effects": 16,
  21079. "../enum/BlackoutStyle": 18,
  21080. "../enum/ModelManagerEvents": 33,
  21081. "../enum/PlayerEvents": 40,
  21082. "../enum/RenderOrder": 42,
  21083. "../enum/Vectors": 50,
  21084. "../enum/Viewmode": 51,
  21085. "../enum/WarpStyle": 52,
  21086. "../gui/gui": 65,
  21087. "../model/ModelManager": 140,
  21088. "../objects/Snapshot": 153,
  21089. "../settings": 166,
  21090. "../shaders": 167,
  21091. "../util/easing": 186,
  21092. "../util/lerp": 188,
  21093. "../util/logger": 189,
  21094. "../util/math": 190,
  21095. "../util/texture": 194,
  21096. "../util/transitions": 195,
  21097. three: 217
  21098. }],
  21099. 152: [function(e, t, i) {
  21100. "use strict";
  21101. function n() {
  21102. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21103. , t = new r.RawShaderMaterial({
  21104. fragmentShader: o.skysphere.fragmentShader,
  21105. vertexShader: o.skysphere.vertexShader,
  21106. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21107. side: r.BackSide,
  21108. name: "skysphere"
  21109. });
  21110. t.uniforms.radius.value = e.parameters.radius,
  21111. r.Mesh.call(this, e, t)
  21112. }
  21113. var r = e("three")
  21114. , o = e("../shaders")
  21115. , a = e("../settings");
  21116. n.prototype = Object.create(r.Mesh.prototype),
  21117. n.prototype.constructor = n,
  21118. t.exports = n
  21119. }
  21120. , {
  21121. "../settings": 166,
  21122. "../shaders": 167,
  21123. three: 217
  21124. }],
  21125. 153: [function(e, t, i) {
  21126. (function(i) {
  21127. "use strict";
  21128. function n(e) {
  21129. o.call(this, e),
  21130. this.sid = e.sid,//xzw add
  21131. this.panoId = e.panoId,
  21132. this.orthoZoom = e.orthoZoom,
  21133. this.floorVisibility = e.floorVisibility,
  21134. this.thumbUrl = e.thumbUrl,
  21135. this.name = e.name,
  21136. this.zoom = e.zoom
  21137. }
  21138. var r = (e("three"),
  21139. e("../util/logger"))
  21140. , o = (e("../settings"),
  21141. e("../enum/Viewmode"),
  21142. e("../util/common"),
  21143. e("../util/transitions"),
  21144. e("../util/lerp"),
  21145. e("../util/ajax"),
  21146. e("../util/texture"),
  21147. e("./View"));
  21148. e("events").EventEmitter,
  21149. new r(i);
  21150. n.prototype = Object.create(o.prototype),
  21151. n.prototype.isPano = function() {
  21152. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21153. }
  21154. ,
  21155. t.exports = n
  21156. }
  21157. ).call(this, "/js/objects/Snapshot.js")
  21158. }
  21159. , {
  21160. "../enum/Viewmode": 51,
  21161. "../settings": 166,
  21162. "../util/ajax": 181,
  21163. "../util/common": 185,
  21164. "../util/lerp": 188,
  21165. "../util/logger": 189,
  21166. "../util/texture": 194,
  21167. "../util/transitions": 195,
  21168. "./View": 154,
  21169. events: 202,
  21170. three: 217
  21171. }],
  21172. 154: [function(e, t, i) {
  21173. (function(i) {
  21174. "use strict";
  21175. function n(e) {
  21176. e = e || {},
  21177. this.position = new r.Vector3,
  21178. this.quaternion = new r.Quaternion,
  21179. this.update(e)
  21180. }
  21181. var r = e("three")
  21182. , o = e("../util/logger")
  21183. , a = (e("../settings"),
  21184. e("../enum/Viewmode"),
  21185. e("../util/common"),
  21186. e("../util/transitions"),
  21187. e("../util/lerp"),
  21188. e("../util/ajax"),
  21189. e("../util/texture"),
  21190. e("events").EventEmitter);
  21191. new o(i);
  21192. n.prototype = Object.create(a.prototype),
  21193. n.prototype.isValid = function() {
  21194. return !!this.cameraMode
  21195. }
  21196. ,
  21197. n.prototype.update = function(e) {
  21198. return this.cameraMode = e.cameraMode || this.cameraMode,
  21199. this.pano = e.pano || this.pano,
  21200. e.position && this.position.copy(e.position),
  21201. e.quaternion && this.quaternion.copy(e.quaternion),
  21202. this
  21203. }
  21204. ,
  21205. t.exports = n
  21206. }
  21207. ).call(this, "/js/objects/View.js")
  21208. }
  21209. , {
  21210. "../enum/Viewmode": 51,
  21211. "../settings": 166,
  21212. "../util/ajax": 181,
  21213. "../util/common": 185,
  21214. "../util/lerp": 188,
  21215. "../util/logger": 189,
  21216. "../util/texture": 194,
  21217. "../util/transitions": 195,
  21218. events: 202,
  21219. three: 217
  21220. }],
  21221. 155: [function(e, t, i) {//player.js
  21222. (function(i) {
  21223. "use strict";
  21224. function n(e) {
  21225. this.currentPano = null,
  21226. this.nextPano = null,
  21227. this.camera = null,
  21228. this.paused = !1,
  21229. this.flying = !1,
  21230. this.sceneIntersectionPlane = null,
  21231. this.target = new r.Vector3,
  21232. this.mouse = new r.Vector3(1.1,1.1,.5),
  21233. this.mouseAtMouseDown = new r.Vector2,
  21234. this.mouseCouldBeClickToMove = !1,
  21235. this.mouseLastMoveTime = Date.now(),
  21236. this.mouseDown = !1,
  21237. this.mouseDownTimer = null,
  21238. this.couldBeLongTap = !1,
  21239. this.containsMouse = !0,
  21240. this.isTouchEvent = !1,
  21241. this.isPanoHover = !1,
  21242. this.reticule = new a(this),
  21243. this.panoMarkers = [],
  21244. this.spider = new h(this),
  21245. this.quaternion = new r.Quaternion,
  21246. this.position = new r.Vector3(15,10,15),
  21247. this.previousState = null,
  21248. this.lastInsideView = new c,
  21249. this.last360View = new c,
  21250. this.raycaster = new r.Raycaster,
  21251. this.intersect = null,
  21252. this.lastChangeTime = Date.now(),
  21253. this.history = new I,
  21254. this.cameraControls = null,
  21255. this.path = null,
  21256. this.model = null,
  21257. this.domElement = null,
  21258. this.cachedPanoCandidates = null,
  21259. this.basePanoSize = 0,
  21260. this.standardPanoSize = 0,
  21261. this.highPanoSize = 0,
  21262. this.ultraHighPanoSize = 0,
  21263. this.zoomLevel = 1,
  21264. this.zooming = 0,
  21265. this.zoomSpeed = .5,
  21266. this.scrollZoomSpeed = .06,
  21267. this.zoomSpeedAdjust = .05,
  21268. this.defaultZoomIncrement = .2,
  21269. this.baseFov = f.insideFOV,
  21270. this.zoomFov = this.baseFov,
  21271. this.zoomEnabled = !0,
  21272. this.preRenderingEnabled = !1,
  21273. this.setupCustomProperties(e),
  21274. this.zoomStats = new L
  21275. }
  21276. var r = e("three")
  21277. , o = e("./util/logger")
  21278. , a = e("./objects/Reticule")
  21279. , s = e("./objects/Panorama")
  21280. , l = e("./objects/ShowPath")
  21281. , c = e("./objects/View")
  21282. , h = (e("./objects/Snapshot"),
  21283. e("./objects/NSpider"))
  21284. , u = e("./enum/Viewmode")
  21285. , d = (e("./enum/TagStates"),
  21286. e("./enum/Vectors"))
  21287. , p = e("./enum/Keys")
  21288. , f = (e("./enum/AlignmentType"),
  21289. e("./settings"))
  21290. , g = e("./util/common")
  21291. , m = (e("./util/browser"),
  21292. e("./util/math"))
  21293. , v = e("./util/lerp")
  21294. , A = e("./util/easing")
  21295. , y = e("./util/transitions")
  21296. , C = e("events").EventEmitter
  21297. , I = (e("./shaders"),
  21298. e("./util/history"))
  21299. , E = (e("./util/camera"),
  21300. e("./model/ModelManager"),
  21301. e("./enum/PathDiscardMode"))
  21302. , b = e("./enum/PathDisplayMode")
  21303. , w = e("./enum/PlayerEvents")
  21304. , _ = e("./enum/ControlEvents")
  21305. , T = e("./enum/ModelManagerEvents")
  21306. , x = e("./enum/WarpStyle")
  21307. , S = e("./enum/BlackoutStyle")
  21308. , M = e("./exception/BasicException")
  21309. , R = e("./enum/PanoSizeClass")
  21310. , P = (e("./tile/TileDownloader"),
  21311. e("./tile/TilePrioritizer"))
  21312. , O = (e("./enum/PanoramaEvents"),
  21313. e("./enum/ZoomEvents"))
  21314. , L = e("./util/ZoomStats")
  21315. , D = e("./constants")
  21316. , N = e("./util/common")
  21317. , B = e("./util/cameraLight")
  21318. , Hot = e('hot')
  21319. , F = new o(i)
  21320. , V = Object.freeze({
  21321. FlyToPano: y.getUniqueId(),
  21322. FlyToNewMode: y.getUniqueId(),
  21323. FlyToSameMode: y.getUniqueId(),
  21324. FlyToViewFloor: y.getUniqueId(),
  21325. LookTransition: y.getUniqueId(),
  21326. ZoomTransition: y.getUniqueId()
  21327. });
  21328. n.prototype = Object.create(C.prototype),
  21329. n.prototype.init = function(e) {
  21330. window.player = this
  21331. this.modelManager = e.modelManager,
  21332. this.tileDownloader = e.tileDownloader,
  21333. this.panoRenderer = e.panoRenderer,
  21334. this.qualityManager = e.qualityManager,
  21335. this.domElement = e.container,
  21336. this.camera = e.camera,
  21337. this.tagManager = e.tagManager,
  21338. this.cameraControls = e.controls,
  21339. this.path = new l(e.director,this,e.controls),
  21340. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21341. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21342. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21343. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21344. this.tileDownloader.processPriorityQueue = !1,
  21345. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21346. this.bindEvents(e.container),
  21347. this.updateModel()
  21348. }
  21349. //xzw add: 截图
  21350. function dataURLtoBlob(dataurl) {
  21351. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21352. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21353. while(n--){
  21354. u8arr[n] = bstr.charCodeAt(n);
  21355. };
  21356. return new Blob([u8arr], {type:mime});
  21357. }
  21358. n.prototype.screenShot = function(o){
  21359. if(this.flying || this.flyingToTag) return;
  21360. var R = this.sceneRenderer;
  21361. R.updateScreenSize(o);
  21362. for(var i in this.model.panos.index){
  21363. if(!this.model.panos.index[i].marker) continue;
  21364. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21365. this.model.panos.index[i].marker.visible = false;
  21366. }
  21367. for(var i in this.model.hots){
  21368. this.model.hots[i].mesh.visible = false;
  21369. }
  21370. this.reticule.visible = false;
  21371. this.reticule.forceUnvisible = true;
  21372. this.path.currentPanoMarker.mesh.visible = false;
  21373. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21374. R.renderer.clear(true,true,true);
  21375. R.renderer.render(R.scene, R.camera);
  21376. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21377. o.f && o.f(imgData)
  21378. R.updateScreenSize({resize:true});
  21379. this.reticule.visible = true;
  21380. for(var i in this.model.hots){
  21381. this.model.hots[i].mesh.visible = true;
  21382. }
  21383. for(var i in this.model.panos.index){
  21384. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21385. }
  21386. this.path.currentPanoMarker.mesh.visible = true;
  21387. R.renderer.render(R.scene, R.camera);
  21388. }.bind(this),30) //这个数字不能太小
  21389. }
  21390. var scaleImg = e("scaleImg");
  21391. var ResizeImg = function(img, option){
  21392. var img2; //不能直接改img 否则可能触发第二次img.onload
  21393. var compress = function(ratio,type){
  21394. var image = img2 || img;
  21395. var c = document.createElement('canvas');
  21396. c.width = image.width; c.height = image.height;
  21397. var ctx = c.getContext('2d');
  21398. ctx.drawImage(image,0,0,image.width,image.height);
  21399. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21400. }
  21401. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21402. var image = img2 || img;
  21403. var blob = dataURLtoBlob(image.src);
  21404. if(option.maxWeight && blob.size > option.maxWeight){
  21405. compress(option.maxWeight/blob.size, "jpeg")
  21406. blob = dataURLtoBlob(image.src);
  21407. }
  21408. if(!img2){
  21409. img2 = new Image();
  21410. }
  21411. img2.base64Src = image.src;
  21412. img2.src = window.URL.createObjectURL(blob);
  21413. }
  21414. var oldSize = Math.max(img.width, img.height);
  21415. if(option.toType != "png"){//不是非要png的话
  21416. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21417. if(oldSize > option.maxSize){
  21418. compress(option.maxSize/oldSize, "jpeg");
  21419. }
  21420. reCom();
  21421. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21422. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21423. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21424. reCom();
  21425. }
  21426. }
  21427. }else{
  21428. //?貌似png会越压缩越大?
  21429. }
  21430. return img2 || img;
  21431. }
  21432. var _fixType=function(type) {
  21433. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21434. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21435. return 'image/' + r;
  21436. };
  21437. var saveFile=function(data, filename){
  21438. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21439. save_link.href = data;
  21440. save_link.download = filename;
  21441. var event = document.createEvent('MouseEvents');
  21442. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21443. save_link.dispatchEvent(event);
  21444. };
  21445. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21446. var info = this.getSnapAngleInfo();
  21447. var str = ',{\r\t' + info;
  21448. var arg = arguments[0];
  21449. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21450. if (arg && arg.__callback) {
  21451. return arg.__callback(imgData, info)
  21452. }
  21453. var img = new Image();
  21454. img.src = imgData;
  21455. img.onload = function(){
  21456. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21457. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21458. var filename = "snap" + (new Date()).getTime();
  21459. saveFile(img2.src,filename + ".jpg");
  21460. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21461. str +=('\r\t"sid":"'+filename+'",');
  21462. str +=('\r\t"name":"'+filename+'"\r}');
  21463. logData(str)
  21464. }
  21465. }});
  21466. }
  21467. ,
  21468. n.prototype.getSnapAngleInfo = function(){
  21469. var info = {};
  21470. var str = '"metadata":{';
  21471. var q = this.camera.quaternion.clone();
  21472. switch (this.mode) {
  21473. case "panorama":
  21474. info.scan_id = this.currentPano.id;
  21475. str += ('"scan_id":"'+this.currentPano.id+'",');
  21476. break;
  21477. case "floorplan":
  21478. info.camera_mode = 1;
  21479. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21480. q.multiply(this.camera.quaternion);
  21481. str += ('"camera_mode":1,');
  21482. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21483. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21484. break;
  21485. case "dollhouse":
  21486. info.camera_mode = 2;
  21487. str += ('"camera_mode":2,');
  21488. break;
  21489. }
  21490. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21491. console.log(info.camera_position)
  21492. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21493. /**fyz 对相机截屏的角度进行校对 */
  21494. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21495. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21496. out.x *= -1;
  21497. out.w *= -1;
  21498. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21499. }else{
  21500. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21501. }
  21502. info.zoom = this.zoomLevel;
  21503. console.log(info.camera_quaternion)
  21504. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21505. // fyz 扩展编辑页面, 加上导览点缩放值
  21506. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21507. return str;
  21508. }
  21509. //------end
  21510. n.prototype.closePopup = function() {//xzw 关闭热点页面
  21511. if(!g_currentHot) return;
  21512. g_currentHot = null;
  21513. var hotPop = document.getElementById('popup');
  21514. hotPop.style.display = "none";
  21515. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  21516. $("#popup iframe:last").remove();
  21517. var _bgaudio = document.getElementById("bgaudio");
  21518. //判断音乐是否暂停或者是否存在
  21519. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  21520. {
  21521. //g_bgAudio.play();
  21522. manage.switchBgmState(true)
  21523. }; */
  21524. if(g_bgAudio && g_bgAudio.pauseByHot){
  21525. manage.switchBgmState(true)
  21526. }
  21527. //$('#player').off("click",this.closePopup);
  21528. return false
  21529. }
  21530. n.prototype.setupCustomProperties = function(e) {
  21531. var t = e || u.PANORAMA;
  21532. Object.defineProperty(this, "mode", {
  21533. get: function() {
  21534. return t
  21535. },
  21536. set: function(e) {
  21537. var i = t;
  21538. t = e,
  21539. this.onModeUpdated(i, t)
  21540. }
  21541. })
  21542. }
  21543. ,
  21544. n.prototype.isInMode = function() {
  21545. for (var e = 0; e < arguments.length; e++)
  21546. if (this.mode === arguments[e])
  21547. return !0;
  21548. return !1
  21549. }
  21550. ,
  21551. n.prototype.isOutsideMode = function(e) {
  21552. return e = e || this.mode,
  21553. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21554. }
  21555. ,
  21556. n.prototype.is360View = function(e, t) {
  21557. return e === u.PANORAMA && t && !t.isAligned()
  21558. }
  21559. ,
  21560. n.prototype.setScene = function(e) {
  21561. this.sceneIntersectionPlane = e.plane,
  21562. this.path.setScene(e),
  21563. this.moveReticuleToScene(e)
  21564. }
  21565. ,
  21566. n.prototype.moveReticuleToScene = function(e) {
  21567. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21568. e.add(this.reticule)
  21569. }
  21570. ,
  21571. n.prototype.updateModel = function() {
  21572. function e(e, t, n) {
  21573. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21574. }
  21575. function t(e, t) {
  21576. if (this.mode === u.DOLLHOUSE) {
  21577. var n = e ? this.model.center.y : n = t.center.y;
  21578. i.call(this, n)
  21579. }
  21580. }
  21581. function i(e) {
  21582. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21583. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21584. , n = t.position.y + (e - i.target.y)
  21585. , r = f.showFloorDuration + f.showFloorDelay;
  21586. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21587. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21588. }
  21589. this.model = this.modelManager.getActiveModel(),
  21590. this.model.on("floor.changed", e.bind(this)),
  21591. this.model.on("allfloors.toggled", t.bind(this)),
  21592. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21593. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21594. var e2 = this;
  21595. this.model.panos.list.forEach(function(a) {
  21596. a.vrMarker.addEventListener("click", function() {
  21597. e2.flyToPano({
  21598. pano: a
  21599. })
  21600. })
  21601. })
  21602. /********************************************************************************************************************************************/
  21603. }
  21604. ,
  21605. n.prototype.updateModelDependentData = function() {
  21606. this.cameraControls.setModelForControls(this.model),
  21607. this.getPanoMarkersFromModel(this.model)
  21608. }
  21609. ,
  21610. n.prototype.onModelChanged = function() {
  21611. this.updateModel(),
  21612. this.updateModelDependentData()
  21613. }
  21614. ,
  21615. n.prototype.getPanoMarkersFromModel = function(e) {
  21616. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21617. return t.marker ? e.concat(t.marker) : e
  21618. }, [])
  21619. }
  21620. ,
  21621. n.prototype.handleControlMove = function(e) {
  21622. this.emit(w.Move, e)
  21623. }
  21624. ,
  21625. n.prototype.handleControlInputStart = function(e) {
  21626. this.emit(w.InputStart, e)
  21627. }
  21628. ,
  21629. n.prototype.onModeUpdated = function(e, t) {
  21630. this.cameraControls.activateControls(t),
  21631. this.emit(w.ModeChanged, e, t)
  21632. }
  21633. ,
  21634. n.prototype.isWarping = function() {
  21635. return this.path.warping
  21636. }
  21637. ,
  21638. n.prototype.isWaitingToWarp = function() {
  21639. return this.path.waitingToWarp
  21640. }
  21641. ,
  21642. n.prototype.getLabelScaleFactor = function() {
  21643. if (this.isOutsideMode()) {
  21644. var e = 10
  21645. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21646. return t
  21647. }
  21648. return .5
  21649. }
  21650. ,
  21651. n.prototype.changeMusic = function() {//xzw add
  21652. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  21653. g_playAudio = g_bgAudio;
  21654. //g_bgAudio.play();
  21655. manage.switchBgmState(true)
  21656. }else{
  21657. if(!g_play){
  21658. g_playAudio = g_bgAudio;
  21659. }else{//防止再次播放时重播一遍
  21660. g_playAudio = null;
  21661. }
  21662. } */
  21663. /* if(!this.director.tourIsPlaying && g_bgAudio){
  21664. manage.switchBgmState(true)
  21665. } */
  21666. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21667. }
  21668. ,
  21669. n.prototype.bindEvents = function(e) {
  21670. e !== document && e.setAttribute("tabindex", -1),
  21671. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21672. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21673. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21674. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21675. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21676. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21677. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21678. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21679. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21680. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21681. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21682. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21683. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21684. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21685. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21686. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21687. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21688. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21689. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21690. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21691. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21692. // lzb
  21693. window.getSeft && getSeft(this);
  21694. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  21695. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  21696. $('#closepop').on("touchstart",this.closePopup.bind(this));
  21697. }else{
  21698. $('#closepop').on("click",this.closePopup.bind(this));
  21699. }
  21700. }
  21701. ,
  21702. n.prototype.onMouseDown = function(e) {
  21703. e.currentTarget !== document && e.currentTarget.focus(),
  21704. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21705. this.updateIntersect())
  21706. }
  21707. ,
  21708. n.prototype.onMouseMove = function(e) {
  21709. this.isTouchEvent = !1,
  21710. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21711. }
  21712. ,
  21713. n.prototype.onMouseOver = function(e) {
  21714. this.containsMouse = !0,
  21715. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21716. }
  21717. ,
  21718. n.prototype.onMouseOut = function(e) {
  21719. this.containsMouse = !1
  21720. }
  21721. ,
  21722. n.prototype.onMouseUp = function(e) {
  21723. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21724. }
  21725. ,
  21726. n.prototype.onTouchStart = function(e) {
  21727. if (e.currentTarget !== document && e.currentTarget.focus(),
  21728. !this.mouseDown) {
  21729. this.couldBeLongTap = !0;
  21730. var t = g.average(e.changedTouches, "clientX")
  21731. , i = g.average(e.changedTouches, "clientY");
  21732. this.handleInputStart.call(this, t, i, !0),
  21733. this.mouseDownTimer = setTimeout(function() {
  21734. this.updateIntersect(),
  21735. this.handleInputEnd.call(this, t, i, !0)
  21736. }
  21737. .bind(this), f.input.longTapThreshold)
  21738. }
  21739. }
  21740. ,
  21741. n.prototype.onTouchMove = function(e) {
  21742. var t = g.average(e.changedTouches, "clientX")
  21743. , i = g.average(e.changedTouches, "clientY");
  21744. this.handleInputMove.call(this, t, i, !0)
  21745. }
  21746. ,
  21747. n.prototype.onTouchEnd = function(e) {
  21748. if (clearTimeout(this.mouseDownTimer),
  21749. this.mouseDown) {
  21750. this.couldBeLongTap = !1,
  21751. this.updateIntersect();
  21752. var t = g.average(e.changedTouches, "clientX")
  21753. , i = g.average(e.changedTouches, "clientY");
  21754. this.handleInputEnd.call(this, t, i, !0)
  21755. }
  21756. }
  21757. ,
  21758. n.prototype.onPointerDown = function(e) {
  21759. return e.currentTarget !== document && e.currentTarget.focus(),
  21760. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21761. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21762. void (this.mouseDownTimer = setTimeout(function() {
  21763. this.updateIntersect(),
  21764. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21765. }
  21766. .bind(this), f.input.longTapThreshold)))
  21767. }
  21768. ,
  21769. n.prototype.onPointerMove = function(e) {
  21770. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21771. }
  21772. ,
  21773. n.prototype.onPointerUp = function(e) {
  21774. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21775. this.couldBeLongTap = !1,
  21776. this.updateIntersect(),
  21777. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21778. }
  21779. ,
  21780. n.prototype.onPointerOut = function(e) {
  21781. this.mouseDown = !1
  21782. }
  21783. ,
  21784. n.prototype.onPointerCancel = function(e) {
  21785. this.mouseDown = !1
  21786. }
  21787. ,
  21788. n.prototype.onKeyDown = function(e) {
  21789. var t = function() {
  21790. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21791. }
  21792. .bind(this)
  21793. , i = e.which;
  21794. switch (i) {
  21795. case p.F:
  21796. t(),
  21797. this.changeFloor(-1);
  21798. break;
  21799. case p.R:
  21800. t(),
  21801. this.changeFloor(1)
  21802. }
  21803. if (this.mode === u.PANORAMA)
  21804. switch (i) {
  21805. case p.UPARROW:
  21806. case p.W:
  21807. this.flyLocalDirection(d.FORWARD.clone());
  21808. break;
  21809. case p.DOWNARROW:
  21810. case p.S:
  21811. this.flyLocalDirection(d.BACK.clone());
  21812. break;
  21813. case p.A:
  21814. this.flyLocalDirection(d.LEFT.clone());
  21815. break;
  21816. case p.D:
  21817. this.flyLocalDirection(d.RIGHT.clone())
  21818. }
  21819. }
  21820. ,
  21821. n.prototype.handleScrollPinchZoom = function() {
  21822. return function(e) {
  21823. var t = e
  21824. , i = this.zoomLevel;
  21825. this.zoomBy(t),
  21826. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21827. }
  21828. }(),
  21829. n.prototype.handleControlPinch = function(e) {
  21830. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21831. }
  21832. ,
  21833. n.prototype.handleControlScroll = function(e) {
  21834. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21835. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21836. }
  21837. ,
  21838. n.prototype.handleInputStart = function(e, t, i) {
  21839. //许钟文加
  21840. var pad = this.handelPadding(e, t);
  21841. e = pad.x;
  21842. t = pad.y;
  21843. this.isTouchEvent = i,
  21844. m.convertScreenPositionToNDC(e, t, this.mouse),
  21845. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21846. this.mouseCouldBeClickToMove = !0,
  21847. this.mouseDown = !0;
  21848. if (this.mouseCouldBeClickToMove) {
  21849. //window.DownInterface && new DownInterface().state(this,Hot);
  21850. window.Hotpoint && new Hotpoint().state(this,Hot);
  21851. }
  21852. if( this.overlayGroup.children.length){
  21853. this.overlayGroup.children.forEach((overlay)=>{
  21854. overlay.overlayType == "video" /* && overlay.inSight */&& overlay.plane.material.map.image.play()
  21855. })
  21856. //this.overlayInitedPlay = true
  21857. }
  21858. }
  21859. ,
  21860. n.prototype.handelPadding = function(x, y) {
  21861. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21862. if (!this.pad)
  21863. this.pad = {
  21864. x: dom.getOffset("left", $("#player")[0]),
  21865. y: dom.getOffset("top", $("#player")[0])
  21866. }
  21867. return {
  21868. x: x - this.pad.x,
  21869. y: y - this.pad.y
  21870. }
  21871. }
  21872. n.prototype.handleInputMove = function(e, t, i) {
  21873. //许钟文加
  21874. var pad = this.handelPadding(e, t);
  21875. e = pad.x;
  21876. t = pad.y;
  21877. this.isTouchEvent = i,
  21878. m.convertScreenPositionToNDC(e, t, this.mouse),
  21879. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21880. this.couldBeLongTap = !1,
  21881. clearTimeout(this.mouseDownTimer)),
  21882. this.mouseLastMoveTime = Date.now(),
  21883. this.reticule.move(e, t, i)
  21884. }
  21885. ,
  21886. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21887. if (this.isTouchEvent = i,
  21888. this.mouseDown = !1,
  21889. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21890. !i && this.couldBeLongTap)
  21891. return !0;
  21892. if (this.handleLongTap())
  21893. return !0;
  21894. if (this.mouseCouldBeClickToMove) {
  21895. if (this.flying)
  21896. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21897. !0;
  21898. //add----
  21899. if(this.checkHotClick())//add
  21900. return !0;
  21901. if(this.hoveringPlane){
  21902. this.clickOverlay(this.hoveringPlane)
  21903. return;
  21904. }
  21905. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21906. this.history.invalidate(),
  21907. this.intersect && (this.mode == "panorama" || !window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch))// 改
  21908. return this.flyToPanoClosestToMouse();
  21909. if (this.mode === u.PANORAMA) {
  21910. var n = this.closestPanoInDirection(this.getMouseDirection());
  21911. return n ? this.flyToPano({
  21912. pano: n
  21913. }) : this.bump(this.getMouseDirection())
  21914. }
  21915. }
  21916. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21917. }
  21918. ,
  21919. n.prototype.handleLongTap = function() {
  21920. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21921. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21922. !0
  21923. }
  21924. ,
  21925. n.prototype.checktagClick = function() {
  21926. if (this.tagManager.intersectTag) {
  21927. var e = this.isTouchEvent
  21928. , t = this.tagManager.clickedOnTag(e, this);
  21929. return e || t || y.cancelById(V.LookTransition),
  21930. !0
  21931. }
  21932. if (this.tagManager.activeTag)
  21933. return this.tagManager.dismissActiveTag(),
  21934. !1
  21935. }
  21936. ,
  21937. n.prototype.rankedtagInDirection = function(e, t) {
  21938. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21939. }
  21940. ,
  21941. n.prototype.start = function(e) {
  21942. //-------------------
  21943. window.initOverlay(r)
  21944. this.model.loadOverlays()
  21945. $('.hardware-list').removeClass('unable')
  21946. //-------------------
  21947. var t = e.mode
  21948. , i = e.pano
  21949. , n = e.position
  21950. , rr = e.quaternion
  21951. , o = e.tag
  21952. , a = e.quickstart
  21953. , s = $.Deferred();
  21954. this.updateModelDependentData(),
  21955. this.updateFromControls(),
  21956. this.findDefaultViews();
  21957. var l = this.is360View(t, i);
  21958. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21959. s.done(function(e) {
  21960. this.emit(w.Ready, l, e, o)
  21961. }
  21962. .bind(this)),
  21963. s.promise()
  21964. }
  21965. ,
  21966. n.prototype.startOutside = function(e, t) {
  21967. var i = e.mode
  21968. , n = e.pano
  21969. , r = e.position
  21970. , o = e.quaternion
  21971. , a = e.zoom
  21972. , s = e.floorVisibility
  21973. , l = e.tag;
  21974. this.emit(w.StartOutside, f[i].transitionTime),
  21975. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21976. y.cancelById(V.FlyToViewFloor),
  21977. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21978. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21979. }
  21980. ,
  21981. n.prototype.startInside = function(e, t, i, n, r) {
  21982. r = r || $.Deferred(),
  21983. this.currentPano = e;
  21984. var o = e && !e.isAligned();
  21985. if (t = o ? e.position : t || e.position,
  21986. i = i || e.quaternion,
  21987. e) {
  21988. var a = this.startInside.bind(this, e, t, i, n, r);
  21989. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21990. return
  21991. }
  21992. //add
  21993. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21994. return this.mode = u.PANORAMA,
  21995. e.floor.enter(this.mode),
  21996. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21997. this.switchCameraMode(this.mode, i),
  21998. this.emit(w.StartInside, o),
  21999. r.resolve(!0),
  22000. r
  22001. }
  22002. ,
  22003. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22004. if (r = r || $.Deferred(),
  22005. this.dollhouseMode(),
  22006. !e)
  22007. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22008. r.resolve(!1),
  22009. r;
  22010. t = t || e.position;
  22011. var o = i || this.cameraControls.activeControl.camera.quaternion
  22012. , a = e.position;
  22013. return this.fitDollhouse(a, t, o),
  22014. setTimeout(function(t) {
  22015. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22016. var n = {
  22017. mode: u.PANORAMA,
  22018. pano: e,
  22019. quaternion: i,
  22020. callback: function() {
  22021. this.emit(w.FlyinFinished),
  22022. r.resolve(!0)
  22023. }
  22024. .bind(this)
  22025. };
  22026. this.flyToNewMode(n)
  22027. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22028. r
  22029. }
  22030. ,
  22031. n.prototype.checkAndWaitForPanoLoad = function() {
  22032. var e = {}
  22033. , t = {}
  22034. , i = 5e3
  22035. , n = function() {
  22036. for (var n in e)
  22037. if (e.hasOwnProperty(n) && e[n]) {
  22038. var r = performance.now() - t[n];
  22039. if (r < i)
  22040. return !0
  22041. }
  22042. return !1
  22043. };
  22044. return function(r, o, a, s, l, c, h, u, d, p) {
  22045. if (n())
  22046. return !0;
  22047. var f = function(t, i, n) {
  22048. N.delayOneFrame(function() {
  22049. e[t] = !1,
  22050. l && l(i, n)
  22051. }
  22052. .bind(this))
  22053. }
  22054. .bind(this, r.id)
  22055. , g = function(t, i) {
  22056. N.delayOneFrame(function() {
  22057. e[t] = !1,
  22058. c && c(i)
  22059. }
  22060. .bind(this))
  22061. }
  22062. .bind(this, r.id);
  22063. try {
  22064. return null !== u && void 0 !== u || (u = !0),
  22065. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  22066. e[r.id] && (t[r.id] = performance.now()),
  22067. e[r.id]
  22068. } catch (n) {
  22069. throw e[r.id] = !1,
  22070. t[r.id] = performance.now() - i,
  22071. n
  22072. }
  22073. }
  22074. }(),
  22075. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22076. if (!e)
  22077. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22078. return r && this.model.waitForLoad(e, function() {
  22079. return e.isLoaded(i)
  22080. }),
  22081. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22082. !0)
  22083. }
  22084. ,
  22085. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22086. var e = new r.Vector3;
  22087. return function(t, i, n, r, o, a, s, l) {
  22088. if (!t)
  22089. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22090. return e.copy(d.FORWARD),
  22091. this.getDirection(e),
  22092. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22093. return t.isLoaded(i)
  22094. }),
  22095. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22096. n && n(e, t)
  22097. }
  22098. .bind(this)).fail(function(e) {
  22099. r && r(e)
  22100. }
  22101. .bind(this)).progress(function(e, t, i) {
  22102. o && o(e, t, i)
  22103. }
  22104. .bind(this)),
  22105. !0)
  22106. }
  22107. }(),
  22108. n.prototype.switchCameraMode = function(e, t) {
  22109. var i = this.cameraControls.controls[e]
  22110. , n = i.camera;
  22111. switch (e) {
  22112. case u.PANORAMA:
  22113. n.position.copy(this.currentPano.position);
  22114. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22115. i.lookAt(o.add(n.position));
  22116. break;
  22117. case u.DOLLHOUSE:
  22118. /* var a = this.position.clone();
  22119. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  22120. n.position.copy(a),
  22121. i.target.copy(this.target.clone().setY(this.model.center.y));
  22122. break; */
  22123. //for多楼层 且 让模型刚好适应屏幕
  22124. var box = this.model.boundingBox.clone();
  22125. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22126. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22127. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22128. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22129. console.log(boxSize.x,distance, boxSize.length() / 2)
  22130. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22131. if(this.mode === u.PANORAMA){
  22132. i.target.copy(this.model.center);
  22133. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22134. }else{
  22135. i.target.copy(this.target.clone().setY(this.model.center.y))
  22136. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22137. }
  22138. vec.multiplyScalar(distance )
  22139. n.position.copy(i.target.clone().add(vec))
  22140. break
  22141. case u.FLOORPLAN:
  22142. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22143. i.target.copy(this.model.center).setY(0),
  22144. i.zoomToContain(this.model.size),
  22145. i.rotateToView(this.model.size, this.getDirection())
  22146. }
  22147. i.update(0)
  22148. }
  22149. ,
  22150. n.prototype.update = function() {
  22151. var e = (new r.Vector3,
  22152. {})
  22153. , t = [];
  22154. return function(i) {
  22155. this.updatePersistentZooming(i),
  22156. this.updateFromControls(i),
  22157. this.getCurrentNodePanos(t)
  22158. if(this.hasChanged(e) ) {
  22159. this.lastChangeTime = Date.now(),
  22160. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22161. this.emit(w.ViewChanged),
  22162. this.intersectHot && this.intersectHot.showTitle()
  22163. for(var i in this.model.hots){
  22164. this.model.hots[i].update(this.mode,this.camera)
  22165. }
  22166. }
  22167. /* if(e.cameraChanged){
  22168. this.controlVideosPlay()
  22169. } */
  22170. this.model.supportsTiles && (this.updateTileDownloader(t),
  22171. this.updatePanoRenderer(t)),
  22172. this.updatePreRendering(t),
  22173. this.reticule.update(),
  22174. this.path.update(),
  22175. this.spider.update(),
  22176. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22177. this.updateControlLocks(),
  22178. this.model.supportsTiles && this.updateZoomPano()
  22179. }
  22180. }(),
  22181. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22182. var lastMode, lastPano;
  22183. return function(){
  22184. var mode = this.mode;
  22185. var pano = mode == "panorama" ? this.currentPano : "";
  22186. if(mode != "panorama" || pano != lastPano){
  22187. overlay.noBlock = null
  22188. }
  22189. this.overlayGroup.children.forEach((overlay)=>{
  22190. if(overlay.overlayType == "video" ){
  22191. var matrix = overlay.plane.matrixWorld;
  22192. var inSight = false;
  22193. var cameraDir = this.getDirection();
  22194. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22195. var vertexes = []
  22196. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22197. for(let i=0; i<4; i++){
  22198. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22199. vertexes.push(vertex)
  22200. if(overlay.noBlock == null){
  22201. if(!m.ifShelter(vertex)){
  22202. overlay.noBlock = true
  22203. }
  22204. inSight = true; break;
  22205. }else{
  22206. overlay.noBlock = true
  22207. }
  22208. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22209. inSight = true; break;
  22210. }
  22211. }
  22212. }
  22213. overlay.inSight = inSight
  22214. if(!inSight)overlay.plane.material.map.image.pause()
  22215. else overlay.plane.material.map.image.play()//maybe fail
  22216. }
  22217. })
  22218. lastMode = mode, lastPano = pano
  22219. }
  22220. }() */
  22221. n.prototype.updatePersistentZooming = function(e) {
  22222. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22223. }
  22224. ,
  22225. n.prototype.updateControlLocks = function() {
  22226. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22227. }
  22228. ,
  22229. n.prototype.updatePanoRenderer = function() {
  22230. var e = new r.Vector3;
  22231. return function(t) {
  22232. var i = this.nextPano || this.currentPano;
  22233. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22234. this.getDirection(e),
  22235. this.panoRenderer.updateDirection(e))
  22236. }
  22237. }(),
  22238. n.prototype.cleanupInactivePanos = function() {
  22239. var e = []
  22240. , t = [];
  22241. return function() {
  22242. e.length = 0,
  22243. e.push(this.currentPano),
  22244. this.nextPano && e.push(this.nextPano),
  22245. t.length = 0;
  22246. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22247. t.push(this.panoRenderer.activePanos[i]);
  22248. for (var n = 0; n < t.length; n++) {
  22249. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22250. r.id === e[a].id && (o = !1);
  22251. o && r.exit()
  22252. }
  22253. }
  22254. }(),
  22255. n.prototype.updatePreRendering = function() {
  22256. var e = {};
  22257. return function(t) {
  22258. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22259. var i = this.nextPano || this.currentPano;
  22260. if (i && t && t.length > 1) {
  22261. var n = t.findIndex(function(e) {
  22262. if (e.id === i.id)
  22263. return !0
  22264. });
  22265. if (n >= 0 && n + 1 < t.length) {
  22266. var r = t[n + 1];
  22267. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22268. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22269. window.setTimeout(function(t) {
  22270. e[t.id] = !1
  22271. }
  22272. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22273. }
  22274. .bind(this, r), f.tiling.panoPreRenderDelay),
  22275. e[r.id] = !0)
  22276. }
  22277. }
  22278. }
  22279. }
  22280. }(),
  22281. n.prototype.enablePreRendering = function() {
  22282. this.preRenderingEnabled = !0
  22283. }
  22284. ,
  22285. n.prototype.disablePreRendering = function() {
  22286. this.preRenderingEnabled = !1,
  22287. this.cleanupInactivePanos()
  22288. }
  22289. ,
  22290. n.prototype.updateTileDownloader = function() {
  22291. var e = new r.Vector3;
  22292. return function(t) {
  22293. var i = this.nextPano || this.currentPano;
  22294. i && (e.copy(d.FORWARD),
  22295. this.getDirection(e),
  22296. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22297. this.tileDownloader.processPriorityQueue = !0)
  22298. }
  22299. }(),
  22300. n.prototype.updateFromControls = function(e) {
  22301. null !== e && void 0 !== e || (e = 0),
  22302. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22303. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22304. this.position.copy(this.cameraControls.activeControl.camera.position),
  22305. this.target.copy(this.cameraControls.activeControl.target),
  22306. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22307. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22308. this.camera.position.copy(this.position),
  22309. this.camera.quaternion.copy(this.quaternion),
  22310. this.camera.updateMatrix(),
  22311. this.camera.updateMatrixWorld()
  22312. }
  22313. ,
  22314. n.prototype.hasChanged = function(e) {
  22315. /* if (!this.previousState)
  22316. return this.previousState = {
  22317. allFloorsVisible: this.model.allFloorsVisible,
  22318. position: this.position.clone(),
  22319. quaternion: this.quaternion.clone(),
  22320. mouse: this.mouse.clone(),
  22321. labelScaleFactor: this.getLabelScaleFactor(),
  22322. currentFloor: this.model.currentFloor,
  22323. projectionMatrix: this.camera.projectionMatrix.clone(),
  22324. worldMatrix: this.camera.matrixWorld.clone(),
  22325. mode: this.mode,
  22326. modelPosition: this.model.position.clone(),
  22327. modelCenter: this.model.center.clone(),
  22328. zoomLevel: this.zoomLevel
  22329. },
  22330. !0;
  22331. 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;
  22332. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22333. e.moved = !this.position.equals(this.previousState.position),
  22334. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22335. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22336. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22337. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22338. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22339. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22340. e.modeChanged = this.mode !== this.previousState.mode,
  22341. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22342. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22343. e.nextPanoActive = null !== this.nextPano,
  22344. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22345. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22346. this.previousState.position.copy(this.position),
  22347. this.previousState.quaternion.copy(this.quaternion),
  22348. this.previousState.mouse.copy(this.mouse),
  22349. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22350. this.previousState.currentFloor = this.model.currentFloor,
  22351. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22352. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22353. this.previousState.mode = this.mode,
  22354. this.previousState.modelPosition.copy(this.model.position),
  22355. this.previousState.modelCenter.copy(this.model.center),
  22356. this.previousState.zoomLevel = this.zoomLevel,
  22357. !t */
  22358. if (!this.previousState)
  22359. {
  22360. this.previousState = {
  22361. allFloorsVisible: this.model.allFloorsVisible,
  22362. position: this.position.clone(),
  22363. quaternion: this.quaternion.clone(),
  22364. mouse: this.mouse.clone(),
  22365. //labelScaleFactor: this.getLabelScaleFactor(),
  22366. currentFloor: this.model.currentFloor,
  22367. projectionMatrix: this.camera.projectionMatrix.clone(),
  22368. worldMatrix: this.camera.matrixWorld.clone(),
  22369. mode: this.mode,
  22370. modelPosition: this.model.position.clone(),
  22371. modelCenter: this.model.center.clone(),
  22372. zoomLevel: this.zoomLevel
  22373. };
  22374. return !0;
  22375. }
  22376. //许钟文改 分成相机是否改变cameraChanged 和其他
  22377. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  22378. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  22379. e.cameraChanged = !a;
  22380. /* if(!t){//主要判断相机是否旋转
  22381. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22382. }else e.cameraChanged2 = false */
  22383. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22384. e.moved = !this.position.equals(this.previousState.position),
  22385. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22386. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22387. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22388. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22389. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22390. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22391. e.modeChanged = this.mode !== this.previousState.mode,
  22392. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22393. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22394. e.nextPanoActive = null !== this.nextPano,
  22395. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22396. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22397. this.previousState.position.copy(this.position),
  22398. this.previousState.quaternion.copy(this.quaternion),
  22399. this.previousState.mouse.copy(this.mouse),
  22400. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22401. this.previousState.currentFloor = this.model.currentFloor,
  22402. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22403. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22404. this.previousState.mode = this.mode,
  22405. this.previousState.modelPosition.copy(this.model.position),
  22406. this.previousState.modelCenter.copy(this.model.center),
  22407. this.previousState.zoomLevel = this.zoomLevel;
  22408. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22409. return !t
  22410. }
  22411. ,
  22412. n.prototype.updateIntersect = function() {
  22413. var e = this.flying || this.isWarping()
  22414. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22415. , i = y.getById(V.LookTransition)
  22416. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22417. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  22418. this.intersect = this.getMouseIntersect(); //xzw change
  22419. this.intersect && this.updateClosestPano(this.intersect),
  22420. // this.intersect && console.log(this.intersect.point),
  22421. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22422. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22423. }
  22424. ,
  22425. n.prototype.checkHotClick = function() {
  22426. if(this.intersectHot){
  22427. this.intersectHot.noAction || this.intersectHot.examine(this)
  22428. /* g_touraudio.pause();
  22429. g_bgaudio = false;
  22430. document.getElementById("bgaudio").pause();
  22431. var sWidth = document.body.scrollWidth;
  22432. var sHeight = document.body.scrollHeight;
  22433. var pop1 = document.getElementById('popup');
  22434. pop1.style.display = "block";
  22435. var myElement = document.createElement("iframe");
  22436. myElement.src = g_HotMeshes[i].hotLink;
  22437. myElement.id = "id1";
  22438. myElement.allowTransparency = "true";
  22439. myElement.style.width = "100%";
  22440. myElement.style.height = "100%";
  22441. myElement.scrolling = "no";
  22442. var element=document.getElementById("id1");
  22443. if (typeof(element)== "undefined" || element == null){
  22444. document.getElementById("popup").appendChild(myElement);
  22445. }
  22446. var oClose = document.getElementById("closepop");
  22447. oClose.onclick = function() {
  22448. pop1.style.display = "none";
  22449. document.getElementById("popup").removeChild(document.getElementById("id1"));
  22450. $("#popup iframe:last").remove();
  22451. document.getElementById("bgaudio").play();
  22452. } */
  22453. return true;
  22454. }
  22455. },
  22456. n.prototype.getMouseDirection = function(e) {
  22457. e = e || this.mouse;
  22458. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22459. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22460. return i.sub(t).normalize()
  22461. }
  22462. ,
  22463. n.prototype.hoverOverlay = function(mesh){
  22464. if(!mesh){
  22465. this.hoveringPlane = null;
  22466. $("#player").css("cursor",this.currentCursor || "" );
  22467. }else{
  22468. var overlay = mesh.parent;
  22469. $("#player").css("cursor","pointer");
  22470. this.hoveringPlane = overlay;
  22471. return true;
  22472. }
  22473. },
  22474. n.prototype.clickOverlay = function(overlay){
  22475. if(this.openOverlay && !overlay)return;
  22476. var plane = overlay.plane;
  22477. if(overlay.overlayType == "video"){
  22478. if(plane.material.map.image.paused)plane.material.map.image.play()
  22479. else plane.material.map.image.pause();
  22480. }
  22481. /* if(window.EditOverlay &&EditOverlay.editing){
  22482. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22483. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22484. EditOverlay.endAddPlane();
  22485. EditOverlay.updateOverlayPanel(overlay)
  22486. EditOverlay.controlSelectOverlay(overlay)
  22487. return;
  22488. } */
  22489. },
  22490. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22491. e = e || this.mouse.clone(),
  22492. t = t || this.model.floors.reduce(function(e, t) {
  22493. return t.hidden ? e : e.concat(t.collider.children)
  22494. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22495. for(var i in this.model.hots){
  22496. t.push(this.model.hots[i].mesh);
  22497. }
  22498. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  22499. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22500. this.raycaster.set(i, this.getMouseDirection(e));
  22501. var n = this.raycaster.intersectObjects(t, true);//add true
  22502. // n[0] && console.log(n[0].point);
  22503. if(g_HotStatus=="add"){
  22504. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  22505. console.log(points[0]);
  22506. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  22507. }
  22508. this.intersectHot && this.intersectHot.hideTitle()
  22509. if (0 === n.length){
  22510. this.intersectHot = null; //add
  22511. if(g_HotStatus!="add") $("#player").css("cursor","");
  22512. return null;
  22513. }
  22514. var o = n[0];
  22515. if(o.object.type == "hotSprite"){ //add
  22516. this.intersectHot = o.object.belongHot;
  22517. this.intersectHot.showTitle()
  22518. this.intersectHot.noAction || $("#player").css("cursor","pointer");
  22519. return;
  22520. }
  22521. this.intersectHot = null;
  22522. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  22523. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  22524. if (o.face) {
  22525. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  22526. var a = this.position.clone().sub(o.point);
  22527. a.dot(o.normal) < 0 && o.normal.negate(),
  22528. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22529. o.horizontal = o.normal.y > .8
  22530. }
  22531. // console.log(o.point);
  22532. return o
  22533. }
  22534. ,
  22535. n.prototype.updateClosestPano = function(e) {
  22536. var t = [s.filters.isPanoAligned()];
  22537. if (this.mode === u.PANORAMA) {
  22538. if (!this.currentPano)
  22539. return;
  22540. t.push(s.filters.not(this.currentPano)),
  22541. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22542. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22543. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22544. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22545. } else{
  22546. t.push((pano)=>{ // add
  22547. return this.checkHasNeighbor(pano)
  22548. })
  22549. t.push(s.filters.isOnVisibleFloor()),
  22550. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22551. }
  22552. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22553. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22554. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22555. this.closestPano = i) : this.isPanoHover = !1
  22556. }
  22557. ,
  22558. n.prototype.dollhouseMode = function(e, t) {
  22559. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22560. this.mode = u.DOLLHOUSE,
  22561. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22562. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22563. , n = new r.Vector3(15,10,15);
  22564. if (e && t) {
  22565. var o = d.FORWARD.clone().applyQuaternion(t)
  22566. , a = this.model.center.clone().sub(e)
  22567. , s = a.dot(o);
  22568. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22569. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22570. }
  22571. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22572. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22573. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22574. this.updateFromControls(),
  22575. this.model.alpha = 1,
  22576. this.model.skybox.material.uniforms.opacity.value = 0
  22577. }
  22578. ,
  22579. n.prototype.insideMode = function(e, t) {
  22580. var i = $.Deferred()
  22581. , n = t || null;
  22582. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22583. var r = [s.filters.isPanoAligned()];
  22584. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22585. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22586. this.flyToNewMode({
  22587. mode: u.PANORAMA,
  22588. pano: e,
  22589. callback: n
  22590. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22591. } else {
  22592. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22593. i.reject(o)
  22594. }
  22595. return i.promise()
  22596. }
  22597. ,
  22598. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22599. //if(urlHasValue('oldEntry')){
  22600. //搬自一代。
  22601. var maxY = this.model.boundingBox.max.y;
  22602. var n = d.FORWARD.clone().applyQuaternion(i)
  22603. , i = n.clone().add(e);
  22604. this.cameraControls.activeControl.target.copy(i),
  22605. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22606. //return;
  22607. /* //this.camera.position.copy(this.model.center);
  22608. //this.camera.updateMatrixWorld()
  22609. this.switchCameraMode("dollhouse", i) */
  22610. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22611. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22612. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22613. this.cameraControls.activeControl.target.copy(n).add(e);
  22614. var o = d.RIGHT.clone().applyQuaternion(i)
  22615. , a = d.UP.clone()
  22616. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22617. , l = this.model.boundingBox.max.clone()
  22618. , c = this.model.boundingBox.min.clone()
  22619. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  22620. , u = 0
  22621. , p = 0
  22622. , g = 0;
  22623. h.forEach(function(e, t, i) {
  22624. var n = Math.abs(e.dot(o))
  22625. , r = e.dot(s);
  22626. n > u && (u = n,
  22627. p = r),
  22628. r > g && (g = r)
  22629. });
  22630. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  22631. , v = s.clone().multiplyScalar(p).add(t)
  22632. , A = s.clone().multiplyScalar(g).add(t);
  22633. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22634. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22635. p = Math.max(p, 10),
  22636. g = Math.max(g, 10);
  22637. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22638. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22639. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22640. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22641. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22642. */
  22643. }
  22644. ,
  22645. n.prototype.floorplanMode = function(e, t, i) {
  22646. this.mode = u.FLOORPLAN;
  22647. var n = this.cameraControls.controls[u.FLOORPLAN];
  22648. n.reset();
  22649. var r = e ? e : this.model.center;
  22650. if (n.target.copy(r).setY(0),
  22651. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22652. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22653. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22654. t) {
  22655. var o = d.LEFT.clone().applyQuaternion(t);
  22656. n.rotateLeft(-Math.atan2(o.x, o.z))
  22657. } else
  22658. n.rotateToView(this.model.size, this.getDirection());
  22659. n.update(0)
  22660. }
  22661. ,
  22662. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22663. return e.skipWarpingCheck = !0,
  22664. this.flyToPano(e, t)
  22665. }
  22666. ,
  22667. n.prototype.updateMarkerVisi = function() {//加
  22668. if(this.mode != "panorama")return;
  22669. this.model.panos.list.forEach((pano)=>{
  22670. if(!pano.marker)return;
  22671. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22672. })
  22673. }
  22674. ,
  22675. n.prototype.updateHotVisible = function(pano){
  22676. var hots = this.model.hots;
  22677. pano = pano || this.currentPano;
  22678. for (var index in hots){
  22679. var visible;
  22680. if(this.mode != "panorama"){
  22681. visible = true;
  22682. }else{
  22683. //hots[index].mesh.material.depthTest = false;
  22684. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22685. }
  22686. hots[index].mesh.visible = visible;
  22687. }
  22688. },
  22689. n.prototype.flyToPano = function(e, t) {
  22690. var i = e.pano
  22691. , n = e.lookAtPoint
  22692. , o = e.duration
  22693. , a = e.aimDuration
  22694. , s = e.maxDistanceOverride
  22695. , l = e.skipWarpingCheck
  22696. , c = e.constantMoveSpeed
  22697. , h = null
  22698. , p = null;
  22699. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22700. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22701. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22702. t && t(),
  22703. !1;
  22704. if (this.updateLastView(),
  22705. this.mode !== u.PANORAMA) {
  22706. var m;
  22707. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  22708. void this.flyToNewMode({
  22709. mode: u.PANORAMA,
  22710. pano: i,
  22711. duration: o,
  22712. quaternion: m,
  22713. callback: t
  22714. })
  22715. }
  22716. if (!i || (h = g.deepExtend(e),
  22717. p = function() {
  22718. N.delayOneFrame(function() {
  22719. this.flyToPano(h, t)
  22720. }
  22721. .bind(this))
  22722. }
  22723. .bind(this),
  22724. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22725. var C = function(e) {
  22726. t && t(e)
  22727. }
  22728. .bind(this);
  22729. this.currentPano || (this.currentPano = i,
  22730. this.path.placeCpm(),
  22731. this.path.fadeOutCpm(f.path.fadeOutTime),
  22732. this.spider.draw());
  22733. var I = o;
  22734. if ("number" != typeof o) {
  22735. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22736. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22737. }
  22738. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22739. 1 !== this.zoomLevel)
  22740. switch (f.zoom.transitionStyle) {
  22741. case 1:
  22742. this.smoothZoomToDefault(I / 2);
  22743. break;
  22744. case 2:
  22745. return h = g.deepExtend(e),
  22746. p = this.flyToPano.bind(this, h, t),
  22747. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22748. }
  22749. if (n) {
  22750. y.cancelById(V.LookTransition),
  22751. I *= f.transition.aimSlowFactor;
  22752. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22753. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  22754. , T = (new r.Quaternion).setFromRotationMatrix(_)
  22755. , S = b.clone()
  22756. , M = new r.Vector3;
  22757. if (i === this.currentPano) {
  22758. var R = d.FORWARD.clone().applyQuaternion(b)
  22759. , P = d.FORWARD.clone().applyQuaternion(T)
  22760. , O = R.angleTo(P);
  22761. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22762. void y.start(function(e) {
  22763. S.copy(b),
  22764. v.quaternion(S, T)(e),
  22765. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22766. this.cameraControls.activeControl.lookAt(M)
  22767. }
  22768. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22769. }
  22770. }
  22771. if (i === this.currentPano || this.flying)
  22772. return void C();
  22773. this.flying = !0;
  22774. var L = this.position.clone()
  22775. , D = this.currentPano;
  22776. F.debug("Flying to pano ", i.position),
  22777. this.emit(w.PanoChosen, this.currentPano, i),
  22778. this.emit(w.FlyingStarted, i.position, L, i, D)
  22779. //---------before fly--------------- add
  22780. this.updateHotVisible(i); //更新热点显示
  22781. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22782. //地标变化
  22783. if(this.model.floorLogos){
  22784. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22785. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22786. //this.model.adjustfloorLogoHeight();
  22787. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22788. this.model.floorLogos[1].visible = true;
  22789. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22790. }
  22791. //=======================================
  22792. n && y.start(function(e) {
  22793. S.copy(b),
  22794. v.quaternion(S, T)(e),
  22795. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22796. this.cameraControls.activeControl.lookAt(M)
  22797. }
  22798. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22799. var B = c ? null : A[f.transition.movementEasing];
  22800. this.nextPano = i,
  22801. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22802. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22803. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22804. this.flying = !1,
  22805. this.currentPano !== i && this.currentPano.exit(),
  22806. i.enter(),
  22807. this.currentPano = i,
  22808. this.nextPano = null,
  22809. this.path.placeCpm(),
  22810. this.path.fadeOutCpm(f.path.fadeOutTime),
  22811. this.spider.draw(),
  22812. this.emit(w.FlyingEnded, i.position, L, i, D),
  22813. this.updateMarkerVisi(),//add
  22814. C(e)
  22815. //add:
  22816. if(this.mode == "panorama" && this.model.floorLogos){
  22817. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22818. //this.model.adjustfloorLogoHeight()
  22819. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22820. this.model.floorLogos[1].visible = false;
  22821. }
  22822. }
  22823. .bind(this), 0, B, "camFly", V.FlyToPano)
  22824. }
  22825. }
  22826. ,
  22827. window._tranOutsideFocus = 4399
  22828. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  22829. console.log("focusPoint")
  22830. if(this.mode == "floorplan"){
  22831. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  22832. var control = player.cameraControls.controls.floorplan;
  22833. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22834. var currentScale = control.absoluteScale;
  22835. var currentTarget = control.target.clone()
  22836. y.cancelById(window._tranOutsideFocus, true);
  22837. y.start(function(progress){
  22838. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22839. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22840. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22841. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22842. }else if(player.mode == "dollhouse"){
  22843. var control = player.cameraControls.controls.dollhouse;
  22844. var radius = o.radius || 8;
  22845. var currentTarget = control.target.clone()
  22846. var dir = control.offset.clone().normalize()
  22847. var currentRadius = control.offset.length();
  22848. y.cancelById(window._tranOutsideFocus, true);
  22849. y.start(function(progress){
  22850. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22851. let radius_ = radius*progress+currentRadius*(1-progress)
  22852. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22853. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22854. }
  22855. }
  22856. window._transitionPosId = 9999
  22857. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  22858. y.cancelById(_transitionPosId)
  22859. var begin = function(object, pos, qua, scale){
  22860. if(pos){
  22861. if(!same(object.position, pos, 0.01)){
  22862. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  22863. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22864. }
  22865. if(!same(object.quaternion, qua, 1e-6)){
  22866. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  22867. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22868. }
  22869. if(!same(object.scale, scale, 0.001)){
  22870. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  22871. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22872. }
  22873. }
  22874. }
  22875. var same = function(vec1, vec2, diff){
  22876. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  22877. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  22878. return s
  22879. }
  22880. this.overlayGroup.children.forEach(overlay=>{
  22881. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  22882. var useCustom = o.type == "beforeFlyOut" || !panoData
  22883. var pos = useCustom ? overlay.posCustom : panoData.pos;
  22884. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  22885. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  22886. overlay.getScaleBySize(panoData.width , panoData.height)
  22887. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  22888. begin(overlay, pos, qua, scale )
  22889. })
  22890. }
  22891. n.prototype.fastForwardActivePanoFlight = function(e) {
  22892. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  22893. y.adjustSpeed(V.FlyToPano, e),
  22894. y.adjustSpeed(V.LookTransition, e)
  22895. }
  22896. ,
  22897. n.prototype.flyToPanoClosestToMouse = function() {
  22898. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22899. this.intersect && this.updateClosestPano(this.intersect)),
  22900. this.closestPano)
  22901. return this.flyToPano({
  22902. pano: this.closestPano
  22903. });
  22904. var e = this.getMouseDirection();
  22905. this.flyDirection(e) || this.flyToPano({
  22906. pano: this.currentPano
  22907. })
  22908. }
  22909. ,
  22910. n.prototype.flyLocalDirection = function(e) {
  22911. var t = this.getDirection(e)
  22912. , i = 1 === e.z ? .4 : .75
  22913. , n = 1 === Math.abs(e.x);
  22914. return this.flyDirection(t, i, n)
  22915. }
  22916. ,
  22917. n.prototype.flyDirection = function(e, t, i) {
  22918. this.closePopup();//xzw add
  22919. var n = $.Deferred();
  22920. this.history.invalidate();
  22921. var r = this.closestPanoInDirection(e, t, i);
  22922. return r ? this.flyToPano({
  22923. pano: r
  22924. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22925. n.resolve(!1)),
  22926. n.promise()
  22927. }
  22928. ,
  22929. n.prototype.closestPanoInDirection = function(e, t, i) {
  22930. return this.rankedPanoInDirection(0, e, t, i)
  22931. }
  22932. ,
  22933. n.prototype.rankedPanoInDirection = function() {
  22934. var e = {
  22935. pano: null,
  22936. candidates: []
  22937. };
  22938. return function(t, i, n, r) {
  22939. t || (t = 0),
  22940. n = void 0 !== n ? n : .75;
  22941. var o = r ? "angle" : "direction";
  22942. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  22943. this.cachedPanoCandidates = e.candidates,
  22944. e.pano
  22945. }
  22946. }(),
  22947. n.prototype.bump = function(e) {
  22948. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22949. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  22950. if (s)
  22951. t = function() {
  22952. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22953. }
  22954. .bind(this),
  22955. i = function() {
  22956. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22957. }
  22958. .bind(this);
  22959. else {
  22960. var l = this.camera.position.clone()
  22961. , c = e.clone();
  22962. this.raycaster.set(l, c);
  22963. var h = this.model.floors.reduce(function(e, t) {
  22964. return e.concat(t.collider.children)
  22965. }, [])
  22966. , d = this.raycaster.intersectObjects(h)
  22967. , p = d.length > 0 ? d[0].distance / 25 : .04
  22968. , g = l.clone().add(c.multiplyScalar(p));
  22969. t = function() {
  22970. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22971. }
  22972. .bind(this),
  22973. i = function() {
  22974. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22975. }
  22976. .bind(this)
  22977. }
  22978. n = function() {
  22979. this.flying = !1
  22980. }
  22981. .bind(this),
  22982. this.flying = !0,
  22983. t()
  22984. }
  22985. }
  22986. ,
  22987. n.prototype.changeFloor = function(e) {
  22988. if (!this.is360View(this.mode, this.currentPano))
  22989. if (this.mode === u.PANORAMA) {
  22990. var t = this.history.reversePano(e);
  22991. t && t.isAligned() ? this.flyToPano({
  22992. pano: t
  22993. }) : this.changeFloorByScore(e)
  22994. } else
  22995. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22996. }
  22997. ,
  22998. n.prototype.changeFloorByScore = function() {
  22999. var e = {
  23000. pano: null,
  23001. candidates: []
  23002. };
  23003. return function(t) {
  23004. var i = this.model.nextFloor(t);
  23005. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  23006. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23007. this.history.push(t, this.currentPano),
  23008. this.flyToPano({
  23009. pano: e.pano
  23010. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23011. }
  23012. }(),
  23013. n.prototype.gotoFloor = function(e) {
  23014. var t = e - this.model.currentFloor.floorIndex;
  23015. this.changeFloor(t)
  23016. }
  23017. ,
  23018. n.prototype.getDirection = function(e) {
  23019. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23020. e.applyQuaternion(this.camera.quaternion)
  23021. }
  23022. ,
  23023. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23024. if (o = o || $.Deferred(),
  23025. this.mode === u.TRANSITIONING)
  23026. return F.warn("should not be transitioning here"),
  23027. n && n(!1),
  23028. o.reject().promise();
  23029. var a = i || !1
  23030. , s = i ? i.position : this.position
  23031. , l = this.position.clone()
  23032. , c = this.currentPano;
  23033. if (F.debug("New pose in mode " + this.mode),
  23034. !e || (retryCallback = function() {
  23035. N.delayOneFrame(function() {
  23036. this.flyToSameMode(e, t, i, n, o)
  23037. }
  23038. .bind(this))
  23039. }
  23040. .bind(this),
  23041. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23042. var h = function() {
  23043. this.emit(w.FlyingEnded, s, l, e, c),
  23044. n && n(!0)
  23045. }
  23046. .bind(this)
  23047. , d = f[this.mode]
  23048. , p = void 0 !== t ? t : d.transitionTime
  23049. , g = new r.Vector3
  23050. , C = new r.Vector3;
  23051. if (this.emit(w.FlyingStarted, s, l, e, c),
  23052. this.mode === u.PANORAMA)
  23053. F.warn("we should not be here for panorama views");
  23054. else if (this.mode === u.DOLLHOUSE)
  23055. if (a) {
  23056. var I = new r.Vector3(0,1,0);
  23057. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23058. this.model.warpDestFloors(i.floorVisibility),
  23059. C.copy(i.position);
  23060. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23061. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23062. , _ = b.intersectObjects(this.model.colliders)
  23063. , T = 3;
  23064. _.length ? (g.copy(_[0].point),
  23065. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23066. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23067. var x = (new r.Matrix4).lookAt(C, g, I)
  23068. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23069. , M = g.distanceTo(C)
  23070. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23071. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23072. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23073. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23074. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23075. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23076. this.path.burnsDir = Math.sign(L.y);
  23077. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23078. , B = new r.Vector3;
  23079. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23080. y.start(function(e, t) {
  23081. D.x = P.x + e * L.x,
  23082. D.y = P.y + e * L.y,
  23083. D.z = P.z + e * L.z;
  23084. var i = O + e * (M - O);
  23085. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23086. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23087. }
  23088. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23089. y.start(function(e, t) {
  23090. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23091. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23092. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23093. }
  23094. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23095. } else
  23096. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23097. else if (this.path.placeCpm(),
  23098. this.path.fadeInCpm(f.path.fadeInTime),
  23099. i) {
  23100. this.model.warpDestFloors(i.floorVisibility);
  23101. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23102. , k = this.cameraControls.controls[u.FLOORPLAN]
  23103. , H = k.target.clone()
  23104. , G = i.position.clone().sub(H)
  23105. , z = U.position.clone().sub(k.target)
  23106. , W = z.length()
  23107. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23108. , Y = Math.atan2(k.offset.x, k.offset.z)
  23109. , X = Math.atan2(j.x, j.z)
  23110. , Z = k.absoluteScale
  23111. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23112. y.start(function(e, t) {
  23113. k.target.copy(G).multiplyScalar(e).add(H);
  23114. var i = Y + (X - Y) * e;
  23115. k.offset.x = W * Math.sin(i),
  23116. k.offset.z = W * Math.cos(i),
  23117. U.position.copy(k.target).add(k.offset),
  23118. k.absoluteScale = Z + e * (q - Z),
  23119. k.update(),
  23120. this.quaternion.copy(U.quaternion),
  23121. this.position.copy(U.position),
  23122. this.target.copy(k.target),
  23123. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23124. }
  23125. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23126. } else
  23127. F.info("flyToSameMode() funny floorplan view? skipping");
  23128. return y.setTimeout(function(e) {
  23129. this.mode = e,
  23130. h(),
  23131. o.resolve(!0)
  23132. }
  23133. .bind(this, this.mode), p, V.FlyToSameMode),
  23134. this.mode = u.TRANSITIONING,
  23135. o.promise()
  23136. }
  23137. }
  23138. ,
  23139. n.prototype.flyToNewMode = function(e, t) {
  23140. e = e || {};
  23141. var i = e.mode
  23142. , n = e.pano
  23143. , o = e.duration
  23144. , a = e.warpDest
  23145. , s = e.callback
  23146. , l = e.force
  23147. , c = e.quaternion;
  23148. if (t = t || $.Deferred(),
  23149. this.isWarping())
  23150. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23151. s && s(!1),
  23152. t.reject("Cannot change mode during tour transition").promise();
  23153. if (this.mode === u.TRANSITIONING)
  23154. return s && s(!1),
  23155. t.reject("Cannot change mode during mode transition").promise();
  23156. if (i === this.mode)
  23157. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23158. t.promise()) : (s && s(!1),
  23159. t.reject("Already in " + i + " mode").promise());
  23160. var h = a || !1;
  23161. F.debug("Switching mode to " + i);
  23162. var d = function() {
  23163. N.delayOneFrame(function() {
  23164. this.flyToNewMode(e, t)
  23165. }
  23166. .bind(this))
  23167. }
  23168. .bind(this);
  23169. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23170. return t.promise();
  23171. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23172. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23173. this.model.waitForLoad(this.model, function() {
  23174. return this.model.meshTexturesLoaded;
  23175. }
  23176. .bind(this)),
  23177. this.model.loadMeshTextures().done(d),
  23178. t.promise();
  23179. this.history.invalidate(),
  23180. this.updateLastView();
  23181. var p = this.mode
  23182. , C = this.cameraControls.cameras[i];
  23183. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23184. var I = void 0 !== o ? o : e.transitionTime;
  23185. this.emit(w.ModeChanging, p, i, n),
  23186. n && (this.currentPano = n),
  23187. this.switchCameraMode(i, c),
  23188. y.cancelById(V.LookTransition);
  23189. //before fly---------------------
  23190. if(this.mode == "panorama"){
  23191. if(this.model.floorLogos){
  23192. this.model.floorLogos[0].visible = false;
  23193. this.model.floorLogos[1].visible = false;
  23194. }
  23195. }
  23196. if(i == "panorama"){
  23197. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23198. }else{
  23199. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23200. }
  23201. //------------------------------------
  23202. var _ = (new r.Vector3).copy(this.position);
  23203. if (i === u.PANORAMA){
  23204. this.emit(w.PanoChosen, n, n),
  23205. setTimeout(function() {
  23206. n.floor.enter(i)
  23207. }
  23208. .bind(this), I / 2),
  23209. this.path.fadeOutCpm(f.path.fadeOutTime);
  23210. if(this.model.floorLogos){
  23211. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23212. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23213. }
  23214. }else if (i === u.DOLLHOUSE) {
  23215. if (h && (this.model.stayPut = !0),
  23216. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23217. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23218. this.path.placeCpm(),
  23219. this.path.fadeInCpm(f.path.fadeInTime),
  23220. h) {
  23221. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23222. _.set(15, 10, 15);
  23223. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23224. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23225. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23226. P.length ? (T.copy(P[0].point),
  23227. _.copy(a.position),
  23228. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  23229. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23230. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23231. _.add(this.model.position),
  23232. C.position.copy(_),
  23233. this.cameraControls.controls[u.DOLLHOUSE].update()
  23234. }
  23235. } else if (this.path.placeCpm(),
  23236. this.path.fadeInCpm(f.path.fadeInTime),
  23237. a) {
  23238. this.model.warpDestFloors(a.floorVisibility);
  23239. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23240. , L = this.cameraControls.controls[u.FLOORPLAN]
  23241. , D = O.position.clone().sub(L.target)
  23242. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23243. , U = Math.atan2(B.x, B.z);
  23244. L.target.copy(a.position);
  23245. var k = D.length();
  23246. L.offset.x = k * Math.sin(U),
  23247. L.offset.y = 0,
  23248. L.offset.z = k * Math.cos(U),
  23249. O.position.copy(L.target).add(L.offset);
  23250. L.target.clone().sub(C.position);
  23251. C.quaternion.copy(a.quaternion),
  23252. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23253. L.absoluteScale = L.currentScale,
  23254. L.update()
  23255. } else
  23256. this.model.currentFloor.enter(i);
  23257. var H = this.currentPano
  23258. , G = this.position.clone();
  23259. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23260. this.flying = !0,
  23261. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23262. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23263. C.controls.update()),
  23264. e.blackoutStyle = S.FADEIN,
  23265. I = f.show360Views.transitionTime,
  23266. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23267. this.mode = i,
  23268. this.path && this.path.popOutCpm(),
  23269. e.blackoutStyle = S.END,
  23270. I = f.show360Views.transitionTime,
  23271. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23272. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23273. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23274. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23275. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23276. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23277. y.setTimeout(function() {
  23278. this.flying = !1,
  23279. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23280. this.currentPano.enter(),
  23281. this.path.placeCpm(),
  23282. this.path.fadeOutCpm(f.path.fadeOutTime),
  23283. this.spider.draw()),
  23284. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23285. this.mode = i,
  23286. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23287. //add:
  23288. this.updateMarkerVisi(),
  23289. (p === u.PANORAMA || i == u.PANORAMA) && this.updateHotVisible(),
  23290. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23291. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23292. this.model.floorLogos[0].visible = true
  23293. )
  23294. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23295. t.resolve())
  23296. }
  23297. .bind(this), I, V.FlyToNewMode),
  23298. this.mode = u.TRANSITIONING,
  23299. t.promise()
  23300. }
  23301. ,
  23302. n.prototype.fade360View = function(e, t, i) {
  23303. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23304. $(this.domElement).fadeOut(.5 * e, function() {
  23305. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23306. this.model.alpha = i.modelAlpha,
  23307. this.position.copy(t.position),
  23308. this.quaternion.copy(t.quaternion),
  23309. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23310. $(this.domElement).fadeIn(.5 * e)
  23311. }
  23312. .bind(this))
  23313. }
  23314. ,
  23315. n.prototype.findDefaultViews = function() {
  23316. this.findDefaultView(this.lastInsideView, !0),
  23317. this.findDefaultView(this.last360View, !1)
  23318. }
  23319. ,
  23320. n.prototype.findDefaultView = function(e, t) {
  23321. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23322. if (e.cameraMode !== u.PANORAMA)
  23323. return !1;
  23324. var i = r.get(e.panoId);
  23325. return i && i.isAligned() === t
  23326. });
  23327. o >= 0 ? (i = r.get(n[o].panoId),
  23328. e.update({
  23329. cameraMode: u.PANORAMA,
  23330. pano: i,
  23331. position: n[o].position,
  23332. quaternion: n[o].quaternion
  23333. })) : (o = r.list.findIndex(function(e) {
  23334. return e.isAligned() === t
  23335. }),
  23336. o >= 0 ? (i = r.list[o],
  23337. e.update({
  23338. cameraMode: u.PANORAMA,
  23339. pano: i,
  23340. position: i.position
  23341. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23342. }
  23343. ,
  23344. n.prototype.updateLastView = function() {
  23345. if (this.mode === u.PANORAMA) {
  23346. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23347. e.update({
  23348. pano: this.currentPano,
  23349. position: this.position,
  23350. quaternion: this.quaternion
  23351. })
  23352. }
  23353. }
  23354. ,
  23355. n.prototype.goToLastView = function(e, t) {
  23356. var i = $.Deferred()
  23357. , n = i.resolve.bind(i)
  23358. , r = i.reject.bind(i)
  23359. , o = e ? this.lastInsideView : this.last360View;
  23360. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23361. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23362. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23363. mode: o.cameraMode,
  23364. pano: o.pano,
  23365. quaternion: o.quaternion,
  23366. callback: t
  23367. }).done(n).fail(r),
  23368. i.promise()
  23369. }
  23370. ,
  23371. n.prototype.fadeToView = function(e, t, i, n) {
  23372. var r = $.Deferred()
  23373. , o = r.resolve.bind(r)
  23374. , a = r.reject.bind(r);
  23375. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23376. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23377. a("Cannot go to illegal view"),
  23378. r.promise();
  23379. var s = (f[t.cameraMode],
  23380. function() {
  23381. $(this.domElement).fadeIn(.5 * i),
  23382. n && n(),
  23383. o()
  23384. }
  23385. .bind(this))
  23386. , l = e ? S.FADEIN : S.END;
  23387. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23388. $(this.domElement).fadeOut(.5 * i, function() {
  23389. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23390. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23391. pano: t.pano,
  23392. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23393. duration: 0
  23394. }, s) : this.flyToNewMode({
  23395. mode: t.cameraMode,
  23396. quaternion: t.quaternion,
  23397. duration: 0,
  23398. callback: s
  23399. })
  23400. }
  23401. .bind(this)),
  23402. r.promise()
  23403. }
  23404. ,
  23405. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23406. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23407. this.flying)
  23408. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23409. o && o(),
  23410. !1;
  23411. null !== e && void 0 !== e || (e = b.Show),
  23412. this.history.invalidate()
  23413. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23414. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23415. return this.emit(w.WarpStarted, a, i, n, r),
  23416. n = n || S.MIDDLE,
  23417. this.path.warpToPano(i, n, r, function() {
  23418. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23419. this.emit(w.WarpEnded, i),
  23420. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23421. o && o()
  23422. }
  23423. .bind(this)),
  23424. e === b.Hide && this.path.discardPathObject(),
  23425. !0
  23426. }
  23427. ,
  23428. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23429. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23430. s && s(),
  23431. !1)
  23432. }
  23433. ,
  23434. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23435. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23436. a && a(),
  23437. !1)
  23438. }
  23439. ,
  23440. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23441. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23442. }
  23443. ,
  23444. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23445. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23446. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23447. t && t(),
  23448. !1)
  23449. }
  23450. ,
  23451. n.prototype.aimTourCamera = function(e, t, i, n) {
  23452. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23453. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23454. }
  23455. ,
  23456. n.prototype.showPathToHeroLocation = function(e) {
  23457. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23458. }
  23459. ,
  23460. n.prototype.tourInterlude = function(e, t) {
  23461. this.history.invalidate();
  23462. this.path.discardSlow();
  23463. //xzw:
  23464. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  23465. var currTime = g_tourAudio ? g_tourAudio.currentTime * 1000 : 0;
  23466. var rotTime = (a && a.music) ? a.time - currTime : 2000;
  23467. this.path.waitNextStep(e, function() {
  23468. t && t()
  23469. }.bind(this), rotTime)
  23470. }
  23471. ,
  23472. n.prototype.stopInterlude = function() {
  23473. this.interruptAndFastForward(null, 0)
  23474. }
  23475. ,
  23476. n.prototype.interruptAndFastForward = function(e, t) {
  23477. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23478. this.flying && this.emit(w.FlyingInterrupted),
  23479. this.path.interruptAndFastForward(e, t)
  23480. }
  23481. ,
  23482. n.prototype.setSize = function(e, t) {
  23483. var i = e / t;
  23484. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23485. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23486. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23487. for (var r in this.cameraControls.cameras) {
  23488. var o = this.cameraControls.cameras[r];
  23489. o.fov = this.baseFov * (1 / this.zoomLevel),
  23490. o.updateAspect(i)
  23491. }
  23492. }
  23493. ,
  23494. n.prototype.toJSON = function() {
  23495. var e = {};
  23496. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23497. e.camera_mode = u.toInt(this.mode),
  23498. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23499. return e.hidden ? 0 : 1
  23500. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23501. e) : e
  23502. }
  23503. ,
  23504. n.prototype.getCurrentNodePanos = function(e) {
  23505. this.model.panos.map;
  23506. if (e.length = 0,
  23507. this.path.nodes)
  23508. for (var t = 0; t < this.path.nodes.length; t++) {
  23509. var i = this.path.nodes[t];
  23510. e.push(this.model.panos.get(i))
  23511. }
  23512. }
  23513. ,
  23514. n.prototype.zoomIncrementally = function(e) {
  23515. var t = this.zoomLevel;
  23516. this.zoomTo(this.zoomLevel + e),
  23517. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23518. }
  23519. ,
  23520. n.prototype.zoomInIncrementally = function(e) {
  23521. e = e || this.defaultZoomIncrement,
  23522. this.zoomIncrementally(e)
  23523. }
  23524. ,
  23525. n.prototype.zoomOutIncrementally = function(e) {
  23526. e = e || -this.defaultZoomIncrement,
  23527. this.zoomIncrementally(e)
  23528. }
  23529. ,
  23530. n.prototype.zoomBy = function(e) {
  23531. this.zoomTo(this.zoomLevel * e)
  23532. }
  23533. ,
  23534. n.prototype.zoomIn = function() {
  23535. this.zoomBy(1 + this.zoomSpeed)
  23536. }
  23537. ,
  23538. n.prototype.zoomOut = function() {
  23539. this.zoomBy(1 - this.zoomSpeed)
  23540. }
  23541. ,
  23542. n.prototype.zoomTo = function(e, t) {
  23543. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23544. if (e < f.zoom.min && (e = f.zoom.min),
  23545. e > f.zoom.max && (e = f.zoom.max),
  23546. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23547. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23548. e === f.zoom.min && this.emit(O.ZoomMin)),
  23549. this.cameraControls.activeControl) {
  23550. var i = this.cameraControls.activeControl.camera;
  23551. this.zoomLevel = e,
  23552. i.fov = this.baseFov * (1 / this.zoomLevel),
  23553. i.updateProjectionMatrix(),
  23554. this.zoomFov = i.fov
  23555. }
  23556. }
  23557. }
  23558. ,
  23559. n.prototype.increaseZoomSpeed = function() {
  23560. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23561. }
  23562. ,
  23563. n.prototype.decreaseZoomSpeed = function() {
  23564. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23565. }
  23566. ,
  23567. n.prototype.clampZoomSpeed = function(e) {
  23568. return e < 0 ? 0 : e
  23569. }
  23570. ,
  23571. n.prototype.activatePersistentZooming = function(e) {
  23572. this.zooming = e ? 1 : -1
  23573. }
  23574. ,
  23575. n.prototype.deactivatePersistentZooming = function() {
  23576. this.zooming = 0
  23577. }
  23578. ,
  23579. n.prototype.zoomDefault = function() {
  23580. this.zoomTo(1, !0)
  23581. }
  23582. ,
  23583. n.prototype.smoothZoomToDefault = function(e, t) {
  23584. var i, n = this.zoomLevel,
  23585. r = function(e) {
  23586. e > 1 && (e = 1),
  23587. i = n * (1 - e) + e,
  23588. this.zoomTo(i, !0)
  23589. }.bind(this),
  23590. o = function() {
  23591. this.zoomDefault(),
  23592. t && window.setTimeout(t, 50)
  23593. }.bind(this);
  23594. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  23595. }
  23596. ,
  23597. n.prototype.updateZoomPano = function() {
  23598. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  23599. var e = this.currentPano;
  23600. if (e) {
  23601. var t = this.zoomLevel > f.zoom.activationThreshold
  23602. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23603. , n = !i && !this.isWarping()
  23604. , r = t /*&& n*/; // 允许flying状态下加载4K图
  23605. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23606. this.panoRenderer.setZoomingActive(r, e, !0);
  23607. var o = function(e, t) {
  23608. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23609. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  23610. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  23611. e.setZoomed(t)
  23612. }
  23613. .bind(this);
  23614. r && !e.zoomed ? (o(e, !0),
  23615. this.panoRenderer.enableUltraHighQualityMode(function() {
  23616. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  23617. r && o(e, !0)
  23618. }
  23619. .bind(this))) : !t && e.zoomed && o(e, !1)
  23620. }
  23621. }
  23622. },
  23623. n.prototype.checkHasNeighbor = function(pano){//add
  23624. for(var i in pano.neighbourPanos ){
  23625. if(i == pano.id)continue;
  23626. if(pano.neighbourPanos[i]){
  23627. return true;
  23628. }
  23629. }
  23630. }
  23631. ,
  23632. t.exports = n
  23633. }
  23634. ).call(this, "/js/player.js")
  23635. }
  23636. , {
  23637. "./constants": 8,
  23638. "./enum/AlignmentType": 17,
  23639. "./enum/BlackoutStyle": 18,
  23640. "./enum/ControlEvents": 21,
  23641. "./enum/Keys": 30,
  23642. "./enum/ModelManagerEvents": 33,
  23643. "./enum/PanoSizeClass": 36,
  23644. "./enum/PanoramaEvents": 37,
  23645. "./enum/PathDiscardMode": 38,
  23646. "./enum/PathDisplayMode": 39,
  23647. "./enum/PlayerEvents": 40,
  23648. "./enum/TagStates": 44,
  23649. "./enum/Vectors": 50,
  23650. "./enum/Viewmode": 51,
  23651. "./enum/WarpStyle": 52,
  23652. "./enum/ZoomEvents": 53,
  23653. "./exception/BasicException": 55,
  23654. "./model/ModelManager": 140,
  23655. "./objects/NSpider": 147,
  23656. "./objects/Panorama": 148,
  23657. "./objects/Reticule": 149,
  23658. "./objects/ShowPath": 151,
  23659. "./objects/Snapshot": 153,
  23660. "./objects/View": 154,
  23661. "./settings": 166,
  23662. "./shaders": 167,
  23663. "./tile/TileDownloader": 171,
  23664. "./tile/TilePrioritizer": 172,
  23665. "./util/ZoomStats": 179,
  23666. "./util/browser": 182,
  23667. "./util/camera": 183,
  23668. "./util/cameraLight": 184,
  23669. "./util/common": 185,
  23670. "./util/easing": 186,
  23671. "./util/history": 187,
  23672. "./util/lerp": 188,
  23673. "./util/logger": 189,
  23674. "./util/math": 190,
  23675. "./util/transitions": 195,
  23676. "hot":"hot",
  23677. "scaleImg":"scaleImg",
  23678. events: 202,
  23679. three: 217
  23680. }],
  23681. "scaleImg":[function(t, e){// xzw
  23682. var OUTPUT = e;
  23683. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  23684. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  23685. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  23686. return G.getImageData(0,0,s,f)}
  23687. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  23688. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  23689. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  23690. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  23691. else
  23692. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  23693. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  23694. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  23695. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  23696. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  23697. W=new Float32Array(at);else
  23698. for(W=[],et=0;at>et;++et)
  23699. W[et]=0;for(b=0;w>b;b++)
  23700. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  23701. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  23702. delete p,h(),J=n(W)}
  23703. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  23704. if("png-src"===i||"jpeg-src"===i)
  23705. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  23706. return B}
  23707. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  23708. OUTPUT.exports = c;
  23709. }, {}
  23710. ],
  23711. 156: [function(e, t, i) {
  23712. (function(i) {
  23713. "use strict";
  23714. function n(e, t) {
  23715. this.model = e,
  23716. this.panos = e.panos,
  23717. this.player = t,
  23718. this.imagePanos = this.listImagePanos(),
  23719. this.retryMinimumTime = 1e4
  23720. }
  23721. var r = (e("three"),
  23722. e("./enum/Viewmode"))
  23723. , o = (e("./settings"),
  23724. e("./objects/Panorama"))
  23725. , a = e("./util/logger")
  23726. , s = new a(i);
  23727. n.prototype.start = function() {
  23728. this.loadNextPano(function(e) {
  23729. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  23730. setTimeout(function() {
  23731. this.start()
  23732. }
  23733. .bind(this), 1e3))
  23734. }
  23735. .bind(this))
  23736. }
  23737. ,
  23738. n.prototype.validLoadTarget = function(e) {
  23739. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23740. }
  23741. ,
  23742. n.prototype.listImagePanos = function() {
  23743. var e = []
  23744. , t = this;
  23745. return this.model.images.forEach(function(i) {
  23746. if (i.metadata && i.metadata.scan_id) {
  23747. var n = t.model.panos.get(i.metadata.scan_id);
  23748. n && !n.isLoaded("high") && e.push(n)
  23749. }
  23750. }),
  23751. e
  23752. }
  23753. ,
  23754. n.prototype.nextNotLoadedImage = function() {
  23755. for (; this.imagePanos.length > 0; ) {
  23756. var e = this.imagePanos[0];
  23757. if (!e.isLoaded("high"))
  23758. return e;
  23759. this.imagePanos.shift()
  23760. }
  23761. return null
  23762. }
  23763. ,
  23764. n.prototype.loadNextPano = function(e) {
  23765. var t, i, n = this.model.waitQueue.filter(function(e) {
  23766. return e.object instanceof o
  23767. });
  23768. n.length > 0 ? (t = n[0].object,
  23769. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23770. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23771. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23772. t = this.imagePanos[0],
  23773. s.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())]),
  23774. t && s.debug("Normal pano selection: neighbor " + t.id)),
  23775. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23776. s.debug("Preloading " + i + "-res pano " + t.id),
  23777. t.loadCube(i).done(e).fail(function() {
  23778. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23779. e()
  23780. })) : e && e(null)
  23781. }
  23782. ,
  23783. t.exports = n
  23784. }
  23785. ).call(this, "/js/preloaders.js")
  23786. }
  23787. , {
  23788. "./enum/Viewmode": 51,
  23789. "./objects/Panorama": 148,
  23790. "./settings": 166,
  23791. "./util/logger": 189,
  23792. three: 217
  23793. }],
  23794. 157: [function(e, t, i) {
  23795. (function(i) {
  23796. "use strict";
  23797. function n(e, t, i, n, r) {
  23798. this.qualityManager = e,
  23799. this.scene = t,
  23800. this.camera = i,
  23801. this.container = r,
  23802. this.controls = n,
  23803. this.controls.enabled = !0,
  23804. this.controls.locked = !0,
  23805. this.quickstartCamera = n.camera,
  23806. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  23807. this.skybox = null
  23808. }
  23809. var r = e("three")
  23810. , o = e("../util/logger")
  23811. , a = e("../constants")
  23812. , s = (e("../util/transitions"),
  23813. e("../util/lerp"),
  23814. e("../util/easing"),
  23815. e("../enum/Vectors"))
  23816. , l = e("../enum/PanoSizeClass")
  23817. , c = (e("../materials/ModelTextureMaterial"),
  23818. e("../materials/CubemapMaterial"))
  23819. , h = (e("../cameras/PanoramaCamera"),
  23820. e("../controls/PanoramaControls"),
  23821. e("../tile/TileUtils"),
  23822. e("../util/camera"),
  23823. e("../util/cameraLight"))
  23824. , u = (e("../util/browser"),
  23825. e("../settings"),
  23826. e("../gui/helpManager"),
  23827. new o(i));
  23828. n.prototype.load = function(e) {
  23829. e.pano.shouldRedrawOnBaseLoaded = !0;
  23830. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23831. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23832. var a = this.qualityManager.getPanoSize(l.BASE)
  23833. , c = this.qualityManager.getPanoSize(l.STANDARD);
  23834. if (e.pano.tiled) {
  23835. u.warn("Loading startPano, TILED", e.pano.id);
  23836. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23837. , p = this.quickstartCamera.fov;
  23838. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  23839. t = e.pano.loadTiledPano(c, r, {
  23840. hFov: d,
  23841. vFov: p
  23842. }, !1, !1, !0),
  23843. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23844. } else
  23845. u.warn("Loading startPano", e.pano.id),
  23846. t = e.pano.loadCube("high");
  23847. return $.when(t).then(function() {
  23848. n.init(e.pano, e.quaternion),
  23849. e.pano.tiled ? i.done(function() {
  23850. e.pano.lockUntilRenderingComplete = !1,
  23851. this.controls.locked = !1
  23852. }
  23853. .bind(this)) : this.controls.locked = !1
  23854. }
  23855. .bind(this))
  23856. }
  23857. ,
  23858. n.prototype.init = function(e, t) {
  23859. u.info("Quickstart done loading, adding scene objects"),
  23860. e.lockUntilRenderingComplete = !0,
  23861. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23862. side: r.BackSide
  23863. })),
  23864. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23865. this.skybox.quaternion.copy(e.quaternion),
  23866. this.scene.add(this.skybox),
  23867. $(this.container).show()
  23868. }
  23869. ,
  23870. n.prototype.update = function(e) {
  23871. this.controls.update(e),
  23872. this.camera.copy(this.quickstartCamera)
  23873. }
  23874. ,
  23875. n.prototype.setSize = function(e, t) {
  23876. this.quickstartCamera.updateAspect(e / t)
  23877. }
  23878. ,
  23879. n.prototype.destroy = function() {
  23880. this.scene.remove(this.skybox)
  23881. }
  23882. ,
  23883. t.exports = n
  23884. }
  23885. ).call(this, "/js/scene/QuickstartManager.js")
  23886. }
  23887. , {
  23888. "../cameras/PanoramaCamera": 7,
  23889. "../constants": 8,
  23890. "../controls/PanoramaControls": 13,
  23891. "../enum/PanoSizeClass": 36,
  23892. "../enum/Vectors": 50,
  23893. "../gui/helpManager": 68,
  23894. "../materials/CubemapMaterial": 117,
  23895. "../materials/ModelTextureMaterial": 118,
  23896. "../settings": 166,
  23897. "../tile/TileUtils": 174,
  23898. "../util/browser": 182,
  23899. "../util/camera": 183,
  23900. "../util/cameraLight": 184,
  23901. "../util/easing": 186,
  23902. "../util/lerp": 188,
  23903. "../util/logger": 189,
  23904. "../util/transitions": 195,
  23905. three: 217
  23906. }],
  23907. 158: [function(e, t, i) {
  23908. "use strict";
  23909. function n(e, t, i) {
  23910. this.scene = e,
  23911. this.camera = t,
  23912. this.renderer = null,
  23913. this.effects = i,
  23914. this.animateCallback = null,
  23915. this.composer = null,
  23916. this.qualityManager = null,
  23917. e.renderWidth = 0,
  23918. e.renderHeight = 0,
  23919. this.updateClock = new r.Clock,
  23920. this.components = [],
  23921. this.updateListeners = [],
  23922. this.resizeListeners = [],
  23923. this.forceUpdateSize = !1,
  23924. this.started = !1,
  23925. this.textures = {},
  23926. this.suspendedObjects = []
  23927. }
  23928. var r = e("three")
  23929. , o = e("../shaders")
  23930. , a = e("../enum/SceneRendererEvents")
  23931. , s = e("../enum/GLTextureType")
  23932. , l = e("../enum/GLCubeFaces")
  23933. , c = e("../exception/BasicException")
  23934. , h = e("../exception/RendererCreationException")
  23935. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  23936. , m = e("../util/browser")
  23937. /**************************************************************************************************************************************************/
  23938. , u = e("../settings")
  23939. , d = e("events").EventEmitter;
  23940. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23941. n.prototype = Object.create(d.prototype),
  23942. n.prototype.addComponent = function(e) {
  23943. this.components.push(e),
  23944. e.update && this.updateListeners.push(e),
  23945. e.setSize && (this.resizeListeners.push(e),
  23946. this.forceUpdateSize = !0)
  23947. }
  23948. ,
  23949. n.prototype.removeComponent = function(e) {
  23950. var t = function(t) {
  23951. return t !== e
  23952. };
  23953. this.components = this.components.filter(t),
  23954. this.updateListeners = this.updateListeners.filter(t),
  23955. this.resizeListeners = this.resizeListeners.filter(t)
  23956. }
  23957. ,
  23958. n.prototype.start = function(e) {
  23959. if (this.started)
  23960. throw new c("Can't start SceneRenderer, already started");
  23961. this.createContext(e),
  23962. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  23963. m.isMobile() && this.boluoVrInit(),
  23964. /*******************************************************************************************************************************/
  23965. this.initComposer(),
  23966. this.started = !0,
  23967. (p = p.bind(this))()
  23968. }
  23969. ,
  23970. n.prototype.createContext = function(e) {
  23971. try {
  23972. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile()}),
  23973. this.renderer.autoClear = !0,
  23974. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23975. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  23976. this.emit(a.ContextCreated)
  23977. } catch (e) {
  23978. throw new h("Unable to create a WebGL rendering context")
  23979. }
  23980. u.profiling.enabled && this.overrideTextures(),
  23981. e.appendChild(this.renderer.domElement)
  23982. }
  23983. ,
  23984. n.prototype.overrideTextures = function() {
  23985. var e = this.renderer.context
  23986. , t = 0
  23987. , i = e.createTexture;
  23988. e.createTexture = function() {
  23989. var n = i.call(e);
  23990. return n.id = t++,
  23991. this.textures[n.id] = n,
  23992. n
  23993. }
  23994. .bind(this);
  23995. var n = e.texImage2D;
  23996. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  23997. var d, p = this.getTextureTypeFromTarget(e, t);
  23998. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  23999. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24000. h = a,
  24001. u = l,
  24002. o = u.naturalWidth,
  24003. a = u.naturalHeight,
  24004. n.call(e, t, i, r, c, h, u));
  24005. var f = this.textures[d.id];
  24006. f.width = p === s.TextureCube ? 6 * o : o,
  24007. f.height = a
  24008. }
  24009. .bind(this);
  24010. var r = e.deleteTexture;
  24011. e.deleteTexture = function(t) {
  24012. delete this.textures[t.id],
  24013. r.call(e, t)
  24014. }
  24015. .bind(this)
  24016. }
  24017. ,
  24018. n.prototype.updateTextureMemory = function() {
  24019. var e = null;
  24020. return function() {
  24021. var t = 0;
  24022. for (var i in this.textures) {
  24023. var n = this.textures[i];
  24024. n.width && n.height && (t += n.width * n.height * 4)
  24025. }
  24026. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24027. e = t
  24028. }
  24029. }(),
  24030. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24031. switch (t) {
  24032. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24033. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24034. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24035. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24036. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24037. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24038. return s.TextureCube;
  24039. case e.TEXTURE_2D:
  24040. return s.Texture2D;
  24041. default:
  24042. return null
  24043. }
  24044. }
  24045. ,
  24046. n.prototype.initComposer = function() {
  24047. this.composer = new r.EffectComposer(this.renderer),
  24048. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24049. this.composer.addPass(this.effects.hblurPass),
  24050. this.composer.addPass(this.effects.vblurPass)
  24051. }
  24052. ,
  24053. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24054. this.renderWidth = e,
  24055. this.renderHeight = t,
  24056. this.effects.aspect = e / t,
  24057. /* this.renderer.setSize(e, t), -----MP */
  24058. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24059. this.composer.setSize(e, t);
  24060. for (var i = 0; i < this.resizeListeners.length; i++)
  24061. this.resizeListeners[i].setSize(e, t)
  24062. }
  24063. ,
  24064. n.prototype.render = function() {
  24065. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24066. }
  24067. /******************************************************************************************************徐世廷**********************************************************************/
  24068. var vrPermission = {};
  24069. var vrPermissionCallBack = function(info1,info2){
  24070. if(info1 == "reset"){
  24071. vrPermission = {};
  24072. }else{
  24073. vrPermission[info1] = info2
  24074. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24075. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24076. }
  24077. }
  24078. }
  24079. n.prototype.boluoVrInit = function() {
  24080. console.log("boluoVrInit")
  24081. this.isHuawei5X = m.detectHUAWEI5X(),
  24082. this.oldRenderer = this.renderer,
  24083. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24084. window.panoCamera = this.camera;
  24085. var a = this;
  24086. window._vrEnabled = !1,
  24087. Object.defineProperty(window, "vrEnabled", {
  24088. get: function() {
  24089. return window._vrEnabled
  24090. },
  24091. set: function(b) {
  24092. b = !!b,
  24093. b ? (a.renderer = a.newRenderer,
  24094. window.vrMarkers.forEach(function(a) {
  24095. a.visible = !0
  24096. })) : (a.renderer = a.oldRenderer,
  24097. window.vrMarkers.forEach(function(a) {
  24098. a.visible = !1
  24099. })),
  24100. a.cursor.visible = b,
  24101. a.setSize(window.innerWidth, window.innerHeight),
  24102. window._vrEnabled = b
  24103. if(b){
  24104. setTimeout(function(){
  24105. console.log("orientEnable"+window.orientEnable)
  24106. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24107. if(m.detectIOS()/* && m.detectSafari() */){
  24108. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24109. console.log("开始获取权限 major"+b.major)
  24110. if(b.major == 12 && b.minor>=2){
  24111. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24112. else{//app??
  24113. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24114. }
  24115. }else if(b.major >= 13){
  24116. if(!window.location.href.includes("https://")){
  24117. console.log("需要https");
  24118. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24119. return;
  24120. }
  24121. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24122. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24123. if(!window.vrEnabled || window.orientEnable)return;
  24124. vrPermissionCallBack("reset")
  24125. console.log(window.DeviceMotionEvent)
  24126. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24127. console.log("开始获取权限1")
  24128. ///注意:需要https 本地服务器permissionState会得到denied
  24129. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24130. console.log("permissionState1: "+permissionState)
  24131. vrPermissionCallBack("deviceMotion", permissionState)
  24132. }).catch(function(e){
  24133. vrPermissionCallBack("deviceMotion", false)
  24134. console.log(e)
  24135. })
  24136. }else{
  24137. console.log("window.DeviceMotionEvent undefined")
  24138. vrPermissionCallBack("deviceMotion", false)
  24139. }
  24140. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24141. console.log("开始获取权限2")
  24142. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24143. console.log("permissionState2: "+permissionState)
  24144. vrPermissionCallBack("deviceOrientation", permissionState)
  24145. }).catch(function(e){
  24146. vrPermissionCallBack("deviceOrientation", false)
  24147. console.log(e)
  24148. })
  24149. }else{
  24150. console.log("window.DeviceOrientationEvent undefined")
  24151. vrPermissionCallBack("deviceOrientation", false)
  24152. }
  24153. },hasFailed ? 0 : 150)
  24154. /* /* setTimeout(function(){
  24155. if(settings.vrEnabled && !window.orientEnable){
  24156. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24157. }
  24158. },4000) */
  24159. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24160. }else{
  24161. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24162. }
  24163. }else{
  24164. //已经触发了
  24165. }
  24166. },200);
  24167. }
  24168. }
  24169. }),
  24170. this.createCursor(.5, !1, 1, 16777215, 0);
  24171. var b = {
  24172. setSize: function(b, c) {
  24173. a.camera.aspect = b / c
  24174. }
  24175. };
  24176. this.resizeListeners.push(b),
  24177. this.vrLoadingInit()
  24178. }
  24179. ,
  24180. n.prototype.vrLoadingInit = function() {
  24181. var a = function(camera) {
  24182. var a = this
  24183. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24184. , c = new r.MeshBasicMaterial({
  24185. color: 4967932,
  24186. side: r.DoubleSide
  24187. })
  24188. , d = new r.Mesh(b,c);
  24189. this.mesh = d,
  24190. d.position.z = -2,
  24191. d.scale.set(.08, .08, .08),
  24192. d.visible = !1,
  24193. camera.add(d),
  24194. //window.player.camera.add(d),
  24195. a.enabled = !1,
  24196. this.update = function(b) {
  24197. 1 == a.enabled && (d.rotation.z += 15 * b)
  24198. }
  24199. }
  24200. , a = new a(this.camera);
  24201. window.Loading = a,
  24202. this.updateListeners.push(a)
  24203. }
  24204. ,
  24205. n.prototype.createCursor = function(a, b, c, d, e) {
  24206. var g, h = new r.SpriteMaterial({
  24207. opacity: c,
  24208. color: d,
  24209. transparent: b,
  24210. map: this.boluoGetTexture("images/cursor.png"),
  24211. needsUpdate: !0,
  24212. side: r.DoubleSide
  24213. });
  24214. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24215. h.map.repeat = new r.Vector2(1 / 17,1),
  24216. h.depthTest = !1,
  24217. h.blending = r.AdditiveBlending,
  24218. g = new r.Sprite(h),
  24219. // g.scale.set(a, a, a),
  24220. g.scale.set(.3,.3,.3)
  24221. g.position.z = -2,
  24222. g.visible = !1,
  24223. g.name = "cursor",
  24224. this.camera.add(g),
  24225. this.scene.add(this.camera),
  24226. this.cursor = g;
  24227. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24228. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24229. this.updateListeners.push(i)
  24230. }
  24231. ,
  24232. window.orientEnable = 0; //是否能触发deviceorientation
  24233. n.prototype.CursorAnimation = function(a, b, c) {
  24234. function d() {
  24235. g.orient = r.Math.degToRad(window.orientation || 0)
  24236. }
  24237. function e(a) {
  24238. if(!window.vrEnabled && window.orientEnable) return;
  24239. window.orientEnable || (window.orientEnable = 1);
  24240. var b = r.Math.degToRad(a.alpha)
  24241. , c = r.Math.degToRad(a.beta)
  24242. , d = r.Math.degToRad(a.gamma);
  24243. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24244. -1e3 === g.beta && (g.beta = c),
  24245. -1e3 === g.gamma && (g.gamma = d),
  24246. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24247. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24248. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24249. g.beta = c,
  24250. g.gamma = d),
  24251. n.vrDebug) {
  24252. $("#info-device-orientation").css("display", "block");
  24253. var e = "";
  24254. e += "alpha=(" + g.alpha + ")<BR/>",
  24255. e += "beta=(" + g.beta + ")<BR/>",
  24256. e += "gamma=" + g.gamma + "<BR/>",
  24257. document.getElementById("info-device-orientation").innerHTML = e
  24258. }
  24259. }
  24260. this.cursor = b,
  24261. this.raycaster = new r.Raycaster,
  24262. this.targetEventObj = {},
  24263. this.type = 1,
  24264. this.tweenFlag = !0;
  24265. var g = this;
  24266. this.target = c,
  24267. console.log(c.uuid),
  24268. this.euler = new r.Euler,
  24269. this.q0 = new r.Quaternion,
  24270. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24271. this.zee = new r.Vector3(0,0,1),
  24272. this.alpha = -1e3,
  24273. this.beta = -1e3,
  24274. this.gamma = -1e3,
  24275. this.orient = r.Math.degToRad(window.orientation || 0),
  24276. window.addEventListener("orientationchange", d),
  24277. window.addEventListener("deviceorientation", e),
  24278. this.setObjectQuaternion = function(a, b, d, e, f) {
  24279. g.euler.set(d, b, -e, "YXZ"),
  24280. a.setFromEuler(g.euler),
  24281. a.multiply(g.q1),
  24282. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24283. c.updateMatrixWorld()
  24284. }
  24285. ,
  24286. parent !== window && window.addEventListener("message", function(a) {
  24287. var b = JSON.parse(a.data)
  24288. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24289. b && b.alpha && b.beta && b.gamma && function(a) {
  24290. var c = r.Math.degToRad(b.alpha)
  24291. , d = r.Math.degToRad(b.beta)
  24292. , e = r.Math.degToRad(b.gamma);
  24293. a ? (-1e3 === g.alpha && (g.alpha = c),
  24294. -1e3 === g.beta && (g.beta = d),
  24295. -1e3 === g.gamma && (g.gamma = e),
  24296. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24297. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24298. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24299. g.beta = d,
  24300. g.gamma = e)
  24301. }(c)
  24302. }),
  24303. this.update = function(a) {
  24304. TWEEN.update();
  24305. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24306. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24307. this.triggerTargetEvent())
  24308. }
  24309. ,
  24310. this.triggerTargetEvent = function() {
  24311. var a = this.choseObj()
  24312. , b = a ? a.object : void 0;
  24313. this.targetEventObj.currentObj = b,
  24314. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24315. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24316. b && b.enabled && this.startAnimate(function() {
  24317. this.clickCallback(b)
  24318. }
  24319. .bind(this))) : this.type,
  24320. this.targetEventObj.lastObj = b)
  24321. }
  24322. ,
  24323. this.choseObj = function() {
  24324. this.raycaster.setFromCamera({
  24325. x: 0,
  24326. y: 0
  24327. }, c);
  24328. var a = (this.raycaster.ray,
  24329. window.vrMarkers)
  24330. , b = this.raycaster.intersectObjects(a);
  24331. if (b.length > 0)
  24332. return b[0]
  24333. }
  24334. ,
  24335. this.clickCallback = function(a) {
  24336. this.runTHREEAction(a, "onclick")
  24337. }
  24338. ,
  24339. this.runTHREEAction = function(a, b) {
  24340. switch (b) {
  24341. case "onclick":
  24342. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24343. a()
  24344. });
  24345. break;
  24346. case "onhover":
  24347. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24348. a()
  24349. });
  24350. break;
  24351. case "onout":
  24352. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24353. a()
  24354. })
  24355. }
  24356. }
  24357. ,
  24358. this.startAnimate = function(a) {
  24359. this.tweenFlag && this.initAnimation(a)
  24360. }
  24361. ,
  24362. this.initAnimation = function(a) {
  24363. var b = this
  24364. , c = this.cursor.material.map.offset
  24365. , d = function(a) {
  24366. return Math.floor(17 * a) / 17
  24367. };
  24368. b.tweenFlag = !1,
  24369. this.cursorAnimate = new TWEEN.Tween(c).to({
  24370. x: 1
  24371. }, 1e3).onStart(function() {
  24372. b.tweenFlag = !1
  24373. }).onStop(function() {
  24374. b.tweenFlag = !0,
  24375. this.x = 0,
  24376. c.x = 0
  24377. }).onUpdate(function() {}).onComplete(function() {
  24378. a(),
  24379. c.x = 0,
  24380. setTimeout(function() {
  24381. b.tweenFlag = !0
  24382. }, 1500)
  24383. }),
  24384. this.cursorAnimate.easing(d),
  24385. this.cursorAnimate.start()
  24386. }
  24387. ,
  24388. this.autoCursorPosition = function(a) {
  24389. // var b = Math.abs(a.distance - 10);
  24390. // this.cursor.position.z = -b,
  24391. // b /= 10;
  24392. // alert(b);
  24393. // this.cursor.scale.set(b, b, b)
  24394. this.cursor.scale.set(.3,.3,.3)
  24395. }
  24396. }
  24397. ,
  24398. n.prototype.vrRenderer = function(a, b, c) {
  24399. var d = new b.vrCamera(c);
  24400. d.bananaAspect = .8,
  24401. this.width,
  24402. this.height;
  24403. var b = this;
  24404. this.setSize = function(c, d) {
  24405. a.setSize.call(this, c, d),
  24406. b.width = c,
  24407. b.height = d
  24408. }
  24409. ,
  24410. this.render = function(b, c, e, f) {
  24411. window.cameraQua = c.quaternion.clone();
  24412. var g, h;
  24413. if (c.__RESS__SKIP__STEREO__)
  24414. return a.render(b, c, e, f);
  24415. if ("PerspectiveCamera" === c.type)
  24416. g = d.cameraL,
  24417. h = d.cameraR,
  24418. b.updateMatrixWorld(),
  24419. null === c.parent && c.updateMatrixWorld(),
  24420. d.vrCameraUpdate(c);
  24421. else {
  24422. if ("OrthographicCamera" !== c.type)
  24423. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24424. g = h = c
  24425. }
  24426. a.setScissorTest(!0),
  24427. a.setScissor(0, 0, this.width / 2, this.height),
  24428. a.setViewport(0, 0, this.width / 2, this.height),
  24429. a.render.call(this, b, g, e, f),
  24430. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24431. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24432. a.render.call(this, b, h, e, f),
  24433. a.setScissorTest(!1)
  24434. }
  24435. ,
  24436. this.__proto__ = {
  24437. __proto__: a
  24438. }
  24439. }
  24440. ,
  24441. n.prototype.vrCamera = function(a) {
  24442. this.type = "StereoCamera",
  24443. this._aspect = 1,
  24444. this._overlap = .064,
  24445. this.cameraL = new r.PerspectiveCamera,
  24446. this.cameraL.layers.enable(1),
  24447. this.cameraL.near = 0.01,//xzw add
  24448. this.cameraL.matrixAutoUpdate = !1,
  24449. this.cameraR = new r.PerspectiveCamera,
  24450. this.cameraR.layers.enable(2),
  24451. this.cameraR.near = 0.01,//xzw add
  24452. this.cameraR.matrixAutoUpdate = !1,
  24453. this.eyeRight = new r.Matrix4,
  24454. this.eyeLeft = new r.Matrix4,
  24455. this.vrCameraNeedsUpdate = !0,
  24456. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24457. Object.defineProperty(this, "bananaAspect", {
  24458. get: function() {
  24459. return this._aspect
  24460. },
  24461. set: function(a) {
  24462. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24463. this._aspect = a
  24464. }
  24465. }),
  24466. Object.defineProperty(this, "overlap", {
  24467. get: function() {
  24468. return this._overlap
  24469. },
  24470. set: function(a) {
  24471. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24472. this._overlap = a
  24473. }
  24474. }),
  24475. this.vrCameraUpdate = function(a) {
  24476. this.vrCameraNeedsUpdate = true;
  24477. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24478. this.vrCameraNeedsUpdate) {
  24479. this.vrCameraNeedsUpdate = !1,
  24480. //console.debug("vrCameraUpdate"),
  24481. this.bananaFocus = a.focus,
  24482. this.bananaFov = a.fov,
  24483. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24484. this.bananaNear = a.near,
  24485. this.bananaFar = a.far,
  24486. //console.debug(a.aspect),
  24487. this.bananaFocus = 10;
  24488. var b, c, d = a.projectionMatrix.clone(), e = this.overlap / 2, f = e * this.bananaNear / this.bananaFocus, g = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  24489. this.eyeLeft.elements[12] = -e,
  24490. this.eyeRight.elements[12] = e,
  24491. b = -g * this.bananaReal_aspect + f,
  24492. c = g * this.bananaReal_aspect + f,
  24493. d.elements[0] = 2 * this.bananaNear / (c - b),
  24494. d.elements[8] = (c + b) / (c - b),
  24495. this.cameraL.projectionMatrix.copy(d),
  24496. b = -g * this.bananaReal_aspect - f,
  24497. c = g * this.bananaReal_aspect - f,
  24498. d.elements[0] = 2 * this.bananaNear / (c - b),
  24499. d.elements[8] = (c + b) / (c - b),
  24500. this.cameraR.projectionMatrix.copy(d)
  24501. }
  24502. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24503. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24504. }
  24505. }
  24506. ,
  24507. n.prototype.boluoGetTexture = function(a) {
  24508. var b = new r.TextureLoader;
  24509. return b.crossOrigin = "anonymous",
  24510. b.load(a)
  24511. }
  24512. ,
  24513. /***********************************************************************************************************************************************************************************/
  24514. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24515. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24516. return function(o){
  24517. var render = false;
  24518. var ratio;
  24519. var w, h; //记录应当render的大小
  24520. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24521. w = o.width, h = o.height, render = true, ratio=1;
  24522. }else{
  24523. w = $('#player').width();
  24524. h = $('#player').height();
  24525. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24526. (w !== W || h !== H || this.forceUpdateSize) &&
  24527. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24528. }
  24529. if(render){
  24530. this.setSize(w, h, ratio);
  24531. this.forceUpdateSize = !1
  24532. }
  24533. }
  24534. }()
  24535. ,
  24536. n.prototype.updateComponents = function() {
  24537. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  24538. this.updateListeners[t].update(e)
  24539. }
  24540. ,
  24541. n.prototype.suspend = function() {
  24542. this.started = !1,
  24543. this.suspendedObjects = this.scene.children.map(function(e) {
  24544. return this.scene.remove(e),
  24545. e
  24546. }
  24547. .bind(this)),
  24548. this.render()
  24549. }
  24550. ,
  24551. n.prototype.resume = function() {
  24552. this.suspendedObjects.forEach(function(e) {
  24553. this.scene.add(e)
  24554. }
  24555. .bind(this)),
  24556. this.suspendedObjects = [],
  24557. this.started = !0,
  24558. p()
  24559. }
  24560. ;
  24561. var p = function() {
  24562. this.started && (window.requestAnimationFrame(p),
  24563. this.updateScreenSize(), // fyz resize
  24564. this.updateComponents(),
  24565. this.updateTextureMemory(),
  24566. this.render(),
  24567. this.emit(a.AfterRender))
  24568. };
  24569. n.prototype.getImageData = function() {
  24570. var e = document.createElement("canvas")
  24571. , t = e.getContext("2d");
  24572. return function(i, n, r) {
  24573. return e.width === n && e.height === r || (e.width = n,
  24574. e.height = r),
  24575. t.drawImage(i, 0, 0, n, r),
  24576. t.getImageData(0, 0, n, r)
  24577. }
  24578. }(),
  24579. n.prototype.initSizedTexture2D = function(e, t, i) {
  24580. var n = this.renderer
  24581. , o = n.context
  24582. , a = n.state
  24583. , s = new r.Texture(null);
  24584. s.flipY = !1,
  24585. i !== !0 && (i = !1),
  24586. s.generateMipmaps = i;
  24587. var l = n.paramThreeToGL(s.format)
  24588. , c = n.paramThreeToGL(s.type)
  24589. , h = n.properties.get(s)
  24590. , u = o.createTexture();
  24591. a.bindTexture(o.TEXTURE_2D, u),
  24592. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  24593. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  24594. s.wrapS = t,
  24595. s.wrapT = t;
  24596. var d = n.paramThreeToGL(t);
  24597. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24598. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24599. i ? (s.magFilter = r.LinearFilter,
  24600. s.minFilter = r.LinearMipMapLinearFilter,
  24601. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24602. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24603. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  24604. s.minFilter = r.LinearFilter,
  24605. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24606. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24607. a.bindTexture(o.TEXTURE_2D, null),
  24608. h.__webglTexture = u,
  24609. s
  24610. }
  24611. ,
  24612. n.prototype.initSizedCubeMap = function(e, t) {
  24613. var i = this.renderer
  24614. , n = i.context
  24615. , o = i.state
  24616. , a = new r.CubeTexture([null, null, null, null, null, null]);
  24617. a.flipY = !1,
  24618. a.generateMipmaps = t;
  24619. var s = i.paramThreeToGL(a.format)
  24620. , l = i.paramThreeToGL(a.type)
  24621. , c = i.properties.get(a)
  24622. , h = n.createTexture();
  24623. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  24624. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  24625. for (var u = 0; u < 6; u++)
  24626. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  24627. return t ? (a.magFilter = r.LinearFilter,
  24628. a.minFilter = r.LinearMipMapLinearFilter,
  24629. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24630. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24631. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24632. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  24633. a.minFilter = r.LinearFilter,
  24634. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24635. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24636. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24637. c.__image__webglTextureCube = h,
  24638. a
  24639. }
  24640. ,
  24641. n.prototype.deallocateCubeTexture = function(e) {
  24642. var t = this.renderer
  24643. , i = t.context
  24644. , n = t.properties.get(e);
  24645. i.deleteTexture(n.__image__webglTextureCube)
  24646. }
  24647. ,
  24648. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  24649. var a = this.renderer
  24650. , s = a.context
  24651. , l = a.state
  24652. , c = a.properties.get(t);
  24653. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24654. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24655. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24656. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24657. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24658. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24659. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24660. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24661. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24662. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24663. l.bindTexture(s.TEXTURE_2D, null)
  24664. }
  24665. ,
  24666. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  24667. var s = this.renderer
  24668. , l = s.context
  24669. , c = s.state
  24670. , h = s.properties.get(t);
  24671. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24672. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24673. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24674. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24675. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24676. }
  24677. ,
  24678. n.prototype.rebuildMipMaps2D = function(e) {
  24679. var t = this.renderer
  24680. , i = t.context
  24681. , n = t.state;
  24682. t.properties.get(e);
  24683. i.generateMipmap(i.TEXTURE_2D),
  24684. n.bindTexture(i.TEXTURE_2D, null)
  24685. }
  24686. ,
  24687. n.prototype.rebuildMipMaps3D = function(e) {
  24688. var t = this.renderer
  24689. , i = t.context
  24690. , n = t.state
  24691. , r = t.properties.get(e);
  24692. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  24693. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  24694. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24695. }
  24696. ,
  24697. n.prototype.renderToCubeMap = function() {
  24698. var e = !1
  24699. , t = null
  24700. , i = null
  24701. , n = null
  24702. , a = null
  24703. , s = null
  24704. , l = 1;
  24705. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24706. var _ = this.renderer;
  24707. _.context;
  24708. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  24709. i.position.z = 150,
  24710. t = new r.Scene,
  24711. t.add(i),
  24712. n = new r.ShaderMaterial({
  24713. uniforms: {
  24714. tDiffuse: {
  24715. type: "t",
  24716. value: null
  24717. },
  24718. alpha: {
  24719. type: "f",
  24720. value: 1
  24721. }
  24722. },
  24723. vertexShader: o.basicTextured.vertexShader,
  24724. fragmentShader: o.basicTextured.fragmentShader,
  24725. depthWrite: !1,
  24726. depthTest: !1,
  24727. side: r.DoubleSide
  24728. }),
  24729. a = new r.PlaneBufferGeometry(l,l),
  24730. s = new r.Mesh(a,n),
  24731. s.position.z = 0,
  24732. t.add(s),
  24733. e = !0);
  24734. var T = a.getAttribute("uv");
  24735. T.setDynamic(!0),
  24736. T.needsUpdate = !0;
  24737. var x = T.array
  24738. , S = p / u
  24739. , M = f / d
  24740. , R = g / u
  24741. , P = m / d;
  24742. x[0] = S,
  24743. x[1] = M + P,
  24744. x[2] = S + R,
  24745. x[3] = M + P,
  24746. x[4] = S,
  24747. x[5] = M,
  24748. x[6] = S + R,
  24749. x[7] = M;
  24750. var O = a.getAttribute("position");
  24751. O.setDynamic(!0),
  24752. O.needsUpdate = !0;
  24753. var L = O.array
  24754. , D = v / h.width - l / 2
  24755. , N = A / h.height - l / 2
  24756. , B = y / h.width
  24757. , F = C / h.height;
  24758. L[0] = D,
  24759. L[1] = N + F,
  24760. L[3] = D + B,
  24761. L[4] = N + F,
  24762. L[6] = D,
  24763. L[7] = N,
  24764. L[9] = D + B,
  24765. L[10] = N;
  24766. this.renderer.properties.get(c);
  24767. n.uniforms.tDiffuse.value = c,
  24768. n.blending = E || r.NoBlending,
  24769. n.transparent = !!b,
  24770. void 0 !== w && null !== w || (w = 1),
  24771. n.uniforms.alpha.value = w,
  24772. n.needUpdate = !0,
  24773. h.activeCubeFace = I,
  24774. h.viewport.set(0, 0, h.width, h.height);
  24775. var V = this.renderer.autoClear;
  24776. this.renderer.autoClear = !1,
  24777. this.renderer.render(t, i, h, !1),
  24778. this.renderer.autoClear = V
  24779. }
  24780. }(),
  24781. n.prototype.copyCubeMap = function() {
  24782. var e = !1
  24783. , t = null
  24784. , i = null
  24785. , a = null
  24786. , s = null
  24787. , l = null
  24788. , c = new r.Euler;
  24789. new r.Vector3;
  24790. return function(h, u, d, p, f, g, m, v, A) {
  24791. this.renderer;
  24792. if (!e) {
  24793. var y = 2;
  24794. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  24795. i.position.set(0, 0, 0),
  24796. t = new r.Scene,
  24797. t.add(i),
  24798. a = new r.ShaderMaterial({
  24799. uniforms: {
  24800. tDiffuse: {
  24801. type: "t",
  24802. value: null
  24803. },
  24804. alpha: {
  24805. type: "f",
  24806. value: 1
  24807. }
  24808. },
  24809. vertexShader: o.copyCubeMap.vertexShader,
  24810. fragmentShader: o.copyCubeMap.fragmentShader,
  24811. depthWrite: !1,
  24812. depthTest: !1,
  24813. side: r.DoubleSide
  24814. }),
  24815. s = new r.BoxGeometry(y,y,y),
  24816. l = new r.Mesh(s,a),
  24817. t.add(l),
  24818. e = !0
  24819. }
  24820. for (var C = 0; C < 6; C++)
  24821. n.getCubeOrientationForCubeFace(C, c),
  24822. l.rotation.copy(c),
  24823. l.matrixWorldNeedsUpdate = !0,
  24824. l.updateMatrixWorld(),
  24825. a.uniforms.tDiffuse.value = h,
  24826. a.blending = m || r.NoBlending,
  24827. a.transparent = !!v,
  24828. void 0 !== A && null !== A || (A = 1),
  24829. a.uniforms.alpha.value = A,
  24830. a.needUpdate = !0,
  24831. u.activeCubeFace = C,
  24832. u.viewport.set(0, 0, f, g),
  24833. this.renderer.render(t, i, u, !1)
  24834. }
  24835. }(),
  24836. n.getLookAtForCubeFace = function(e, t) {
  24837. switch (e) {
  24838. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24839. t.set(1, 0, 0);
  24840. break;
  24841. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24842. t.set(-1, 0, 0);
  24843. break;
  24844. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24845. t.set(0, 1, 0);
  24846. break;
  24847. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24848. t.set(0, -1, 0);
  24849. break;
  24850. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24851. t.set(0, 0, 1);
  24852. break;
  24853. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24854. t.set(0, 0, -1)
  24855. }
  24856. }
  24857. ,
  24858. n.getCubeOrientationForCubeFace = function(e, t) {
  24859. switch (e) {
  24860. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24861. t.set(0, -Math.PI / 2, 0);
  24862. break;
  24863. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24864. t.set(0, Math.PI / 2, 0);
  24865. break;
  24866. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24867. t.set(Math.PI / 2, Math.PI, 0);
  24868. break;
  24869. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24870. t.set(-Math.PI / 2, Math.PI, 0);
  24871. break;
  24872. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24873. t.set(0, -Math.PI, 0);
  24874. break;
  24875. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24876. t.set(0, 0, 0)
  24877. }
  24878. }
  24879. ,
  24880. t.exports = n
  24881. }
  24882. , {
  24883. "../enum/GLCubeFaces": 25,
  24884. "../enum/GLTextureType": 26,
  24885. "../enum/SceneRendererEvents": 43,
  24886. "../exception/BasicException": 55,
  24887. "../exception/RendererCreationException": 57,
  24888. "../settings": 166,
  24889. "../shaders": 167,
  24890. /********************************************************************fyz改 from徐世廷**********************************************************************/
  24891. "../util/browser": 182,
  24892. /************************************************************************************************************************************************/
  24893. events: 202,
  24894. three: 217
  24895. }],
  24896. 159: [function(e, t, i) {
  24897. "use strict";
  24898. function n(e) {
  24899. this.messenger = new a(e),
  24900. this.clientKey = null
  24901. }
  24902. var r = e("../util/ajax")
  24903. , o = e("./PostMessageType")
  24904. , a = e("./postmessage")
  24905. , s = e("./VersionInfo")
  24906. , l = e("events").EventEmitter
  24907. , c = window.location.origin + "/api/v1/user/";
  24908. n.prototype = Object.create(l.prototype),
  24909. n.prototype.bindEvents = function() {
  24910. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  24911. }
  24912. ,
  24913. n.prototype.waitForConnection = function() {
  24914. var e = new Promise(function(e, t) {
  24915. this.messenger.on(o.CONNECT, function(i) {
  24916. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  24917. }
  24918. .bind(this))
  24919. }
  24920. .bind(this));
  24921. return e
  24922. }
  24923. ,
  24924. n.prototype.onConnectionReceived = function(e) {
  24925. return this.messenger.setTarget(e.source, e.origin),
  24926. this.verifyConnection(e).then(function(t, i) {
  24927. this.messenger.send({
  24928. type: o.ACCEPT,
  24929. toId: e.fromId,
  24930. warning: i
  24931. }),
  24932. this.clientKey = t,
  24933. this.messenger.removeAllListeners(o.CONNECT),
  24934. this.bindEvents()
  24935. }
  24936. .bind(this), function(t) {
  24937. this.messenger.send({
  24938. type: o.REJECT,
  24939. toId: e.fromId,
  24940. reason: t
  24941. }),
  24942. this.messenger.setTarget()
  24943. }
  24944. .bind(this))
  24945. }
  24946. ,
  24947. n.prototype.verifyConnection = function(e) {
  24948. return new Promise(function(t, i) {
  24949. var n;
  24950. if (s.isDeprecated(e.sdkVersion))
  24951. n = "这个版本正在被弃用";
  24952. else if (!s.isSupported(e.sdkVersion))
  24953. return i("不支持此版本的SDK");
  24954. var o = {
  24955. cache: !1,
  24956. headers: {
  24957. "X-port-Application-Key": e.applicationKey,
  24958. "X-port-Referrer": e.origin
  24959. }
  24960. };
  24961. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  24962. }
  24963. )
  24964. }
  24965. ,
  24966. n.prototype.onMessageReceived = function(e) {
  24967. if (this.validateClientApplicationKey(e.applicationKey)) {
  24968. var t = this;
  24969. e.onDone = function(i) {
  24970. i.toId = e.fromId,
  24971. i.uid = e.uid,
  24972. i.type = o.RESPONSE,
  24973. t.messenger.send(i)
  24974. }
  24975. ,
  24976. this.emit(o.ACTION, e)
  24977. }
  24978. }
  24979. ,
  24980. n.prototype.validateClientApplicationKey = function(e) {
  24981. return this.clientKey === e
  24982. }
  24983. ,
  24984. n.prototype.sendEvent = function(e, t) {
  24985. this.messenger.send({
  24986. type: o.EVENT,
  24987. eventType: e,
  24988. eventData: t
  24989. })
  24990. }
  24991. ,
  24992. t.exports = n
  24993. }
  24994. , {
  24995. "../util/ajax": 181,
  24996. "./PostMessageType": 160,
  24997. "./VersionInfo": 163,
  24998. "./postmessage": 165,
  24999. events: 202
  25000. }],
  25001. 160: [function(e, t, i) {
  25002. "use strict";
  25003. t.exports = Object.freeze({
  25004. CONNECT: "postmessage.connect",
  25005. ACCEPT: "postmessage.accept",
  25006. REJECT: "postmessage.reject",
  25007. ACTION: "postmessage.action",
  25008. RESPONSE: "postmessage.response",
  25009. EVENT: "postmessage.event"
  25010. })
  25011. }
  25012. , {}],
  25013. 161: [function(e, t, i) {
  25014. "use strict";
  25015. t.exports = Object.freeze({
  25016. MOVE: "sdk.move",
  25017. ENTER_PANO: "sdk.enterpano",
  25018. MODEL_LOADED: "sdk.modelloaded"
  25019. })
  25020. }
  25021. , {}],
  25022. 162: [function(e, t, i) {
  25023. "use strict";
  25024. t.exports = Object.freeze({
  25025. FLY: "transition.fly",
  25026. FADEOUT: "transition.fade",
  25027. INSTANT: "transition.instant"
  25028. })
  25029. }
  25030. , {}],
  25031. 163: [function(e, t, i) {
  25032. "use strict";
  25033. t.exports = {
  25034. current: "1.0",
  25035. supported: ["1.0"],
  25036. deprecated: [],
  25037. isSupported: function(e) {
  25038. return this.supported.indexOf(e) !== -1
  25039. },
  25040. isDeprecated: function(e) {
  25041. return this.deprecated.indexOf(e) !== -1
  25042. },
  25043. isValid: function(e) {
  25044. return this.isSupported(e) || this.isDeprecated(e)
  25045. }
  25046. }
  25047. }
  25048. , {}],
  25049. 164: [function(e, t, i) {
  25050. (function(i) {
  25051. "use strict";
  25052. function n(e, t, i) {
  25053. e && (e = e.toLowerCase().trim());
  25054. var n = new I.UP.clone
  25055. , r = Math.PI / 3
  25056. , o = Math.PI / 2;
  25057. switch (e) {
  25058. case "left":
  25059. i.copy(t),
  25060. i.applyAxisAngle(n, o);
  25061. break;
  25062. case "right":
  25063. i.copy(t),
  25064. i.applyAxisAngle(n, -o);
  25065. break;
  25066. case "forwardleft":
  25067. i.copy(t),
  25068. i.applyAxisAngle(n, r);
  25069. break;
  25070. case "forwardright":
  25071. i.copy(t),
  25072. i.applyAxisAngle(n, -r);
  25073. break;
  25074. case "forward":
  25075. default:
  25076. i.copy(t)
  25077. }
  25078. return i
  25079. }
  25080. function r(e, t) {
  25081. if (e) {
  25082. var i = {
  25083. pano: e,
  25084. lookAtPoint: null,
  25085. duration: null,
  25086. maxDistanceOverride: null,
  25087. skipWarpingCheck: !1
  25088. };
  25089. this.player.flyToPano(i, function() {
  25090. t && t({
  25091. success: !0,
  25092. message: "Transition complete."
  25093. })
  25094. })
  25095. } else
  25096. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25097. t && t({
  25098. success: !1,
  25099. error: "Unable to find pano."
  25100. })
  25101. }
  25102. function o(e, t) {
  25103. var i = this.findRankedPano(e, t);
  25104. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25105. null)
  25106. }
  25107. function a(e, t) {
  25108. var i = this.findRankedtag(e, t);
  25109. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25110. null)
  25111. }
  25112. function s(e, t) {
  25113. t.copy(I.FORWARD),
  25114. e.getDirection(t)
  25115. }
  25116. function l(e) {
  25117. function t(e) {
  25118. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25119. return {
  25120. x: c.Math.radToDeg(t._x),
  25121. y: c.Math.radToDeg(t._y),
  25122. z: c.Math.radToDeg(t._z)
  25123. }
  25124. }
  25125. var i = function(e) {
  25126. return e.alignmentType !== m.ALIGNED ? null : {
  25127. x: e.position.x,
  25128. y: e.position.y,
  25129. z: e.position.z
  25130. }
  25131. };
  25132. return {
  25133. panos: e.panos.list.map(function(n) {
  25134. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25135. return {
  25136. uuid: n.id,
  25137. aligned: n.alignmentType === m.ALIGNED,
  25138. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25139. position: i(n),
  25140. rotation: t(n),
  25141. thumbnail: r
  25142. }
  25143. })
  25144. }
  25145. }
  25146. var c = e("three")
  25147. , h = e("./ApiHost")
  25148. , u = e("../util/logger")
  25149. , d = e("../util/common")
  25150. , p = e("../util/math")
  25151. , f = e("../enum/ModelManagerEvents")
  25152. , g = e("./PostMessageType")
  25153. , m = e("../enum/AlignmentType")
  25154. , v = e("../enum/Direction")
  25155. , A = e("./TransitionStyles")
  25156. , y = e("../util/panorama")
  25157. , C = e("../enum/GLCubeFaces")
  25158. , I = e("../enum/Vectors")
  25159. , E = e("../enum/Viewmode")
  25160. , b = e("../enum/WarpStyle")
  25161. , w = (e("../enum/Keys"),
  25162. e("../enum/PlayerEvents"))
  25163. , _ = e("../sdk/SdkEvents")
  25164. , I = e("../enum/Vectors")
  25165. , T = e("../enum/ControlEvents")
  25166. , x = e("../enum/RenderLayers")
  25167. , S = (e("../constants"),
  25168. e("../settings"))
  25169. , M = e("../lib/jpeg_encoder")
  25170. , R = new u(i)
  25171. , P = function() {
  25172. var e = function e() {
  25173. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25174. e.player.getDirection(e.playerDirection),
  25175. e.projectVectors();
  25176. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25177. if (e.angleTravelled += Math.abs(t),
  25178. e.angleTravelled >= Math.abs(e.angle)) {
  25179. if (e.active = !1,
  25180. e.onDone) {
  25181. var i = e.onDone;
  25182. i()
  25183. }
  25184. } else
  25185. e.lastFacingDirection.copy(e.playerDirection),
  25186. window.setTimeout(e, 4)
  25187. };
  25188. return e.active = !1,
  25189. e.angle = 0,
  25190. e.angleTravelled = 0,
  25191. e.playerDirection = new c.Vector3,
  25192. e.lastFacingDirection = new c.Vector3,
  25193. e.onDone = null,
  25194. e.player = null,
  25195. e.start = function(t, i, n, r) {
  25196. e.active = !0,
  25197. t && i && (i = 0),
  25198. e.angle = t || i,
  25199. e.xAngle = t,
  25200. e.yAngle = i,
  25201. e.angleTravelled = 0,
  25202. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25203. n.getDirection(e.playerDirection),
  25204. e.lastFacingDirection.copy(e.playerDirection),
  25205. e.projectVectors(),
  25206. e.onDone = r,
  25207. e.player = n,
  25208. e()
  25209. }
  25210. ,
  25211. e.projectVectors = function() {
  25212. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25213. e.lastFacingDirection.projectOnPlane(I.UP))
  25214. }
  25215. ,
  25216. e
  25217. }()
  25218. , O = function() {
  25219. var e = new c.Vector3;
  25220. return function(t) {
  25221. t ? (e.copy(t.position),
  25222. e.add(t.discPosition),
  25223. p.projectPositionToCanvas(e, this.player.camera, e),
  25224. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25225. }
  25226. }()
  25227. , L = function() {
  25228. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25229. }
  25230. , D = function() {
  25231. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25232. }
  25233. , N = function(e) {
  25234. var t = new c.Vector3;
  25235. return function(e) {
  25236. var i = this.player.getDirection();
  25237. t.copy(i);
  25238. var n = t.y;
  25239. t.y = 0,
  25240. t.normalize();
  25241. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25242. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25243. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25244. 0;
  25245. this.player.mode === E.DOLLHOUSE && (r = -r);
  25246. var o = L.call(this) - .1
  25247. , a = D.call(this) + .1
  25248. , s = r + e;
  25249. s > o ? s = o : s < a && (s = a);
  25250. var l = s - r;
  25251. return e > 0 && l < .01 && (l = 0),
  25252. e < 0 && l > -.01 && (l = 0),
  25253. l
  25254. }
  25255. }()
  25256. , B = function() {
  25257. var e = new c.Euler;
  25258. return function(t) {
  25259. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25260. {
  25261. position: {
  25262. x: t.position.x,
  25263. y: t.position.y,
  25264. z: t.position.z
  25265. },
  25266. rotation: {
  25267. x: c.Math.radToDeg(e.x),
  25268. y: c.Math.radToDeg(e.y),
  25269. z: 0
  25270. },
  25271. pano: t.currentPano ? t.currentPano.id : null,
  25272. mode: t.mode
  25273. }
  25274. }
  25275. }()
  25276. , F = null;
  25277. t.exports = {
  25278. init: function(e, t, i, n, r) {
  25279. V.init(e, t, i, r),
  25280. F = new Promise(function(e, t) {
  25281. i.on(w.Ready, function() {
  25282. e()
  25283. })
  25284. }
  25285. .bind(this));
  25286. var o = new h(window)
  25287. , a = o.waitForConnection();
  25288. a.then(function(e) {
  25289. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25290. });
  25291. var s = function() {
  25292. var e = Date.now();
  25293. return function() {
  25294. if (!(Date.now() - e < 100)) {
  25295. var t = B(i);
  25296. o.sendEvent(_.MOVE, {
  25297. state: t
  25298. }),
  25299. e = Date.now()
  25300. }
  25301. }
  25302. }();
  25303. i.on(w.Move, s),
  25304. i.on(w.ViewChanged, s),
  25305. n.on(f.ActiveModelChanged, function(e) {
  25306. function t(e) {
  25307. var t, i = e.newPano.id;
  25308. e.oldPano && (t = e.oldPano.id),
  25309. i !== t && o.sendEvent(_.ENTER_PANO, {
  25310. oldPano: t,
  25311. newPano: i
  25312. })
  25313. }
  25314. var i = e.model
  25315. , n = e.oldModel;
  25316. V.model = i,
  25317. a.then(function() {
  25318. o.sendEvent(_.MODEL_LOADED, {
  25319. metadata: l(i)
  25320. })
  25321. }),
  25322. n && n.panos.forEach(function(e) {
  25323. e.removeEventListener("enter", t)
  25324. }),
  25325. i.panos.forEach(function(e) {
  25326. e.on("enter", t)
  25327. })
  25328. })
  25329. }
  25330. };
  25331. var V = {
  25332. director: null,
  25333. player: null,
  25334. controls: null,
  25335. sceneRenderer: null,
  25336. model: null,
  25337. init: function(e, t, i, n) {
  25338. this.director = e,
  25339. this.player = i,
  25340. this.controls = t,
  25341. this.sceneRenderer = n
  25342. },
  25343. handleToObject: {},
  25344. objectToHandle: {},
  25345. handleCount: 0,
  25346. onMessageReceive: function(e) {
  25347. if (e) {
  25348. var t = e.targetFunction
  25349. , i = e.params
  25350. , n = e.onDone;
  25351. t && this[t] && this[t](i, n)
  25352. }
  25353. },
  25354. waitForInit: function(e, t) {
  25355. F.then(t.bind({
  25356. success: !0,
  25357. message: "Init complete."
  25358. }))
  25359. },
  25360. moveToPano: function(e, t) {
  25361. var i = new c.Euler(0,0,0,"YXZ")
  25362. , n = new c.Quaternion;
  25363. return function(e, t) {
  25364. var r = e.pano
  25365. , o = e.rotation
  25366. , a = e.transition;
  25367. if (!this.model)
  25368. return t({
  25369. success: !1,
  25370. error: "The model has not been loaded yet"
  25371. });
  25372. var s = this.model.panos.get(r);
  25373. if (!s)
  25374. return t({
  25375. success: !1,
  25376. error: r + " does not exist in this model"
  25377. });
  25378. if (!o)
  25379. return t({
  25380. sucess: !1,
  25381. erorr: o + " is not a valid rotation"
  25382. });
  25383. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25384. console.log(o.z);
  25385. var l = {
  25386. success: !0,
  25387. message: r
  25388. };
  25389. if (a === A.FADEOUT)
  25390. n.setFromEuler(i),
  25391. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25392. else {
  25393. var h, u;
  25394. a === A.INSTANT && (h = 0,
  25395. u = 0);
  25396. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25397. this.player.flyToPano({
  25398. pano: s,
  25399. lookAtPoint: d,
  25400. duration: h,
  25401. aimDuration: u
  25402. }, t.bind(this, l))
  25403. }
  25404. }
  25405. }(),
  25406. moveInDirection: function(e, t) {
  25407. var i = e.direction;
  25408. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25409. void (t && t({
  25410. success: !1,
  25411. error: "Invalid direction."
  25412. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25413. t(e ? {
  25414. success: !0,
  25415. message: "moved " + i
  25416. } : {
  25417. success: !1,
  25418. error: "Cannot move in direction: " + i
  25419. })
  25420. })
  25421. },
  25422. getPose: function(e, t) {
  25423. this.player.camera.position,
  25424. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25425. return t({
  25426. success: !0,
  25427. message: B(this.player)
  25428. })
  25429. },
  25430. takeScreenShot: function() {
  25431. var e = new c.PerspectiveCamera
  25432. , t = new c.WebGLRenderTarget;
  25433. return function(i, n) {
  25434. if (!i.resolution)
  25435. return n({
  25436. success: !1,
  25437. error: "An invalid resolution was specified"
  25438. });
  25439. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25440. var r = this.sceneRenderer.renderer.getSize();
  25441. i.resolution.width = r.width,
  25442. i.resolution.height = r.height
  25443. }
  25444. e.layers.set(x.DEFAULT),
  25445. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25446. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25447. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25448. var o = i.resolution.width
  25449. , a = i.resolution.height
  25450. , s = o / a;
  25451. e.position.copy(this.sceneRenderer.camera.position),
  25452. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25453. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25454. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25455. t.setSize(o, a),
  25456. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25457. var l = new Uint8Array(o * a * 4);
  25458. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25459. var c = M.encode({
  25460. data: l,
  25461. width: o,
  25462. height: a,
  25463. heading: 180,
  25464. pitch: 0
  25465. }, {
  25466. quality: 75,
  25467. flipY: !0
  25468. })
  25469. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25470. n({
  25471. success: !0,
  25472. message: h
  25473. })
  25474. }
  25475. }(),
  25476. findRankedPano: function(e, t) {
  25477. var i = new c.Vector3
  25478. , r = new c.Vector3;
  25479. return function(e, t) {
  25480. s(this.player, r),
  25481. n(t, r, i);
  25482. var o = this.player.rankedPanoInDirection(e, i);
  25483. if (o) {
  25484. var a = this.objectToHandle[o.id];
  25485. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25486. this.handleToObject[a] = o),
  25487. a
  25488. }
  25489. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25490. -1
  25491. }
  25492. }(),
  25493. findRankedtag: function(e, t) {
  25494. var i = new c.Vector3
  25495. , r = new c.Vector3;
  25496. return function(e, t) {
  25497. s(this.player, r),
  25498. n(t, r, i);
  25499. var o = this.player.rankedtagInDirection(e, i);
  25500. if (o) {
  25501. var a = this.objectToHandle[o.sid];
  25502. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25503. this.handleToObject[a] = o),
  25504. a
  25505. }
  25506. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25507. -1
  25508. }
  25509. }(),
  25510. clickNearesttag: function(e) {
  25511. this.clickRankedtag(0, e)
  25512. },
  25513. clickRankedtag: function(e, t) {
  25514. var i = a.call(this, e, t);
  25515. i && O.call(this, i)
  25516. },
  25517. clickNearestPano: function(e, t) {
  25518. this.clickRankedPano(0, e, t)
  25519. },
  25520. clickRankedPano: function(e, t, i) {
  25521. var n = o.call(this, e, t);
  25522. n ? r.call(this, n, i) : i(null)
  25523. },
  25524. clickPano: function(e, t) {
  25525. var i = this.handleTable[e];
  25526. i ? r.call(this, i, t) : t(null)
  25527. },
  25528. rotateDirection: function() {
  25529. return function(e, t) {
  25530. var i = e.direction
  25531. , n = e.angle;
  25532. if (!P.active) {
  25533. var r = 0
  25534. , o = 0
  25535. , a = 0
  25536. , s = 0;
  25537. if (!n || isNaN(n))
  25538. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  25539. void (t && t({
  25540. success: !1,
  25541. error: "Invalid rotation angle."
  25542. }));
  25543. if (this.player.mode === E.TRANSITIONING)
  25544. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  25545. void (t && t({
  25546. success: !1,
  25547. error: "Cannot rotate while transitioning"
  25548. }));
  25549. if (i === v.RIGHT || i === v.LEFT)
  25550. i === v.RIGHT && (n = -n),
  25551. r = n > 0 ? -1 : 1,
  25552. a = n;
  25553. else {
  25554. if (i !== v.UP && i !== v.DOWN)
  25555. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  25556. void (t && t({
  25557. success: !1,
  25558. error: "Invalid direction for rotation."
  25559. }));
  25560. if (this.player.mode === E.FLOORPLAN)
  25561. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  25562. void (t && t({
  25563. success: !1,
  25564. error: "Cannot rotate " + i + " in floorplan mode"
  25565. }));
  25566. if (i === v.DOWN && (n = -n),
  25567. n = N.call(this, n),
  25568. 0 === n)
  25569. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  25570. void (t && t({
  25571. success: !1,
  25572. error: "Already at maximum rotation in direction: " + i
  25573. }));
  25574. o = n > 0 ? 1 : -1,
  25575. s = n
  25576. }
  25577. var l = n;
  25578. n = c.Math.degToRad(n),
  25579. a = c.Math.degToRad(a),
  25580. s = c.Math.degToRad(s);
  25581. var h = this.controls.activeControl
  25582. , u = function() {
  25583. h.stopRotating(!0),
  25584. t && t({
  25585. success: !0,
  25586. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  25587. })
  25588. };
  25589. h.startRotating(r, o),
  25590. P.start(a, s, this.player, u)
  25591. }
  25592. }
  25593. }(),
  25594. rotate: function() {
  25595. var e = new c.Vector3
  25596. , t = new c.Vector3;
  25597. return function(i, n) {
  25598. var r = i.xAngle
  25599. , o = i.yAngle;
  25600. if (!P.active) {
  25601. if (r = r || 0,
  25602. o = o || 0,
  25603. isNaN(r) || isNaN(o))
  25604. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  25605. void (n && n({
  25606. success: !1,
  25607. error: "Invalid rotation angle."
  25608. }));
  25609. if (this.player.mode === E.TRANSITIONING)
  25610. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  25611. void (n && n({
  25612. success: !1,
  25613. error: "Cannot rotate while transitioning"
  25614. }));
  25615. Math.abs(r) < .01 && (r = 0),
  25616. Math.abs(o) < .01 && (o = 0);
  25617. var a = o;
  25618. o = N.call(this, o),
  25619. r = -r;
  25620. var s = a > 0 ? "UP" : "DOWN";
  25621. if (!r && a && !o)
  25622. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  25623. void (n && n({
  25624. success: !1,
  25625. error: "Already at maximum rotation in direction: " + s
  25626. }));
  25627. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  25628. var l = o;
  25629. o = c.Math.degToRad(o),
  25630. r = c.Math.degToRad(r),
  25631. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25632. this.player.getDirection(e),
  25633. t.copy(e).applyAxisAngle(I.UP, r),
  25634. t.applyAxisAngle(I.RIGHT, o);
  25635. var h = (e.angleTo(t),
  25636. r > 0 ? -1 : r < 0 ? 1 : 0)
  25637. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  25638. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  25639. var d = this.controls.activeControl
  25640. , p = function() {
  25641. d.stopRotating(!0),
  25642. n && n({
  25643. success: !0,
  25644. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  25645. })
  25646. };
  25647. d.startRotating(h, u),
  25648. P.start(r, o, this.player, p)
  25649. }
  25650. }
  25651. }(),
  25652. panCamera: function(e, t) {
  25653. function i(e) {
  25654. switch (r.removeAllListeners(T.AutoPanComplete),
  25655. r.removeAllListeners(T.AutoPanInterrupt),
  25656. r.removeAllListeners(T.AutoPanClamped),
  25657. e) {
  25658. case T.AutoPanInterrupt:
  25659. t({
  25660. success: !0,
  25661. message: "Camera panning interrupted."
  25662. });
  25663. break;
  25664. case T.AutoPanClamped:
  25665. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25666. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  25667. return void t({
  25668. success: !1,
  25669. error: "Already at edge of current model bounds."
  25670. });
  25671. var i = "The view point is outside the bounds for the current model. ";
  25672. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  25673. console.warn(i)
  25674. }
  25675. case T.AutoPanComplete:
  25676. t({
  25677. success: !0,
  25678. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25679. })
  25680. }
  25681. }
  25682. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25683. return t({
  25684. success: !1,
  25685. error: "Camera panning is not available in the current mode: " + this.player.mode
  25686. });
  25687. var n = e.position
  25688. , r = this.player.control;
  25689. r.setAutoPanPosition(n.x, n.z),
  25690. r.autoPan = !0;
  25691. var o = function(e, t) {
  25692. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  25693. };
  25694. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  25695. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  25696. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25697. },
  25698. click: function(e, t) {
  25699. var i = e.x
  25700. , n = e.y
  25701. , r = e.percentage;
  25702. r === !0 && (i = i / 100 * $("#player").width(),
  25703. n = n / 100 * $("#player").height()),
  25704. this.player.handleInputStart(i, n),
  25705. this.player.updateIntersect(),
  25706. this.player.handleInputEnd(i, n)
  25707. },
  25708. mouseOver: function(e, t) {
  25709. var i = e.x
  25710. , n = e.y
  25711. , r = e.percentage;
  25712. r === !0 && (i = i / 100 * $("#player").width(),
  25713. n = n / 100 * $("#player").height()),
  25714. this.player.handleInputMove(i, n),
  25715. this.player.updateIntersect()
  25716. },
  25717. moveToMode: function(e, t) {
  25718. function i(e) {
  25719. t(e ? {
  25720. success: !1,
  25721. error: "Failed to load new mode: " + e
  25722. } : {
  25723. success: !0,
  25724. message: "Moved to new mode: " + n
  25725. })
  25726. }
  25727. var n = e.mode;
  25728. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  25729. i()
  25730. }, function(e) {
  25731. i(e)
  25732. }) : t({
  25733. success: !1,
  25734. error: "Invalid mode selection"
  25735. })
  25736. }
  25737. }
  25738. }
  25739. ).call(this, "/js/sdk/automation.js")
  25740. }
  25741. , {
  25742. "../constants": 8,
  25743. "../enum/AlignmentType": 17,
  25744. "../enum/ControlEvents": 21,
  25745. "../enum/Direction": 22,
  25746. "../enum/GLCubeFaces": 25,
  25747. "../enum/Keys": 30,
  25748. "../enum/ModelManagerEvents": 33,
  25749. "../enum/PlayerEvents": 40,
  25750. "../enum/RenderLayers": 41,
  25751. "../enum/Vectors": 50,
  25752. "../enum/Viewmode": 51,
  25753. "../enum/WarpStyle": 52,
  25754. "../lib/jpeg_encoder": 94,
  25755. "../sdk/SdkEvents": 161,
  25756. "../settings": 166,
  25757. "../util/common": 185,
  25758. "../util/logger": 189,
  25759. "../util/math": 190,
  25760. "../util/panorama": 191,
  25761. "./ApiHost": 159,
  25762. "./PostMessageType": 160,
  25763. "./TransitionStyles": 162,
  25764. three: 217
  25765. }],
  25766. 165: [function(e, t, i) {
  25767. "use strict";
  25768. function n(e) {
  25769. this.sourceWindow = e,
  25770. this.targetWindow = null,
  25771. this.targetOrigin = null,
  25772. this.id = Math.floor(1e5 * Math.random()),
  25773. this.bindEvents()
  25774. }
  25775. var r = e("./PostMessageType")
  25776. , o = e("events").EventEmitter;
  25777. n.prototype = Object.create(o.prototype),
  25778. n.prototype.bindEvents = function() {
  25779. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  25780. }
  25781. ,
  25782. n.prototype.setTarget = function(e, t) {
  25783. this.targetWindow = e,
  25784. this.targetOrigin = t
  25785. }
  25786. ,
  25787. n.prototype.onPostmessageReceived = function(e) {
  25788. var t = e.origin || e.originalEvent.origin
  25789. , i = e.source;
  25790. switch (e.data.type) {
  25791. case r.CONNECT:
  25792. break;
  25793. case r.RESPONSE:
  25794. if (this.id !== e.data.toId)
  25795. return;
  25796. default:
  25797. if (!this.validateMessageOrigin(t))
  25798. return
  25799. }
  25800. var n = e.data;
  25801. n.source = i,
  25802. n.origin = t,
  25803. n.timestamp = Date.now(),
  25804. this.emit(e.data.type, n)
  25805. }
  25806. ,
  25807. n.prototype.validateMessageOrigin = function(e) {
  25808. return "*" === this.targetOrigin || e === this.targetOrigin
  25809. }
  25810. ,
  25811. n.prototype.send = function(e) {
  25812. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  25813. this.targetWindow.postMessage(e, this.targetOrigin))
  25814. }
  25815. ,
  25816. t.exports = n
  25817. }
  25818. , {
  25819. "./PostMessageType": 160,
  25820. events: 202
  25821. }],
  25822. 166: [function(e, t, i) {
  25823. "use strict";
  25824. var n = e("three")
  25825. , r = e("./util/browser")
  25826. , o = e("./enum/Viewmode")
  25827. , a = e("./enum/VROption")
  25828. , s = e("./enum/Colors")
  25829. , l = e("./enum/WarpStyle")
  25830. , c = e("./util/easing")
  25831. , h = e("./util/common")
  25832. , u = e("./util/showcase")
  25833. , d = e("./constants")
  25834. , p = {
  25835. debug: !1,
  25836. version: "2.25.6-0-gd87e5b1",
  25837. languageTag: r.valueFromHash("lang", null),
  25838. pageTitle: "四维虚拟漫游",
  25839. authorizationHeader: u.getAuthorizationHeader(),
  25840. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  25841. logLevel: r.valueFromHash("log", 2),
  25842. skyboxRadius: 2500,
  25843. modelBoundsPadding: 5,
  25844. showNeighbors: !1,
  25845. brand: r.valueFromHash("brand", !0),
  25846. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25847. startHighlights: r.valueFromHash("hl", -1),
  25848. specialEdition: r.valueFromHash("bn", 0),
  25849. useWheel: r.valueFromHash("wh", !0),
  25850. crossOrigin: "anonymous",
  25851. fancierTransition: !1,
  25852. wireframe: !1,
  25853. skyboxWireframe: !1,
  25854. modelAlpha: 1,
  25855. highlightPanoSelection: !1,
  25856. showSweeps: !0,
  25857. showSkyboxes: !1,
  25858. showMesh: !0,
  25859. showFloors: !1,
  25860. showFloorDuration: 300,
  25861. showFloorDelay: 300,
  25862. hideFloorDuration: 300,
  25863. hideFloorDelay: 0,
  25864. reticuleOpacityTransitionTime: 250,
  25865. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  25866. markerOpacityTransitionTime: 500,
  25867. guiAnimationSpeed: 250,
  25868. highlightAnimationDuration: 500,
  25869. modelComponentLoadSpinnerDelay: 150,
  25870. captureErrors: !1,
  25871. maxMobileTextures: 6,
  25872. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25873. startupFlyinDelay: 3e3,
  25874. dollhouseDefault: {
  25875. minDistance: 8,
  25876. maxDistance: 50,
  25877. minPolarAngle: n.Math.degToRad(10),
  25878. maxPolarAngle: n.Math.degToRad(90)
  25879. },
  25880. hideReticuleTimeout: 1e3,
  25881. analytics: {
  25882. inactivityThreshold: 30,
  25883. sessionTrackingRate: .15,
  25884. maxTrackedErrors: 20,
  25885. sessionDurationPingFrequency: 10,
  25886. sessionDurationTimeout: 15
  25887. },
  25888. flydown: {
  25889. movementEasing: "easeInOutQuad",
  25890. movementDelay: .001,
  25891. rotationEasing: "easeInOutQuad",
  25892. rotationDelay: .5,
  25893. modelTextureDelay: .75,
  25894. skyboxDelay: .75
  25895. },
  25896. transition: {
  25897. flySpeed: .001,
  25898. flyTime: 750,
  25899. flytimeMaxDistanceThreshold: 5,
  25900. flytimeDistanceMultiplier: 150,
  25901. aimTime: 1500,
  25902. aimSlowFactor: 1.5,
  25903. blur: 0.8,
  25904. movementEasing: "easeInOutQuad",
  25905. blendEasing: "easeInOutQuad",
  25906. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  25907. },
  25908. show360Views: {
  25909. enabled: !0,
  25910. transitionTime: 1e3
  25911. },
  25912. quickstart: {
  25913. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25914. animation: 1400,
  25915. showTextDelay: 500,
  25916. fadeOutDelay: 3e3,
  25917. fovChange: 10
  25918. },
  25919. appConfig: {
  25920. webvr_version: null,
  25921. segment_key: null,
  25922. embedly_key: null,
  25923. branch_key: null,
  25924. keen_write_key: null,
  25925. keen_project_id: null
  25926. },
  25927. vr: {
  25928. enabled: !0,
  25929. allowWebVR: !1,
  25930. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25931. },
  25932. share: {
  25933. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25934. },
  25935. input: {
  25936. longTapThreshold: 200,
  25937. moveToleranceNDC: .08,
  25938. touchMoveThreshold: 25
  25939. },
  25940. help: {
  25941. modalStayDuration: 600
  25942. },
  25943. immersive: {
  25944. timeToShowAgain: 1250,
  25945. uiStayDuration: 600
  25946. },
  25947. tourInteraction: {
  25948. disabled: "0" === r.valueFromHash("tourcta", null),
  25949. showPauseButton: 1e3,
  25950. showModal: 1500,
  25951. allowNextClick: 200,
  25952. largeModal: "1" === r.valueFromHash("tourcta", null),
  25953. smallModal: "2" === r.valueFromHash("tourcta", null)
  25954. },
  25955. labels: {
  25956. enabled: !1,
  25957. hideUntilStart: !0,
  25958. fadeInDuration: 250,
  25959. fadeInDelay: 250,
  25960. fadeOutDuration: 250,
  25961. fadeOutDelay: 0,
  25962. zoomHideThreshhold: {
  25963. mobile: r.isSmallScreen() ? .45 : .6,
  25964. desktop: 2
  25965. },
  25966. zoomTruncateThreshhold: {
  25967. mobile: r.isSmallScreen() ? .35 : .45,
  25968. desktop: .85
  25969. },
  25970. minLengthForTruncate: 16,
  25971. truncateLength: 12,
  25972. truncateSuffix: "..."
  25973. },
  25974. hot:{
  25975. scale:{
  25976. nearBound: 1.5,
  25977. farBound: 4.8,
  25978. linkFarBound: !1,
  25979. linkPercent: 40,
  25980. maxSize: 120,
  25981. minSize: 60,
  25982. baseViewportSize: 800,
  25983. responsiveness: 100
  25984. }
  25985. },
  25986. tags: {
  25987. enabled: r.valueFromHash("mt", 1),
  25988. startup: {
  25989. hideUntilStart: !0,
  25990. fadeInDuration: 500,
  25991. fadeInDelay: 100
  25992. },
  25993. visibility: {
  25994. anyDistance: !0,
  25995. visibleDistance: 8,
  25996. cameraClearance: .1,
  25997. alphaTestLevel: .05,
  25998. hideViaFloor: !0,
  25999. hideOffScreenDisc: !1,
  26000. hideOffScreenObject: !1
  26001. },
  26002. disc: {
  26003. opacity: 1,
  26004. disabledOpacity: .5,
  26005. scale: {
  26006. nearBound: 1.5,
  26007. farBound: 4.8,
  26008. linkFarBound: !1,
  26009. linkPercent: 40,
  26010. maxSize: 80,
  26011. minSize: 40,
  26012. baseViewportSize: 800,
  26013. responsiveness: 100
  26014. }
  26015. },
  26016. pole: {
  26017. enabled: !0,
  26018. height: .5,
  26019. width: 2,
  26020. opacity: .5,
  26021. color: "white"
  26022. },
  26023. navigate: {
  26024. nearestPano: !0,
  26025. lineOfSight: !0,
  26026. reactivate: !0,
  26027. aimAt: "disc",
  26028. tiltTolerance: 25,
  26029. rotateSpeedFactor: .6
  26030. }
  26031. },
  26032. path: {
  26033. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26034. colorUp: s._desat(s.newBlue, .5),
  26035. colorDown: s._darken(s.newBlue, .35),
  26036. opacity: .5,
  26037. style: "ribbon",
  26038. height: .025,
  26039. ribbonWidth: .24,
  26040. outsideHeight: .5,
  26041. waypointRadius: .5,
  26042. waypointIndoorRadius: .24,
  26043. waypointPulse: 1e3,
  26044. typ: l.BLACK,
  26045. meshFree: r.valueFromHash("mf", 1),
  26046. mapGuides: r.valueFromHash("guides", !0),
  26047. fadeInTime: 400,
  26048. fadeOutTime: 300
  26049. },
  26050. warp: {
  26051. nearPanoDist: .1,
  26052. matchCam: !1,
  26053. blur: .33,
  26054. fastTime: 1500,
  26055. teleportTime: 1500,
  26056. outsideTime: 2e3,
  26057. lookAheadMax: .3,
  26058. lookAheadDist: 2.5,
  26059. softPushDist: .37,
  26060. softPushEnd: .3,
  26061. softBendAngle: 8,
  26062. softBendTilt: 4,
  26063. softBendEnd: .3,
  26064. doBurns: true, //r.valueFromHash("kb", !0),
  26065. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26066. minBurnsAngle: 35,
  26067. minDownAngle: -35,
  26068. maxTurnPerSec: 280,
  26069. maxAimPerSec: 35,
  26070. minRotation: 12,
  26071. maxAimRotation: 33.2,
  26072. turnFriction: .2,
  26073. flySpeed: .01,
  26074. minWarpTime: 1200,
  26075. warpInterruptionRedirectTime: 500,
  26076. tourStepDelay: r.valueFromHash("st", 0),
  26077. walkDelay: 0,
  26078. walkMaxDist: 50,
  26079. walkMinDist: .8,
  26080. walkSlideShowThreshhold: 3000,
  26081. walkExtraPanosDistance: .4,
  26082. timePerMeter: 1200,
  26083. motionLeadTime: 5000,
  26084. movementEasing: "easeInOutQuad",
  26085. blendEasing: "easeInOutQuad",
  26086. showBunny: !1,
  26087. loop: r.valueFromHash("lp", !1),
  26088. auto: r.valueFromHash("ts", -1),
  26089. eOrder: 'YXZ', //"YXZ",
  26090. stepFactor: .25,
  26091. brakeStrength: 2,
  26092. minBrakeAngle: .1,
  26093. maxBrakeAngle: 1.8,
  26094. climbEffort: 4
  26095. },
  26096. rotationFriction: .05,
  26097. rotationAccelerationInside: 4.5,
  26098. rotationAccelerationOutside: .15,
  26099. rotationAfterMoveMultiplier: 40,
  26100. rotationAfterMoveHistoryCount: 5,
  26101. panFriction: .09,
  26102. panAccelerationOutside: 60,
  26103. onload: r.valueFromHash("onload", o.PANORAMA),
  26104. zoomNearLimit: .1,
  26105. zoomFarLimit: 10,
  26106. navigation: {
  26107. panoScores: !1,
  26108. mouseDirection: !0,
  26109. filterStrictness: .75,
  26110. angleFactor: -30,
  26111. directionFactor: 10,
  26112. distanceFactor: -1,
  26113. optionalityFactor: 3
  26114. },
  26115. sdkInit: !1,
  26116. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26117. console: r.valueFromHash("console", !1),
  26118. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26119. panoramaNeighbourMaxDistance: 5,
  26120. panoFloorClickRadius: .35,
  26121. showScreenshotLocations: !1,
  26122. showAxis: !1,
  26123. showNeighbourRaycasts: !1,
  26124. colorMarkerOnLoad: !1,
  26125. colorMarkerByFloor: !1,
  26126. tiling: {
  26127. panoPreRenderRepeatDelay: 2500,
  26128. panoPreRenderDelay: 500,
  26129. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26130. tilingFlagNames: ["usetiles", "tiles"],
  26131. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26132. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26133. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26134. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26135. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26136. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  26137. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26138. customCompression: r.valueFromHash("tilecustcomp", 0),
  26139. // mobileHighQualityOverride: !1,
  26140. mobileHighQualityOverride: 1,
  26141. allowUltraHighResolution: true
  26142. },
  26143. zoom: {
  26144. enabled: true,
  26145. forceOff: r.valueFromHash("nozoom", 0),
  26146. overridemax: r.valueFromHash("maxzoom", null),
  26147. overridemin: r.valueFromHash("minzoom", null),
  26148. max: d.highQualityMaxZoom,
  26149. min: 1,
  26150. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26151. activationThreshold: 1.1,
  26152. restoreTime: 500
  26153. },
  26154. profiling: {
  26155. enabled: r.valueFromHash("mem", !1)
  26156. }
  26157. };
  26158. p = h.deepExtend(p, d, {
  26159. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26160. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26161. panorama: {
  26162. transitionTime: 1e3,
  26163. modelAlpha: 0,
  26164. modelAlphaDelay: p.flydown.modelTextureDelay,
  26165. modelAlphaLength: 1,
  26166. skyboxOpacity: 1,
  26167. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26168. skyboxOpacityLength: .9,
  26169. fovLength: 1,
  26170. fovDelay: 0,
  26171. cameraMatrixDuration: .8,
  26172. cameraMatrixDelay: 0,
  26173. cameraMatrixEase: c.easeInCubic,
  26174. reticuleOpacity: 1,
  26175. markerOpacity: .3,
  26176. markerOpacityOnHover: 1
  26177. },
  26178. dollhouse: {
  26179. transitionTime: 1e3,
  26180. modelAlpha: 1,
  26181. modelAlphaDelay: 0,
  26182. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26183. skyboxOpacity: 0,
  26184. skyboxOpacityDelay: 0,
  26185. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26186. fovLength: 1,
  26187. fovDelay: 0,
  26188. cameraMatrixDuration: .8,
  26189. cameraMatrixDelay: .3,
  26190. cameraMatrixEase: c.easeInCubic,
  26191. reticuleOpacity: 1,
  26192. markerOpacity: 0,
  26193. markerOpacityOnHover: 0
  26194. },
  26195. floorplan: {
  26196. transitionTime: 1e3,
  26197. modelAlpha: 1,
  26198. modelAlphaDelay: 0,
  26199. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26200. skyboxOpacity: 0,
  26201. skyboxOpacityDelay: 0,
  26202. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26203. fovLength: 1,
  26204. fovDelay: 0,
  26205. cameraMatrixDuration: .5,
  26206. cameraMatrixDelay: 0,
  26207. cameraMatrixEase: c.easeOutCubic,
  26208. reticuleOpacity: 1,
  26209. markerOpacity: 0,
  26210. markerOpacityOnHover: 0,
  26211. cameraHeight: 50
  26212. },
  26213. transitioning: {
  26214. reticuleOpacity: 0,
  26215. markerOpacity: .3,
  26216. markerOpacityOnHover: 1
  26217. },
  26218. "floorplan-dollhouse": {
  26219. rotationDelay: 0,
  26220. rotationDuration: 1
  26221. },
  26222. "floorplan-panorama": {
  26223. rotationDelay: .5,
  26224. rotationDuration: 1
  26225. },
  26226. "dollhouse-panorama": {
  26227. rotationDelay: .5,
  26228. rotationDuration: 1
  26229. },
  26230. "dollhouse-floorplan": {
  26231. rotationDelay: 0,
  26232. rotationDuration: 1,
  26233. cameraMatrixDuration: 1.05,
  26234. cameraMatrixDelay: .5
  26235. },
  26236. "panorama-dollhouse": {
  26237. rotationDelay: 0,
  26238. rotationDuration: .5
  26239. },
  26240. "panorama-floorplan": {
  26241. transitionTime: 1500,
  26242. rotationDelay: 0,
  26243. rotationDuration: .5
  26244. }
  26245. }),
  26246. p.path.meshFree && (p.path.typ = l.WALK),
  26247. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26248. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26249. t.exports = p
  26250. }
  26251. , {
  26252. "./constants": 8,
  26253. "./enum/Colors": 19,
  26254. "./enum/VROption": 47,
  26255. "./enum/Viewmode": 51,
  26256. "./enum/WarpStyle": 52,
  26257. "./util/browser": 182,
  26258. "./util/common": 185,
  26259. "./util/easing": 186,
  26260. "./util/showcase": 193,
  26261. three: 217
  26262. }],
  26263. 167: [function(e, t, i) {
  26264. "use strict";
  26265. var n = e("three")
  26266. , r = e("./settings")
  26267. , 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"
  26268. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26269. t.exports = {
  26270. basicTextured: {
  26271. uniforms: {
  26272. tDiffuse: {
  26273. type: "t",
  26274. value: null
  26275. },
  26276. alpha: {
  26277. type: "f",
  26278. value: 1
  26279. }
  26280. },
  26281. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26282. 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}"
  26283. },
  26284. copyCubeMap: {
  26285. uniforms: {
  26286. tDiffuse: {
  26287. type: "t",
  26288. value: null
  26289. },
  26290. alpha: {
  26291. type: "f",
  26292. value: 1
  26293. }
  26294. },
  26295. 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}",
  26296. 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}"
  26297. },
  26298. cube: {
  26299. uniforms: {
  26300. map: {
  26301. type: "t",
  26302. value: null
  26303. },
  26304. opacity: {
  26305. type: "f",
  26306. value: 1
  26307. }
  26308. },
  26309. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26310. 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"
  26311. },
  26312. model: {
  26313. uniforms: {
  26314. map: {
  26315. type: "t",
  26316. value: null
  26317. },
  26318. modelAlpha: {
  26319. type: "f",
  26320. value: r.modelAlpha
  26321. },
  26322. opacity: {
  26323. type: "f",
  26324. value: 1
  26325. },
  26326. progress: {
  26327. type: "f",
  26328. value: 0
  26329. },
  26330. blackout: {
  26331. type: "i",
  26332. value: 0
  26333. },
  26334. pano0Map: {
  26335. type: "t",
  26336. value: null
  26337. },
  26338. pano0Position: {
  26339. type: "v3",
  26340. value: new n.Vector3
  26341. },
  26342. pano0Matrix: {
  26343. type: "m4",
  26344. value: new n.Matrix4
  26345. },
  26346. pano1Map: {
  26347. type: "t",
  26348. value: null
  26349. },
  26350. pano1Position: {
  26351. type: "v3",
  26352. value: new n.Vector3
  26353. },
  26354. pano1Matrix: {
  26355. type: "m4",
  26356. value: new n.Matrix4
  26357. }
  26358. },
  26359. 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",
  26360. 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"
  26361. },
  26362. hot:{
  26363. uniforms:{
  26364. color:{
  26365. type: "c",
  26366. value: new n.Color( 0xff2200 )
  26367. },
  26368. opac:{
  26369. type: "f",
  26370. value: 0
  26371. },
  26372. texture1:{
  26373. type: "t",
  26374. value: null
  26375. },
  26376. texture2:{
  26377. type: "t",
  26378. value: null
  26379. },
  26380. opacity:{
  26381. type: "f",
  26382. value: 1
  26383. },
  26384. },
  26385. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26386. fragmentShader:"varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac; uniform float opacity;\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\n gl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; gl_FragColor.w *= opacity; }\n"
  26387. },
  26388. modelOutside: {
  26389. uniforms: {
  26390. map: {
  26391. type: "t",
  26392. value: null
  26393. },
  26394. opacity: {
  26395. type: "f",
  26396. value: 1
  26397. }
  26398. },
  26399. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26400. 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"
  26401. },
  26402. ribbon: {
  26403. uniforms: {
  26404. map: {
  26405. type: "t",
  26406. value: null
  26407. },
  26408. opacity: {
  26409. type: "f",
  26410. value: 1
  26411. },
  26412. color: {
  26413. type: "c",
  26414. value: new n.Color(r.path.color)
  26415. }
  26416. },
  26417. 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",
  26418. 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"
  26419. },
  26420. waypoint: {
  26421. uniforms: {
  26422. map: {
  26423. type: "t",
  26424. value: null
  26425. },
  26426. opacity: {
  26427. type: "f",
  26428. value: 1
  26429. },
  26430. pulse: {
  26431. type: "f",
  26432. value: 1
  26433. },
  26434. nearFade: {
  26435. type: "v2",
  26436. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26437. },
  26438. color: {
  26439. type: "c",
  26440. value: new n.Color(r.reticuleColor)
  26441. }
  26442. },
  26443. 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",
  26444. 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"
  26445. },
  26446. modelDebug: {
  26447. uniforms: {
  26448. map: {
  26449. type: "t",
  26450. value: null
  26451. },
  26452. modelAlpha: {
  26453. type: "f",
  26454. value: r.modelAlpha
  26455. },
  26456. depthmapRatio: {
  26457. type: "f",
  26458. value: 0
  26459. },
  26460. opacity: {
  26461. type: "f",
  26462. value: 1
  26463. },
  26464. progress: {
  26465. type: "f",
  26466. value: 0
  26467. },
  26468. considerOcclusion: {
  26469. type: "i",
  26470. value: r.fancierTransition
  26471. },
  26472. highlightPanoSelection: {
  26473. type: "i",
  26474. value: 0
  26475. },
  26476. useThirdPano: {
  26477. type: "i",
  26478. value: r.useThirdPano
  26479. },
  26480. pano0Map: {
  26481. type: "t",
  26482. value: null
  26483. },
  26484. pano0Depth: {
  26485. type: "t",
  26486. value: null
  26487. },
  26488. pano0Position: {
  26489. type: "v3",
  26490. value: new n.Vector3
  26491. },
  26492. pano0Matrix: {
  26493. type: "m4",
  26494. value: new n.Matrix4
  26495. },
  26496. pano0Weight: {
  26497. type: "f",
  26498. value: r.transition.pano0Weight
  26499. },
  26500. pano1Map: {
  26501. type: "t",
  26502. value: null
  26503. },
  26504. pano1Depth: {
  26505. type: "t",
  26506. value: null
  26507. },
  26508. pano1Position: {
  26509. type: "v3",
  26510. value: new n.Vector3
  26511. },
  26512. pano1Matrix: {
  26513. type: "m4",
  26514. value: new n.Matrix4
  26515. },
  26516. pano1Weight: {
  26517. type: "f",
  26518. value: r.transition.pano1Weight
  26519. },
  26520. pano2Map: {
  26521. type: "t",
  26522. value: null
  26523. },
  26524. pano2Depth: {
  26525. type: "t",
  26526. value: null
  26527. },
  26528. pano2Position: {
  26529. type: "v3",
  26530. value: new n.Vector3
  26531. },
  26532. pano2Matrix: {
  26533. type: "m4",
  26534. value: new n.Matrix4
  26535. },
  26536. pano2Weight: {
  26537. type: "f",
  26538. value: r.transition.pano2Weight
  26539. }
  26540. },
  26541. 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",
  26542. 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"
  26543. },
  26544. customDepth: {
  26545. uniforms: {
  26546. panoPosition: {
  26547. type: "v3",
  26548. value: new n.Vector3
  26549. }
  26550. },
  26551. 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",
  26552. 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"
  26553. },
  26554. skysphere: {
  26555. uniforms: {
  26556. radius: {
  26557. type: "f",
  26558. value: 0
  26559. }
  26560. },
  26561. 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",
  26562. 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"
  26563. },
  26564. tagDisc: {
  26565. uniforms: {
  26566. opacity: {
  26567. type: "f",
  26568. value: 0
  26569. },
  26570. color: {
  26571. type: "c",
  26572. value: new n.Color
  26573. },
  26574. bg: {
  26575. type: "t",
  26576. value: null
  26577. },
  26578. mask: {
  26579. type: "t",
  26580. value: null
  26581. }
  26582. },
  26583. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26584. 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"
  26585. }
  26586. }
  26587. }
  26588. , {
  26589. "./settings": 166,
  26590. three: 217
  26591. }],
  26592. 168: [function(e, t, i) {
  26593. (function(i) {
  26594. "use strict";
  26595. var n = e("three")
  26596. , r = (e("url"),
  26597. e("./util/ajax"))
  26598. , o = e("./settings")
  26599. , a = e("./util/logger")
  26600. , s = e("./util/math")
  26601. , l = e("./util/showcase")
  26602. , c = e("./objects/Panorama")
  26603. , h = new a(i)
  26604. , u = e("./model/Model")
  26605. , d = e("./shaders")
  26606. , p = e("./util/transitions")
  26607. , f = e("./objects/Chunk")
  26608. , g = e("./objects/Reticule")
  26609. , m = e("./objects/Skybox")
  26610. , v = e("./objects/Floor")
  26611. , A = e("./cameras/DollhouseCamera")
  26612. , y = e("./cameras/FloorplanCamera")
  26613. , C = e("./cameras/PanoramaCamera")
  26614. , I = e("./controls/DollhouseControls")
  26615. , E = e("./controls/FloorplanControls")
  26616. , b = e("./controls/PanoramaControls");
  26617. n.ImageUtils.crossOrigin = o.crossOrigin,
  26618. t.exports = {
  26619. shaders: d,
  26620. transitions: p,
  26621. Model: u,
  26622. Chunk: f,
  26623. Floor: v,
  26624. Skybox: m,
  26625. Reticule: g,
  26626. Panorama: c,
  26627. DollhouseCamera: A,
  26628. FloorplanCamera: y,
  26629. PanoramaCamera: C,
  26630. DollhouseControls: I,
  26631. FloorplanControls: E,
  26632. PanoramaControls: b,
  26633. getModel: function(e) {
  26634. if (!e.url)
  26635. throw 'getModel(): missing parameter "url"';
  26636. e.autoload = void 0 === e.autoload || e.autoload;
  26637. var t = l.parseSidUrl(e.url);
  26638. e.urlBase = t.urlBase,
  26639. e.urlModel = t.urlModel,
  26640. e.urlFiles = t.urlFiles;
  26641. var i = this._getPlatformError();
  26642. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  26643. this._loadModel().then(this._buildModel.bind(this)))
  26644. },
  26645. _getPlatformError: function() {
  26646. 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"
  26647. },
  26648. _loadModel: function() {
  26649. return r.get(this.options.urlModel, {
  26650. responseType: "json",
  26651. prefetchFrom: "model",
  26652. auth: l.getAuthorizationHeader()
  26653. }).then(null, function() {
  26654. return h.warn("Model loading failed at initial metadata load"),
  26655. "loading-failed"
  26656. })
  26657. },
  26658. _buildModel: function(e) {
  26659. e = l.normalizeModeldata(e, s);
  26660. var t = new u(this.options,e);
  26661. return this.options.autoload ? t.load(!0) : $.when(t)
  26662. }
  26663. }
  26664. }
  26665. ).call(this, "/js/showcase.js")
  26666. }
  26667. , {
  26668. "./cameras/DollhouseCamera": 5,
  26669. "./cameras/FloorplanCamera": 6,
  26670. "./cameras/PanoramaCamera": 7,
  26671. "./controls/DollhouseControls": 10,
  26672. "./controls/FloorplanControls": 11,
  26673. "./controls/PanoramaControls": 13,
  26674. "./model/Model": 139,
  26675. "./objects/Chunk": 144,
  26676. "./objects/Floor": 146,
  26677. "./objects/Panorama": 148,
  26678. "./objects/Reticule": 149,
  26679. "./objects/Skybox": 152,
  26680. "./settings": 166,
  26681. "./shaders": 167,
  26682. "./util/ajax": 181,
  26683. "./util/logger": 189,
  26684. "./util/math": 190,
  26685. "./util/showcase": 193,
  26686. "./util/transitions": 195,
  26687. three: 217,
  26688. url: 208
  26689. }],
  26690. 169: [function(e, t, i) {
  26691. "use strict";
  26692. function n() {
  26693. var e = {
  26694. renderTarget: null,
  26695. inUse: !1,
  26696. size: -1,
  26697. pano: null
  26698. };
  26699. return e
  26700. }
  26701. function r(e) {
  26702. M.push(e)
  26703. }
  26704. function o(e) {
  26705. var t = n();
  26706. return t.inUse = !0,
  26707. t.size = e,
  26708. r(t),
  26709. t
  26710. }
  26711. function a(e) {
  26712. for (var t = 0; t < M.length; t++) {
  26713. var i = M[t];
  26714. if (!i.inUse && i.size === e)
  26715. return i.inUse = !0,
  26716. i
  26717. }
  26718. return null
  26719. }
  26720. function s(e) {
  26721. for (var t = 0; t < M.length; t++) {
  26722. var i = M[t];
  26723. if (i.renderTarget === e)
  26724. return i.inUse = !1,
  26725. !0
  26726. }
  26727. return !1
  26728. }
  26729. function l() {
  26730. this.tileDirectory = {},
  26731. this.activeRenderTargetDescriptors = {},
  26732. this.activePanos = [],
  26733. this.panoLODDescriptors = {},
  26734. this.panoDescriptors = {},
  26735. this.tileTrees = {},
  26736. this.sceneRenderer = null,
  26737. this.tileDownloader = null,
  26738. this.forceQueue = [],
  26739. this.uploadQueues = {},
  26740. this.uploadInterval = null,
  26741. this.uploadIntervalCancelled = !1,
  26742. this.usingTileOverlay = !1,
  26743. this.overlayTilesLoaded = !1,
  26744. this.overlayTileBase = null,
  26745. this.overlayTilesBasic = {},
  26746. this.overlayTilesEnhanced = {},
  26747. this.zoomRenderTarget = null,
  26748. this.zoomPano = null,
  26749. this.zoomingActive = !1,
  26750. this.zoomPanoId = null,
  26751. this.zoomPanoRenderingDisabled = !1,
  26752. this.direction = new h.Vector3,
  26753. this.initTime = -1,
  26754. this.maxBaseUploadsPerFrame = x,
  26755. this.maxNonBaseUploadsPerFrame = T
  26756. }
  26757. function c() {
  26758. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  26759. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26760. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26761. }
  26762. var h = e("three")
  26763. , u = e("../exception/BasicException")
  26764. , d = e("../settings")
  26765. , p = e("../enum/PanoSizeClass")
  26766. , f = (e("../objects/Panorama"),
  26767. e("../enum/PanoRendererEvents"))
  26768. , g = e("../enum/SceneRendererEvents")
  26769. , m = e("../enum/TileDownloaderEvents")
  26770. , v = e("../enum/Vectors")
  26771. , A = (e("../enum/GLCubeFaces"),
  26772. e("../objects/Panorama"),
  26773. e("./TileTree"))
  26774. , y = (e("./TileDownloader"),
  26775. e("./TilePrioritizer"))
  26776. , C = e("./TileUtils")
  26777. , p = e("../enum/PanoSizeClass")
  26778. , I = (e("../util/browser"),
  26779. e("../util/panorama"))
  26780. , E = e("events").EventEmitter
  26781. , b = !1
  26782. , w = d.tiling.uploadIntervalDelay
  26783. , _ = d.tiling.initialIntervalDelay
  26784. , T = d.tiling.maxNonBaseUploadsPerFrame
  26785. , x = d.tiling.maxBaseUploadsPerFrame
  26786. , S = {
  26787. Base: 0,
  26788. Remaining: 1
  26789. }
  26790. , M = [];
  26791. l.prototype = Object.create(E.prototype),
  26792. l.prototype.init = function(e, t, i) {
  26793. this.sceneRenderer = e,
  26794. this.tileDownloader = t,
  26795. this.qualityManager = i,
  26796. this.bindEvents(),
  26797. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  26798. this.initTime = performance.now()
  26799. }
  26800. ,
  26801. l.prototype.getActivePanoTextures = function(e) {
  26802. e = e || [];
  26803. for (var t = 0; t < M.length; t++) {
  26804. var i = M[t];
  26805. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  26806. }
  26807. }
  26808. ,
  26809. l.prototype.hasQueuedTiles = function() {
  26810. var e = this.peekNextFromUploadQueue();
  26811. return null !== e && void 0 !== e
  26812. }
  26813. ,
  26814. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  26815. return this.activeRenderTargetDescriptors[e]
  26816. }
  26817. ,
  26818. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  26819. this.activeRenderTargetDescriptors[e] = t
  26820. }
  26821. ,
  26822. l.prototype.loadOverlayTiles = function() {
  26823. if (0 !== d.tiling.overlayStyle) {
  26824. var e = 0
  26825. , t = function(t, n, r) {
  26826. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  26827. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  26828. e++,
  26829. e === i.length && (this.overlayTilesLoaded = !0)
  26830. }
  26831. .bind(this)
  26832. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  26833. i.forEach(function(e) {
  26834. this.tileDownloader.loadImage(e[0], 0, e[1])
  26835. }
  26836. .bind(this)),
  26837. this.usingTileOverlay = !0
  26838. } else
  26839. this.usingTileOverlay = !1
  26840. }
  26841. ,
  26842. l.prototype.bindEvents = function() {
  26843. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  26844. }
  26845. ,
  26846. l.prototype.setupZoomRenderTarget = function() {
  26847. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  26848. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  26849. return;
  26850. var e = this.zoomRenderTarget;
  26851. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  26852. e) {
  26853. var t = e.width
  26854. , i = this.zoomRenderTarget.width;
  26855. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  26856. e.texture.dispose(),
  26857. e.texture.loaded = !1,
  26858. e.texture.version = 0,
  26859. this.sceneRenderer.deallocateCubeTexture(e.texture),
  26860. e.texture = null
  26861. }
  26862. this.zoomPanoRenderingDisabled = !1
  26863. } else
  26864. this.zoomPanoRenderingDisabled = !0
  26865. }
  26866. ,
  26867. l.prototype.enableUltraHighQualityMode = function(e) {
  26868. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  26869. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  26870. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  26871. t && (this.qualityManager.enableUltraHighQualityMode(),
  26872. this.setupZoomRenderTarget(),
  26873. e())
  26874. }
  26875. .bind(this))
  26876. }
  26877. }
  26878. ,
  26879. l.prototype.activateTiledPano = function(e, t, i) {
  26880. i && this.clearAllQueuedUploads();
  26881. for (var n = 0; n < C.FACES_PER_PANO; n++)
  26882. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  26883. this.linkAllTilesAndNodes(e);
  26884. var r = this.getActiveRenderTargetDescriptor(e.id)
  26885. , l = t;
  26886. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  26887. !r || l !== r.size) {
  26888. if (r && s(r.renderTarget),
  26889. r = a(l),
  26890. !r) {
  26891. var c = this.initTiledPano(l, !1);
  26892. r = o(c.width),
  26893. r.renderTarget = c
  26894. }
  26895. r.pano = e,
  26896. this.resetPanoDescriptor(e.id),
  26897. this.resetPanoLODDescriptors(e.id),
  26898. this.resetRenderStatus(e.id, !0, !0)
  26899. }
  26900. this.setActiveRenderTargetDescriptor(e.id, r);
  26901. var h = i ? 0 : 1;
  26902. return this.updateActivePanos(e, h),
  26903. r.renderTarget
  26904. }
  26905. ,
  26906. l.prototype.deactivateTiledPano = function(e) {
  26907. var t = this.getActiveRenderTargetDescriptor(e.id);
  26908. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  26909. this.setActiveRenderTargetDescriptor(e.id, null);
  26910. var i = this.getUploadQueueForPano(e.id);
  26911. this.clearUploadQueue(i),
  26912. this.updateActivePanos()
  26913. }
  26914. ,
  26915. l.prototype.updateActivePanos = function() {
  26916. var e = [];
  26917. return function(t, i) {
  26918. e.length = 0;
  26919. for (var n = 0; n < this.activePanos.length; n++) {
  26920. t && e.length === i && e.push(t);
  26921. var r = this.activePanos[n]
  26922. , o = this.getActiveRenderTargetDescriptor(r.id);
  26923. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  26924. }
  26925. t && i >= e.length && e.push(t),
  26926. this.activePanos.length = 0,
  26927. this.activePanos.push.apply(this.activePanos, e)
  26928. }
  26929. }(),
  26930. l.prototype.getActivePanoCount = function() {
  26931. return this.activePanos.length
  26932. }
  26933. ,
  26934. l.prototype.resetRenderStatus = function(e, t, i, n) {
  26935. var r = null;
  26936. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  26937. for (var o = function(e, n, r, o) {
  26938. i && (n.tile.zoomUploaded = !1),
  26939. t && (n.tile.uploaded = !1)
  26940. }, a = 0; a < C.FACES_PER_PANO; a++) {
  26941. var s = this.getTileTree(e, a);
  26942. s.breadthFirst({
  26943. callback: o.bind(this, a),
  26944. minLevel: r
  26945. })
  26946. }
  26947. }
  26948. ,
  26949. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26950. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26951. t.tile.zoomUploaded = t.tile.uploaded,
  26952. t.zoomCovered = t.covered
  26953. }, n = 0; n < C.FACES_PER_PANO; n++) {
  26954. var r = this.getTileTree(e, n);
  26955. r.breadthFirst({
  26956. callback: i.bind(this, n),
  26957. maxLevel: t
  26958. })
  26959. }
  26960. }
  26961. ,
  26962. l.prototype.renderPanoTiles = function() {
  26963. var e = [];
  26964. return function(t, i, n, r) {
  26965. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26966. i = i || this.direction || v.FORWARD;
  26967. var o = this.getActiveRenderTargetDescriptor(t);
  26968. if (!this.isRenderTargetDescriptorValid(o))
  26969. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26970. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  26971. var s = this.getTileTree(t, a);
  26972. e.length = 0,
  26973. s.breadthFirst({
  26974. saveVisited: e
  26975. });
  26976. for (var l = 0; l < e.length; l++) {
  26977. var c = e[l];
  26978. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  26979. }
  26980. }
  26981. this.updateDirection(i)
  26982. }
  26983. }(),
  26984. l.prototype.isRenderTargetDescriptorValid = function(e) {
  26985. return e && e.renderTarget
  26986. }
  26987. ,
  26988. l.prototype.isPanoActive = function(e) {
  26989. var t = this.getActiveRenderTargetDescriptor(e);
  26990. return this.isRenderTargetDescriptorValid(t)
  26991. }
  26992. ,
  26993. l.prototype.isPanoZoomed = function(e) {
  26994. return this.zoomingActive && this.zoomPanoId === e
  26995. }
  26996. ,
  26997. l.prototype.initTileTree = function(e, t, i) {
  26998. var n = this.tileTrees[e];
  26999. n || (n = [],
  27000. this.tileTrees[e] = n);
  27001. var r = n[t];
  27002. if (!r) {
  27003. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27004. r = new A(C.TILE_SIZE,o),
  27005. n[t] = r
  27006. }
  27007. }
  27008. ,
  27009. l.prototype.getTileTree = function(e, t) {
  27010. var i = this.tileTrees[e];
  27011. if (!i)
  27012. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27013. var n = i[t];
  27014. if (!n)
  27015. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27016. return n
  27017. }
  27018. ,
  27019. l.prototype.initTiledPano = function(e, t) {
  27020. var i = this.sceneRenderer.renderer
  27021. , n = (i.context,
  27022. new h.WebGLRenderTargetCube(e,e,{
  27023. stencilBuffer: !1
  27024. }))
  27025. , r = new h.CubeTexture([]);
  27026. n.texture = r,
  27027. r.image = [null, null, null, null, null, null],
  27028. r.flipY = !0,
  27029. t ? (r.generateMipmaps = !0,
  27030. r.magFilter = h.LinearFilter,
  27031. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27032. r.magFilter = h.LinearFilter,
  27033. r.minFilter = h.LinearFilter),
  27034. r.format = h.RGBAFormat,
  27035. i.setRenderTarget(n),
  27036. i.setRenderTarget(null);
  27037. var o = i.properties.get(r);
  27038. return o.__image__webglTextureCube = o.__webglTexture,
  27039. n
  27040. }
  27041. ,
  27042. l.prototype.getUploadQueueForPano = function(e) {
  27043. var t = this.uploadQueues[e];
  27044. return t || (t = [],
  27045. this.uploadQueues[e] = t),
  27046. t
  27047. }
  27048. ,
  27049. l.prototype.isTileUploaded = function(e) {
  27050. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27051. }
  27052. ,
  27053. l.prototype.setUploaded = function(e, t) {
  27054. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27055. }
  27056. ,
  27057. l.prototype.queueTileUpload = function(e, t, i) {
  27058. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27059. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27060. var r = this.getUploadQueueForPano(e.panoId);
  27061. 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),
  27062. e.uploadQueued = !0,
  27063. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27064. }
  27065. }
  27066. ,
  27067. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27068. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27069. }
  27070. ,
  27071. l.prototype.getTopUploadQueue = function() {
  27072. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27073. for (var n = 0; n < this.activePanos.length; n++)
  27074. if (e = this.activePanos[n],
  27075. t = this.getUploadQueueForPano(e.id),
  27076. t.length > 0)
  27077. switch (i) {
  27078. case S.Base:
  27079. if (0 === t[0].level)
  27080. return t;
  27081. break;
  27082. case S.Remaining:
  27083. return t
  27084. }
  27085. return null
  27086. }
  27087. ,
  27088. l.prototype.getNextFromUploadQueue = function() {
  27089. var e = function(e) {
  27090. var t = e.shift();
  27091. return t.uploadQueued = !1,
  27092. t
  27093. };
  27094. return function() {
  27095. if (this.forceQueue.length > 0)
  27096. return e(this.forceQueue);
  27097. var t = this.getTopUploadQueue();
  27098. return t && t.length > 0 ? e(t) : null
  27099. }
  27100. }(),
  27101. l.prototype.peekNextFromUploadQueue = function() {
  27102. if (this.forceQueue.length > 0)
  27103. return this.forceQueue[0];
  27104. var e = this.getTopUploadQueue();
  27105. return e && e.length > 0 ? e[0] : null
  27106. }
  27107. ,
  27108. l.prototype.clearAllQueuedUploads = function() {
  27109. this.clearAllUploadQueues(null, 0)
  27110. }
  27111. ,
  27112. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27113. this.clearAllUploadQueues(e, 0)
  27114. }
  27115. ,
  27116. l.prototype.clearAllUploadQueues = function(e, t) {
  27117. if (e)
  27118. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27119. this.clearUploadQueue(this.forceQueue, t, e);
  27120. else {
  27121. for (var i = 0; i < this.activePanos.length; i++) {
  27122. var n = this.activePanos[i];
  27123. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27124. }
  27125. this.clearUploadQueue(this.forceQueue, t)
  27126. }
  27127. }
  27128. ,
  27129. l.prototype.clearUploadQueue = function(e, t, i) {
  27130. void 0 !== t && null !== t || (t = 0);
  27131. for (var n = 0; n < e.length; ) {
  27132. var r = e[n];
  27133. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27134. e.splice(n, 1)) : n++
  27135. }
  27136. }
  27137. ,
  27138. l.prototype.refreshUploadInterval = function() {
  27139. var e = null;
  27140. return function(t) {
  27141. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27142. null !== t && void 0 !== t || (t = w),
  27143. b || (t = _),
  27144. this.uploadInterval = window.setTimeout(e, t),
  27145. this.uploadIntervalDelay = t)
  27146. }
  27147. }(),
  27148. l.prototype.update = function() {
  27149. var e = performance.now()
  27150. , t = 0;
  27151. return function() {
  27152. this.uploadIntervalCancelled = !0,
  27153. window.clearTimeout(this.uploadInterval),
  27154. this.uploadInterval = null;
  27155. var i = performance.now() - e;
  27156. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27157. e = performance.now()),
  27158. t++
  27159. }
  27160. }(),
  27161. l.prototype.updateUploadQueue = function(e, t) {
  27162. e || (e = 1);
  27163. for (var i = 0, n = 0; ; ) {
  27164. if (n >= t || i >= e)
  27165. break;
  27166. var r = this.getNextFromUploadQueue();
  27167. if (!r)
  27168. break;
  27169. if (0 !== r.level ? i++ : n++,
  27170. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27171. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27172. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27173. }
  27174. }
  27175. }
  27176. ,
  27177. l.prototype.updateDirection = function(e) {
  27178. if (e = e || this.direction) {
  27179. this.direction = e;
  27180. for (var t = 0; t < this.activePanos.length; t++) {
  27181. var i = this.activePanos[t]
  27182. , n = this.getUploadQueueForPano(i.id);
  27183. y.sortPanoTiles(n, i, this.direction)
  27184. }
  27185. }
  27186. }
  27187. ,
  27188. l.prototype.uploadTile = function() {
  27189. var e = {}
  27190. , t = (new h.Vector4,
  27191. d.tiling.overlayStyle);
  27192. return function(i, n) {
  27193. var r = i.panoId
  27194. , o = i.image
  27195. , a = i.tileSize
  27196. , s = i.panoSize
  27197. , l = i.tileIndex
  27198. , c = (i.faceTileIndex,
  27199. i.totalTiles)
  27200. , u = (i.face,
  27201. i.tileX)
  27202. , d = i.tileY
  27203. , p = !0
  27204. , g = !1
  27205. , m = (this.getPanoDescriptor(r),
  27206. this.getPanoLODDescriptor(r, s))
  27207. , v = this.getActiveRenderTargetDescriptor(r)
  27208. , A = v.renderTarget
  27209. , y = v.size;
  27210. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27211. y = this.qualityManager.getMaxZoomPanoSize()),
  27212. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27213. g = !1),
  27214. n || (this.anyUploaded(i.node) && (p = !1,
  27215. g = !0),
  27216. this.isTileUploaded(i) && (p = !1,
  27217. g = !1)),
  27218. p) {
  27219. var C = u * a
  27220. , I = d * a
  27221. , E = a / s * y
  27222. , b = C / s * y
  27223. , w = I / s * y;
  27224. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27225. var _ = e[a];
  27226. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  27227. 1 === t || 2 === t) {
  27228. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27229. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27230. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27231. } else
  27232. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27233. m.uploadCount++,
  27234. this.emit(f.TileRenderSuccess, r, s, l, c),
  27235. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27236. this.setUploaded(i, !0),
  27237. this.addCoverageForNode(i.node)
  27238. } else
  27239. this.setUploaded(i, !1);
  27240. return i.uploadAttempted || (m.uploadAttempts++,
  27241. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27242. i.uploadAttempted = !0,
  27243. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27244. g
  27245. }
  27246. }(),
  27247. l.prototype.linkTileAndNode = function(e, t) {
  27248. t.tile = e,
  27249. e.node = t
  27250. }
  27251. ,
  27252. l.prototype.linkAllTilesAndNodes = function(e) {
  27253. for (var t = function(t, i, n, r, o) {
  27254. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27255. this.linkTileAndNode(a, n)
  27256. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27257. var n = this.getTileTree(e.id, i);
  27258. n.breadthFirst({
  27259. callback: t.bind(this, n, i)
  27260. })
  27261. }
  27262. }
  27263. ,
  27264. l.prototype.anyUploaded = function(e) {
  27265. if (!e)
  27266. return !1;
  27267. if (e.tile && this.isTileUploaded(e.tile))
  27268. return !0;
  27269. if (e.children)
  27270. for (var t = 0; t < e.children.length; t++) {
  27271. var i = e.children[t];
  27272. if (this.anyUploaded(i))
  27273. return !0
  27274. }
  27275. return !1
  27276. }
  27277. ,
  27278. l.prototype.setNodeCovered = function(e, t) {
  27279. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27280. }
  27281. ,
  27282. l.prototype.isNodeCovered = function(e) {
  27283. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27284. }
  27285. ,
  27286. l.prototype.addCoverageForNode = function(e) {
  27287. if (this.setNodeCovered(e, !0),
  27288. e.parent && e.covered) {
  27289. var t = e.parent;
  27290. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27291. }
  27292. }
  27293. ,
  27294. l.prototype.calcFullCoverage = function(e) {
  27295. var t = !1;
  27296. if (e.children)
  27297. for (var i = 0; i < e.children.length; i++) {
  27298. var n = e.children[i];
  27299. t = t || this.calcFullCoverage(n)
  27300. }
  27301. e.covered = e.tile.uploaded || t
  27302. }
  27303. ,
  27304. l.prototype.nodeSubcovered = function(e) {
  27305. if (!e.children)
  27306. return !1;
  27307. for (var t = 0; t < e.children.length; t++)
  27308. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27309. return !1;
  27310. return !0
  27311. }
  27312. ,
  27313. l.prototype.resetPanoDescriptor = function(e) {
  27314. this.getPanoDescriptor(e)
  27315. }
  27316. ,
  27317. l.prototype.getPanoDescriptor = function(e) {
  27318. var t = this.panoDescriptors[e];
  27319. return t || (t = {},
  27320. this.panoDescriptors[e] = t),
  27321. t
  27322. }
  27323. ,
  27324. l.prototype.resetPanoLODDescriptors = function(e) {
  27325. var t = this.getPanoLODDescriptors(e);
  27326. for (var i in t)
  27327. if (t.hasOwnProperty(i)) {
  27328. var n = t[i];
  27329. n.uploadCount = 0,
  27330. n.uploadAttempts = 0
  27331. }
  27332. }
  27333. ,
  27334. l.prototype.getPanoLODDescriptor = function(e, t) {
  27335. var i = this.getPanoLODDescriptors(e)
  27336. , n = i[t];
  27337. return n || (n = {
  27338. uploadCount: 0,
  27339. uploadAttempts: 0
  27340. },
  27341. i[t] = n),
  27342. n
  27343. }
  27344. ,
  27345. l.prototype.getPanoLODDescriptors = function(e) {
  27346. var t = this.panoLODDescriptors[e];
  27347. return t || (t = {},
  27348. this.panoLODDescriptors[e] = t),
  27349. t
  27350. }
  27351. ,
  27352. l.prototype.onTileDownloaded = function(e) {
  27353. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27354. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27355. if (i.downloaded = !0,
  27356. i.image = e.image,
  27357. i.panoSize = e.panoSize,
  27358. i.tileX = e.tileX,
  27359. i.tileY = e.tileY,
  27360. i.totalTiles = e.totalTiles,
  27361. i.tileIndex = e.tileIndex,
  27362. i.faceTileIndex = e.faceTileIndex,
  27363. i.face = e.face,
  27364. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27365. i.panoId = e.panoId,
  27366. i.tileSize = e.tileSize,
  27367. i.direction = (new h.Vector3).copy(e.direction),
  27368. i.node = null,
  27369. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27370. this.isPanoActive(i.panoId)) {
  27371. var n = this.getTileTree(i.panoId, i.face)
  27372. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27373. this.linkTileAndNode(i, r),
  27374. this.queueTileUpload(i, !0)
  27375. }
  27376. }
  27377. ,
  27378. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27379. var r = this.tileDirectory[e];
  27380. r || (r = {},
  27381. this.tileDirectory[e] = r);
  27382. var o = 16384 * t + 1024 * i + n
  27383. , a = r[o];
  27384. return a || (a = {
  27385. downloaded: !1,
  27386. uploaded: !1,
  27387. zoomUploaded: !1
  27388. },
  27389. r[o] = a),
  27390. a._key = e + ":" + t + ":" + i + ":" + n,
  27391. a._tileKey = o,
  27392. a
  27393. }
  27394. ,
  27395. l.prototype.setZoomingActive = function(e, t, i) {
  27396. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27397. this.zoomPanoId = t.id,
  27398. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27399. }
  27400. ,
  27401. l.prototype.updateZoomedPanoFromBase = function(e) {
  27402. if (!this.zoomPanoRenderingDisabled) {
  27403. var t = this.getActiveRenderTargetDescriptor(e.id);
  27404. if (t && t.renderTarget) {
  27405. var i = this.qualityManager.getMaxZoomPanoSize()
  27406. , n = t.renderTarget
  27407. , r = t.size;
  27408. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27409. this.copyBaseRenderStatusToZoomed(e.id)
  27410. }
  27411. }
  27412. }
  27413. ,
  27414. t.exports = l
  27415. }
  27416. , {
  27417. "../enum/GLCubeFaces": 25,
  27418. "../enum/PanoRendererEvents": 35,
  27419. "../enum/PanoSizeClass": 36,
  27420. "../enum/SceneRendererEvents": 43,
  27421. "../enum/TileDownloaderEvents": 45,
  27422. "../enum/Vectors": 50,
  27423. "../exception/BasicException": 55,
  27424. "../objects/Panorama": 148,
  27425. "../settings": 166,
  27426. "../util/browser": 182,
  27427. "../util/panorama": 191,
  27428. "./TileDownloader": 171,
  27429. "./TilePrioritizer": 172,
  27430. "./TileTree": 173,
  27431. "./TileUtils": 174,
  27432. events: 202,
  27433. three: 217
  27434. }],
  27435. 170: [function(e, t, i) {
  27436. "use strict";
  27437. function n(e, t, i) {
  27438. this.maxNavPanoSize = -1,
  27439. this.maxZoomPanoSize = -1,
  27440. this.devicePixelDensity = e,
  27441. this.deviceScreenSize = t,
  27442. this.clientBandwidth = i,
  27443. this.panoSizeClassMap = {},
  27444. this.useHighResolutionPanos = !0,
  27445. this.useUltraHighResolutionPanos = !1,
  27446. this.modelHasUltraHighPanos = !1
  27447. }
  27448. var r = e("../enum/PanoSizeClass")
  27449. , o = e("../settings")
  27450. , a = e("../util/browser")
  27451. , s = e("../constants")
  27452. , l = e("../util/showcase")
  27453. , c = e("../enum/ModelManagerEvents");
  27454. n.prototype.init = function(e) {
  27455. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27456. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27457. this.highSize = this.getPanoSize(r.HIGH),
  27458. this.standardSize = this.getPanoSize(r.STANDARD),
  27459. this.baseSize = this.getPanoSize(r.BASE),
  27460. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27461. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27462. this.updateMaximums(),
  27463. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27464. }
  27465. ,
  27466. n.prototype.updateFromModel = function(e) {
  27467. this.updateHighResolutionSettings(e),
  27468. this.updateUltraHighResolutionSettings(e)
  27469. }
  27470. ,
  27471. n.prototype.updateHighResolutionSettings = function(e) {
  27472. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27473. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27474. //this.useHighResolutionPanos = !0;
  27475. //----------------------e n d -----------------------------------------------------------------
  27476. this.updateMaximums()
  27477. }
  27478. ,
  27479. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27480. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27481. this.updateMaximums()
  27482. }
  27483. ,
  27484. n.prototype.enableUltraHighQualityMode = function() {
  27485. this.modelHasUltraHighPanos = !0,
  27486. this.updateUltraHighResolutionSettings(null)
  27487. }
  27488. ,
  27489. n.prototype.ultraHighQualityModeEnabled = function() {
  27490. return this.modelHasUltraHighPanos
  27491. }
  27492. ,
  27493. n.prototype.onModelChanged = function(e) {
  27494. this.updateFromModel(e.model),
  27495. this.updateMaximums()
  27496. }
  27497. ,
  27498. n.prototype.updateMaximums = function() {
  27499. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  27500. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  27501. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27502. }
  27503. ,
  27504. n.prototype.buildPanoSizeClassMap = function() {
  27505. this.panoSizeClassMap[r.BASE] = 512,
  27506. this.panoSizeClassMap[r.STANDARD] = 1024,
  27507. this.panoSizeClassMap[r.HIGH] = 2048,
  27508. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  27509. }
  27510. ,
  27511. n.prototype.getPanoSize = function(e) {
  27512. return this.panoSizeClassMap[e]
  27513. }
  27514. ,
  27515. n.prototype.getMaxPossiblePanoSize = function() {
  27516. return this.getPanoSize(r.ULTRAHIGH)
  27517. }
  27518. ,
  27519. n.prototype.getMaxPanoSize = function() {
  27520. return this.maxZoomPanoSize
  27521. }
  27522. ,
  27523. n.prototype.getMaxNavPanoSize = function() {
  27524. return this.maxNavPanoSize
  27525. }
  27526. ,
  27527. n.prototype.getMaxZoomPanoSize = function() {
  27528. return this.maxZoomPanoSize
  27529. }
  27530. ,
  27531. n.prototype.detectMaxNavPanoSizeClass = function() {
  27532. if(settings.mobileNavHigh)return r.HIGH //改
  27533. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27534. }
  27535. ,
  27536. n.prototype.detectMaxNavPanoSize = function() {
  27537. var e = this.detectMaxNavPanoSizeClass();
  27538. return this.getPanoSize(e)
  27539. }
  27540. ,
  27541. n.prototype.detectMaxZoomPanoSize = function() {
  27542. 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)
  27543. }
  27544. ,
  27545. t.exports = n
  27546. }
  27547. , {
  27548. "../constants": 8,
  27549. "../enum/ModelManagerEvents": 33,
  27550. "../enum/PanoSizeClass": 36,
  27551. "../settings": 166,
  27552. "../util/browser": 182,
  27553. "../util/showcase": 193
  27554. }],
  27555. 171: [function(e, t, i) {
  27556. (function(i) {
  27557. "use strict";
  27558. function n(e) {
  27559. this.panos = null,
  27560. this.retryMinimumTime = 1e4,
  27561. this.urls = null,
  27562. this.panoLoadCallbacks = {},
  27563. this.downloadDescriptors = {},
  27564. this.priorityQueue = [],
  27565. this.forceQueue = [],
  27566. this.activeDownloads = [],
  27567. this.qualityManager = null,
  27568. this.tilePrioritizer = null,
  27569. this.refreshInterval = null,
  27570. this.processPriorityQueue = !1,
  27571. this.concurrentDownloads = e.concurrentDownloads || 1,
  27572. this.downloadTestResults = {}
  27573. }
  27574. var r = e("three")
  27575. , o = (e("../enum/Viewmode"),
  27576. e("../settings"))
  27577. , a = (e("../objects/Panorama"),
  27578. e("../util/logger"))
  27579. , s = (e("../enum/Vectors"),
  27580. e("../enum/PanoSizeClass"),
  27581. e("../enum/TileDownloaderEvents"))
  27582. , l = e("./TilePrioritizer")
  27583. , c = e("./TileUtils")
  27584. , h = (e("../enum/GLCubeFaces"),
  27585. e("../enum/DownloadStatus"))
  27586. , u = e("../util/panorama")
  27587. , d = e("../util/ajax")
  27588. , p = e("../ab")
  27589. , f = e("events").EventEmitter
  27590. , g = (new a(i),
  27591. Object.freeze({
  27592. Testing: 1,
  27593. Success: 2,
  27594. Fail: 3
  27595. }));
  27596. n.prototype = Object.create(f.prototype),
  27597. n.IDLE_REFRESH_DELAY = 500,
  27598. n.ACTIVE_REFRESH_DELAY = 16,
  27599. n.DOWNLOAD_RETRIES = 4,
  27600. n.prototype.init = function(e) {
  27601. this.qualityManager = e
  27602. }
  27603. ,
  27604. n.prototype.setUrls = function(e) {
  27605. this.urls = e
  27606. }
  27607. ,
  27608. n.prototype.setPanoData = function(e, t, i) {
  27609. this.panos = e,
  27610. this.imagePanos = t,
  27611. this.panoGroupId = i
  27612. }
  27613. ,
  27614. n.prototype.start = function() {
  27615. this.refreshUpdateInterval(0)
  27616. }
  27617. ,
  27618. n.prototype.stop = function() {
  27619. window.cancel(this.refreshInterval)
  27620. }
  27621. ,
  27622. n.prototype.refreshUpdateInterval = function(e) {
  27623. e || (e = 0),
  27624. this.refreshInterval = window.setTimeout(function() {
  27625. var e = this.update();
  27626. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27627. }
  27628. .bind(this), e)
  27629. }
  27630. ,
  27631. n.prototype.update = function() {
  27632. var e = this.forceQueue.length > 0;
  27633. return this.processQueueForDownloading(this.forceQueue),
  27634. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  27635. this.priorityQueue.length > 0 && (e = !0),
  27636. this.processQueueForDownloading(this.priorityQueue)),
  27637. e
  27638. }
  27639. ,
  27640. n.prototype.forceQueueTilesForPano = function() {
  27641. var e = []
  27642. , t = [];
  27643. return function(i, n, r, o, a, s) {
  27644. e.length = 0;
  27645. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27646. var p = u[d];
  27647. p.status !== h.None && p.status !== h.Queued || e.push(p)
  27648. }
  27649. if (r && e.length > 0) {
  27650. l.sortPanoTiles(e, i, r),
  27651. t.length = 0,
  27652. c.matchingTilesInDirection(i, n, r, o, a, t);
  27653. for (var f = 0, g = function(e) {
  27654. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27655. }; f < e.length; ) {
  27656. var m = e[f]
  27657. , v = t.findIndex(g);
  27658. v < 0 ? e.splice(f, 1) : f++
  27659. }
  27660. }
  27661. for (var A = 0; A < e.length; A++)
  27662. this.forceQueue.push(e[A]);
  27663. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  27664. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  27665. s && this.processQueueForDownloading(this.forceQueue, !0)
  27666. }
  27667. }(),
  27668. n.prototype.clearForceQueue = function() {
  27669. this.clearQueue(this.forceQueue)
  27670. }
  27671. ,
  27672. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  27673. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  27674. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27675. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27676. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27677. }
  27678. ,
  27679. n.prototype.clearQueue = function(e) {
  27680. this.setStatusForAllDescriptors(e, h.None),
  27681. e.length = 0
  27682. }
  27683. ,
  27684. n.prototype.clearFromQueue = function(e, t, i) {
  27685. for (var n = 0; n < e.length; n++) {
  27686. var r = e[n];
  27687. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  27688. }
  27689. }
  27690. ,
  27691. n.prototype.setStatusForAllDescriptors = function(e, t) {
  27692. for (var i = 0; i < e.length; i++) {
  27693. var n = e[i];
  27694. n && (n.status = t)
  27695. }
  27696. }
  27697. ,
  27698. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  27699. for (var i = 0; i < e.length; i++) {
  27700. var n = e[i];
  27701. n && (n.status !== t ? n.status = t : e[i] = null)
  27702. }
  27703. }
  27704. ,
  27705. n.prototype.getTileDownloadDescriptors = function(e, t) {
  27706. var i = this.getAllTileDownloadDescriptorsForPano(e)
  27707. , n = i[t];
  27708. return n || (n = this.buildDownloadDescriptorArray(t),
  27709. i[t] = n,
  27710. this.initTileDownloadDescriptors(n, e, t)),
  27711. n
  27712. }
  27713. ,
  27714. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  27715. var t = this.downloadDescriptors[e.id];
  27716. return t || (t = {},
  27717. this.downloadDescriptors[e.id] = t),
  27718. t
  27719. }
  27720. ,
  27721. n.prototype.processQueueForDownloading = function(e, t) {
  27722. if (this.cleanupActiveDownloads(),
  27723. this.activeDownloads.length < this.concurrentDownloads || t)
  27724. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27725. var o = e.shift();
  27726. o && (this.startDownload(o),
  27727. n++)
  27728. }
  27729. }
  27730. ,
  27731. n.prototype.testDownload = function(e, t, i) {
  27732. var n = this.downloadTestResults[e];
  27733. if (n)
  27734. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  27735. this.downloadTestResults[e] = g.Testing;
  27736. var r = this.panos.list[0]
  27737. , o = this.getTileUrl(r.id, e, t, 0)
  27738. , a = function(t) {
  27739. this.downloadTestResults[e] = g.Success,
  27740. i(!0)
  27741. }
  27742. .bind(this)
  27743. , s = function() {
  27744. this.downloadTestResults[e] = g.Fail,
  27745. i(!1)
  27746. }
  27747. .bind(this);
  27748. this.loadImage(o, 0, a, s)
  27749. }
  27750. ,
  27751. n.prototype.startDownload = function(e) {
  27752. e.status = h.Downloading;
  27753. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  27754. this.activeDownloads.push(e),
  27755. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  27756. }
  27757. ,
  27758. n.prototype.downloadFailed = function(e, t) {}
  27759. ,
  27760. n.prototype.downloadComplete = function(e, t) {
  27761. if (e.panoGroupId === this.panoGroupId) {
  27762. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  27763. e.status = h.Downloaded,
  27764. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  27765. var n = {
  27766. panoId: e.pano.id,
  27767. image: t,
  27768. tileSize: e.tileSize,
  27769. panoSize: e.panoSize,
  27770. tileIndex: e.tileIndex,
  27771. faceTileIndex: e.faceTileIndex,
  27772. totalTiles: e.totalTiles,
  27773. face: e.face,
  27774. tileX: e.tileX,
  27775. tileY: e.tileY,
  27776. direction: e.direction
  27777. };
  27778. e.image = t,
  27779. this.emit(s.TileDownloadSuccess, n),
  27780. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  27781. panoId: e.pano.id,
  27782. tileSize: e.tileSize,
  27783. panoSize: e.panoSize
  27784. },
  27785. this.emit(s.PanoDownloadComplete, n),
  27786. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  27787. }
  27788. }
  27789. ,
  27790. n.prototype.cleanupActiveDownloads = function() {
  27791. var e = [];
  27792. return function() {
  27793. e.length = 0;
  27794. for (var t = 0; t < this.activeDownloads.length; t++) {
  27795. var i = this.activeDownloads[t];
  27796. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  27797. }
  27798. this.activeDownloads.length = 0,
  27799. this.activeDownloads.push.apply(this.activeDownloads, e)
  27800. }
  27801. }(),
  27802. n.prototype.isPanoDownloaded = function(e, t) {
  27803. var i = this.getTileDownloadDescriptors(e, t);
  27804. if (i.length <= 0)
  27805. return !1;
  27806. for (var n = 0; n < i.length; n++) {
  27807. var r = i[n];
  27808. if (r.status !== h.Downloaded)
  27809. return !1
  27810. }
  27811. return !0
  27812. }
  27813. ,
  27814. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  27815. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  27816. this.panoLoadCallbacks[o] = {
  27817. onLoad: i,
  27818. onFail: n,
  27819. onProgress: r
  27820. }
  27821. }
  27822. ,
  27823. n.prototype.getPanoLoadCallbacks = function(e, t) {
  27824. var i = e.id + ":" + t;
  27825. return this.panoLoadCallbacks[i]
  27826. }
  27827. ,
  27828. n.prototype.buildDownloadDescriptorArray = function(e) {
  27829. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  27830. var r = this.buildDownloadDescriptor();
  27831. i.push(r)
  27832. }
  27833. return i
  27834. }
  27835. ,
  27836. n.prototype.buildDownloadDescriptor = function() {
  27837. var e = {
  27838. panoGroupId: null,
  27839. pano: null,
  27840. panoSize: -1,
  27841. tileSize: -1,
  27842. tileIndex: -1,
  27843. totalTiles: -1,
  27844. faceTileIndex: -1,
  27845. status: h.None,
  27846. url: null,
  27847. image: null,
  27848. direction: new r.Vector3,
  27849. face: -1,
  27850. cubeFace: -1,
  27851. tileX: -1,
  27852. tileY: -1
  27853. };
  27854. return e
  27855. }
  27856. ,
  27857. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  27858. for (var n = 0; n < e.length; n++) {
  27859. var r = e[n];
  27860. this.initTileDownloadDescriptor(r, t, i, n)
  27861. }
  27862. }
  27863. ,
  27864. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  27865. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  27866. e.face = c.getFaceForTile(i, n),
  27867. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  27868. e.panoGroupId = this.panoGroupId,
  27869. e.pano = t,
  27870. e.panoSize = i,
  27871. e.tileSize = r,
  27872. e.tileIndex = n,
  27873. e.totalTiles = c.getTileCountForSize(i),
  27874. e.status = h.None,
  27875. e.image = null,
  27876. c.getTileLocation(e.panoSize, e.tileIndex, e),
  27877. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  27878. }
  27879. ,
  27880. n.prototype.getTileUrl = function() {
  27881. var e = {
  27882. 256: "256",
  27883. 512: "512",
  27884. 1024: "1k",
  27885. 2048: "2k",
  27886. 4096: "4k"
  27887. }
  27888. , t = {
  27889. face: -1,
  27890. faceTileIndex: -1,
  27891. tileX: -1,
  27892. tileY: -1
  27893. };
  27894. return function(i, n, r, a) {
  27895. c.getTileLocation(n, a, t);
  27896. var s = Math.floor(n / r)
  27897. , l = s * s
  27898. , h = Math.floor(a / l)
  27899. , u = "";
  27900. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  27901. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  27902. return d = p.changeIfTileGenerating(d)
  27903. }
  27904. }(),
  27905. n.prototype.loadImage = function(e, t, i, n) {
  27906. d.getImage(e, t).then(function(e) {
  27907. i(e)
  27908. }).fail(n)
  27909. }
  27910. ,
  27911. t.exports = n
  27912. }
  27913. ).call(this, "/js/tile/TileDownloader.js")
  27914. }
  27915. , {
  27916. "../ab": 3,
  27917. "../enum/DownloadStatus": 24,
  27918. "../enum/GLCubeFaces": 25,
  27919. "../enum/PanoSizeClass": 36,
  27920. "../enum/TileDownloaderEvents": 45,
  27921. "../enum/Vectors": 50,
  27922. "../enum/Viewmode": 51,
  27923. "../objects/Panorama": 148,
  27924. "../settings": 166,
  27925. "../util/ajax": 181,
  27926. "../util/logger": 189,
  27927. "../util/panorama": 191,
  27928. "./TilePrioritizer": 172,
  27929. "./TileUtils": 174,
  27930. events: 202,
  27931. three: 217
  27932. }],
  27933. 172: [function(e, t, i) {
  27934. (function(i) {
  27935. "use strict";
  27936. function n(e, t, i, o, a) {
  27937. this.qualityManager = e,
  27938. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27939. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27940. this.baseSize = t,
  27941. this.standardSize = i,
  27942. this.highSize = o,
  27943. this.ultraHighSize = a,
  27944. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  27945. }
  27946. var r = e("three")
  27947. , o = (e("../enum/Viewmode"),
  27948. e("../settings"),
  27949. e("../settings"),
  27950. e("../objects/Panorama"))
  27951. , a = e("../util/logger")
  27952. , s = (e("../enum/Vectors"),
  27953. e("../enum/PanoSizeClass"),
  27954. e("../enum/ModelManagerEvents"),
  27955. e("../enum/GLCubeFaces"),
  27956. e("../enum/DownloadStatus"))
  27957. , l = (e("../util/browser"),
  27958. e("./TileUtils"))
  27959. , c = e("../util/math")
  27960. , h = (e("events").EventEmitter,
  27961. new a(i),
  27962. Object.freeze({
  27963. None: 0,
  27964. DirectionalFOV: 1
  27965. }));
  27966. n.PriorityCriteria = function(e, t, i, n, o) {
  27967. this.pano = e,
  27968. this.cameraPosition = (new r.Vector3).copy(t),
  27969. this.cameraDir = (new r.Vector3).copy(i),
  27970. this.panoSpaceDir = (new r.Vector3).copy(n),
  27971. this.upcomingPanos = o,
  27972. this.copy = function(e) {
  27973. this.pano = e.pano,
  27974. this.cameraPosition.copy(e.cameraPosition),
  27975. this.cameraDir.copy(e.cameraDir),
  27976. this.panoSpaceDir.copy(e.panoSpaceDir),
  27977. this.upcomingPanos = o
  27978. }
  27979. ,
  27980. this.zoomingActive = !1
  27981. }
  27982. ,
  27983. n.DIRECTIONAL_FOV = 180,
  27984. n.DIRECTIONAL_FOV_NARROW = 120,
  27985. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27986. n.MAX_SCORED_PANOS_TOADD = 2,
  27987. n.MAX_UPCOMING_PANOS_TOADD = 3,
  27988. n.DIRECTION_SCORE_STRICTNESS = .75,
  27989. n.appendQueue = function(e, t) {
  27990. if (e && t)
  27991. for (var i = 0; i < t.length; i++)
  27992. e.push(t[i])
  27993. }
  27994. ,
  27995. n.prototype.updateCriteria = function(e, t, i, n) {
  27996. this.priorityCriteria.pano = e,
  27997. this.priorityCriteria.cameraPosition.copy(t),
  27998. this.priorityCriteria.cameraDir.copy(i),
  27999. this.priorityCriteria.upcomingPanos = n,
  28000. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28001. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28002. }
  28003. ,
  28004. n.prototype.filterAndPrioritize = function() {
  28005. var e = []
  28006. , t = []
  28007. , i = [];
  28008. return function(r, o, a) {
  28009. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28010. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28011. var s = this.baseSize
  28012. , l = this.standardSize
  28013. , c = this.highSize
  28014. , h = this.ultraHighSize;
  28015. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28016. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28017. i.length = 0,
  28018. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28019. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28020. n.appendQueue(r, i),
  28021. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28022. i.length = 0,
  28023. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28024. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28025. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28026. n.appendQueue(r, i),
  28027. i.length = 0,
  28028. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28029. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28030. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28031. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28032. n.appendQueue(r, i),
  28033. this.queueTilesForPanos(r, e, a, s)
  28034. }
  28035. }(),
  28036. n.prototype.canDownloadSize = function(e) {
  28037. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28038. }
  28039. ,
  28040. n.prototype.populateNeighborPanos = function(e, t, i) {
  28041. i = i || [],
  28042. i.length = 0;
  28043. var n = t.getNeighbours(e);
  28044. for (var r in n)
  28045. if (n.hasOwnProperty(r)) {
  28046. var o = t.get(r);
  28047. i.push(o)
  28048. }
  28049. return i
  28050. }
  28051. ,
  28052. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28053. i = i || [],
  28054. i.length = 0;
  28055. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28056. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28057. , c = t.sortByScore(s, l);
  28058. if (c)
  28059. for (var h = 0; h < c.length && h < a; h++) {
  28060. var u = c[h].pano;
  28061. i.push(u)
  28062. }
  28063. return i
  28064. }
  28065. ,
  28066. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28067. for (var o = 0, a = 0; a < t.length; a++) {
  28068. var s = t[a]
  28069. , l = this.queueTilesForPano(e, i, s, n);
  28070. if (o += l > 0 ? 1 : 0,
  28071. r && o >= r)
  28072. break
  28073. }
  28074. return o
  28075. }
  28076. ,
  28077. n.prototype.queueTilesForPano = function() {
  28078. var e = {
  28079. filter: h.None
  28080. };
  28081. return function(t, i, n, r) {
  28082. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28083. }
  28084. }(),
  28085. n.prototype.queueTilesForPanosInDirection = function() {
  28086. var e = new r.Vector3;
  28087. return function(t, i, n, r, o, a, s, l) {
  28088. for (var h = 0, u = 0; u < n.length; u++) {
  28089. var d = n[u];
  28090. e.copy(d.position),
  28091. e.sub(o),
  28092. e.normalize();
  28093. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28094. , f = c.getFOVDotThreshold(s);
  28095. if (p >= f) {
  28096. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28097. if (h += g > 0 ? 1 : 0,
  28098. l && h >= l)
  28099. break
  28100. }
  28101. }
  28102. return h
  28103. }
  28104. }(),
  28105. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28106. for (var l = 0, c = 0; c < i.length; c++) {
  28107. var h = i[c]
  28108. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28109. if (l += u > 0 ? 1 : 0,
  28110. s && l >= s)
  28111. break
  28112. }
  28113. return l
  28114. }
  28115. ,
  28116. n.prototype.queueTilesInDirectionForPano = function() {
  28117. var e = {
  28118. filter: h.DirectionalFOV,
  28119. direction: new r.Vector3,
  28120. fov: 60
  28121. }
  28122. , t = new r.Vector3;
  28123. return function(i, n, r, o, a, s, c) {
  28124. return t.copy(s),
  28125. l.getRelativeDirection(r.quaternion, t),
  28126. e.direction.copy(t),
  28127. e.fov = c,
  28128. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28129. }
  28130. }(),
  28131. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28132. var e = [];
  28133. return function(t, i, n, r, o) {
  28134. var a = i.getTileDownloadDescriptors(n, r);
  28135. e.length = 0,
  28136. this.filterTileDownloadDescriptors(n, a, e, o);
  28137. for (var s = 0, l = 0; l < e.length; l++) {
  28138. var c = e[l];
  28139. c && (t.push(c),
  28140. s++)
  28141. }
  28142. return s
  28143. }
  28144. }(),
  28145. n.prototype.filterTileDownloadDescriptors = function() {
  28146. new r.Vector3;
  28147. return function(e, t, i, n) {
  28148. var r, o;
  28149. switch (n.filter) {
  28150. case h.DirectionalFOV:
  28151. for (r = 0; r < t.length; r++)
  28152. o = t[r],
  28153. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28154. break;
  28155. default:
  28156. for (r = 0; r < t.length; r++)
  28157. o = t[r],
  28158. i.push(o)
  28159. }
  28160. for (r = 0; r < i.length; r++)
  28161. o = i[r],
  28162. this.canIncludeDescriptor(o) || (i[r] = null)
  28163. }
  28164. }(),
  28165. n.prototype.canIncludeDescriptor = function(e) {
  28166. return e.status !== s.Downloading && e.status !== s.Downloaded
  28167. }
  28168. ,
  28169. n.prototype.canIncludePano = function(e, t) {
  28170. return !e.isLoaded(t)
  28171. }
  28172. ,
  28173. n.getFOVDotThreshold = function(e) {
  28174. return Math.cos(r.Math.degToRad(e / 2))
  28175. }
  28176. ;
  28177. var u = function() {
  28178. var e = function e(t, i) {
  28179. var n = e._panoSpaceDir
  28180. , r = e._fovThreshold
  28181. , o = e._fovThresholdNarrow
  28182. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28183. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28184. return t._dot = a,
  28185. i._dot = s,
  28186. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  28187. };
  28188. return e._panoSpaceDir = new r.Vector3,
  28189. e._fovThreshold = -1,
  28190. e._fovThresholdNarrow = -1,
  28191. e
  28192. }();
  28193. n.sortPanoTiles = function(e, t, i) {
  28194. u._panoSpaceDir.copy(i),
  28195. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28196. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28197. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28198. e.sort(u)
  28199. }
  28200. ,
  28201. n.insertSortedPanoTile = function(e, t, i, r) {
  28202. u._panoSpaceDir.copy(r),
  28203. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28204. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28205. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28206. for (var o = -1, a = 0; a < e.length; a++) {
  28207. var s = u(t, e[a]);
  28208. if (s <= 0) {
  28209. o = a;
  28210. break
  28211. }
  28212. }
  28213. if (o === -1)
  28214. e[e.length] = t;
  28215. else {
  28216. for (var h = e.length; h > o; h--)
  28217. e[h] = e[h - 1];
  28218. e[o] = t
  28219. }
  28220. }
  28221. ,
  28222. n.prototype.setZoomingActive = function(e) {
  28223. e !== this.zoomingActive && (this.zoomingActive = e)
  28224. }
  28225. ,
  28226. t.exports = n
  28227. }
  28228. ).call(this, "/js/tile/TilePrioritizer.js")
  28229. }
  28230. , {
  28231. "../enum/DownloadStatus": 24,
  28232. "../enum/GLCubeFaces": 25,
  28233. "../enum/ModelManagerEvents": 33,
  28234. "../enum/PanoSizeClass": 36,
  28235. "../enum/Vectors": 50,
  28236. "../enum/Viewmode": 51,
  28237. "../objects/Panorama": 148,
  28238. "../settings": 166,
  28239. "../util/browser": 182,
  28240. "../util/logger": 189,
  28241. "../util/math": 190,
  28242. "./TileUtils": 174,
  28243. events: 202,
  28244. three: 217
  28245. }],
  28246. 173: [function(e, t, i) {
  28247. "use strict";
  28248. function n(e, t) {
  28249. this.levels = t,
  28250. this.tileSize = e,
  28251. this.root = null,
  28252. this.allNodes = [],
  28253. a(this)
  28254. }
  28255. function r(e, t) {
  28256. this.tree = e,
  28257. this.parent = t,
  28258. this.children = [],
  28259. this.id = ++u
  28260. }
  28261. function o(e, t, i, r, a, s, l, h) {
  28262. if (e) {
  28263. l = l || n.TraversalType.PreOrder;
  28264. var u = r * c + i;
  28265. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28266. s && s.push(e)),
  28267. e.children && 0 !== e.children.length) {
  28268. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28269. for (var g = 0; g < c; g++)
  28270. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28271. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28272. s && s.push(e))
  28273. }
  28274. }
  28275. }
  28276. function a(e) {
  28277. e.root = s(e, null, 0)
  28278. }
  28279. function s(e, t, i) {
  28280. if (i > e.levels)
  28281. return null;
  28282. var n = new r(e,t);
  28283. e.allNodes.push(n);
  28284. for (var o = 0; o < h; o++)
  28285. n.children[o] = s(e, n, i + 1);
  28286. return n
  28287. }
  28288. function l(e, t, i, n, r) {
  28289. if (!e)
  28290. return null;
  28291. if (0 === i)
  28292. return e;
  28293. if (!e.children || 0 === e.children.length)
  28294. return null;
  28295. var o = Math.pow(c, i)
  28296. , a = o / c
  28297. , s = n % a
  28298. , h = r % a
  28299. , u = Math.floor(r / a)
  28300. , d = Math.floor(n / a)
  28301. , p = u * c + d
  28302. , f = e.children[p];
  28303. return l(f, t + 1, i - 1, s, h)
  28304. }
  28305. var c = (e("three"),
  28306. e("./TileUtils"),
  28307. e("../objects/Panorama"),
  28308. e("../util/panorama"),
  28309. e("events").EventEmitter,
  28310. 2)
  28311. , h = c * c;
  28312. n.TraversalType = Object.freeze({
  28313. PreOrder: 0,
  28314. PostOrder: 1
  28315. });
  28316. var u = 0;
  28317. n.getLevelCountForSize = function(e, t) {
  28318. var i = 0;
  28319. for (t < e && (t = e); ; ) {
  28320. if (t /= c,
  28321. t < e)
  28322. break;
  28323. i++
  28324. }
  28325. return i
  28326. }
  28327. ,
  28328. n.getSizeForLevel = function(e, t) {
  28329. return Math.pow(c, t) * e
  28330. }
  28331. ,
  28332. n.prototype.getSubNode = function(e, t, i) {
  28333. (!t || e < this.tileSize) && (t = 0),
  28334. (!i || e < this.tileSize) && (i = 0),
  28335. e < this.tileSize && (e = this.tileSize);
  28336. var r = n.getLevelCountForSize(this.tileSize, e)
  28337. , o = l(this.root, 0, r, t, i);
  28338. return o
  28339. }
  28340. ,
  28341. n.prototype.breadthFirst = function(e) {
  28342. e = e || {};
  28343. var t = !!e.nullLevelEnd
  28344. , i = e.maxLevel
  28345. , n = e.minLevel
  28346. , r = e.callback
  28347. , o = e.saveVisited
  28348. , a = []
  28349. , s = {}
  28350. , l = 0
  28351. , c = 0;
  28352. for (a.push(this.root),
  28353. a.push(s); a.length > 0 && !(i && l > i); ) {
  28354. var h = a.shift();
  28355. if (h === s)
  28356. (!n || l >= n) && (r && t && r(null),
  28357. o && t && o.push(null)),
  28358. a.length > 0 && a.push(s),
  28359. l++,
  28360. c = 0;
  28361. else {
  28362. if (h.children)
  28363. for (var u = 0; u < h.children.length; u++) {
  28364. var d = h.children[u];
  28365. d && a.push(h.children[u])
  28366. }
  28367. var p = this.getFaceIndexFromNode(h);
  28368. (!n || l >= n) && (r && r(h, l, p),
  28369. o && o.push(h)),
  28370. c++
  28371. }
  28372. }
  28373. }
  28374. ,
  28375. n.prototype.getFaceIndexFromNode = function(e) {
  28376. if (!e)
  28377. return -1;
  28378. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28379. var o = i.parent;
  28380. if (!o)
  28381. break;
  28382. for (var a = -1, s = 0; s < o.children.length; s++)
  28383. o.children[s] === i && (a = s);
  28384. var l = a % c
  28385. , h = Math.floor(a / c);
  28386. n = l * t + n,
  28387. r = h * t + r,
  28388. t *= c,
  28389. i = o
  28390. }
  28391. return r * t + n
  28392. }
  28393. ,
  28394. n.prototype.depthFirst = function(e, t, i) {
  28395. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28396. }
  28397. ,
  28398. t.exports = n
  28399. }
  28400. , {
  28401. "../objects/Panorama": 148,
  28402. "../util/panorama": 191,
  28403. "./TileUtils": 174,
  28404. events: 202,
  28405. three: 217
  28406. }],
  28407. 174: [function(e, t, i) {
  28408. "use strict";
  28409. var n = e("../enum/GLCubeFaces")
  28410. , r = e("../util/MathLight")
  28411. , o = {};
  28412. o.TILE_SIZE = 512,
  28413. o.FACES_PER_PANO = 6,
  28414. o.LocationOnTile = {
  28415. Center: 0,
  28416. UpperLeft: 1,
  28417. UpperRight: 2,
  28418. LowerRight: 3,
  28419. LowerLeft: 4
  28420. },
  28421. o.getTileVector = function() {
  28422. return function(e, t, i, a, s, l, c, h) {
  28423. l = l || o.LocationOnTile.Center;
  28424. var u = e / t
  28425. , d = a / u;
  28426. s = -s + (u - 1);
  28427. var p = s / u
  28428. , f = t / e
  28429. , g = 2 * f
  28430. , m = g / 2
  28431. , v = 2 * d - 1 + m
  28432. , A = 2 * p - 1 + m;
  28433. switch (l) {
  28434. case o.LocationOnTile.UpperLeft:
  28435. v -= m,
  28436. A += m,
  28437. v += c * g;
  28438. break;
  28439. case o.LocationOnTile.UpperRight:
  28440. v += m,
  28441. A += m,
  28442. A -= c * g;
  28443. break;
  28444. case o.LocationOnTile.LowerRight:
  28445. v += m,
  28446. A -= m,
  28447. v -= c * g;
  28448. break;
  28449. case o.LocationOnTile.LowerLeft:
  28450. v -= m,
  28451. A -= m,
  28452. A += c * g;
  28453. break;
  28454. case o.LocationOnTile.Center:
  28455. }
  28456. switch (i) {
  28457. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28458. r.setVector(h, -1, A, -v);
  28459. break;
  28460. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28461. r.setVector(h, 1, A, v);
  28462. break;
  28463. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28464. r.setVector(h, -v, 1, -A);
  28465. break;
  28466. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28467. r.setVector(h, -v, -1, A);
  28468. break;
  28469. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28470. r.setVector(h, -v, A, 1);
  28471. break;
  28472. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28473. r.setVector(h, v, A, -1)
  28474. }
  28475. r.normalize(h)
  28476. }
  28477. }(),
  28478. o.getFaceForTile = function(e, t) {
  28479. var i = o.TILE_SIZE;
  28480. e < o.TILE_SIZE && (i = e);
  28481. var n = Math.floor(e / i)
  28482. , r = n * n;
  28483. return Math.floor(t / r)
  28484. }
  28485. ,
  28486. o.getTileLocation = function(e, t, i) {
  28487. var n = o.TILE_SIZE;
  28488. e < o.TILE_SIZE && (n = e);
  28489. var r = o.getFaceForTile(e, t)
  28490. , a = Math.floor(e / n)
  28491. , s = a * a
  28492. , l = t - r * s;
  28493. i.tileX = l % a,
  28494. i.tileY = Math.floor(l / a),
  28495. i.face = r,
  28496. i.faceTileIndex = l
  28497. }
  28498. ,
  28499. o.getTileCountForSize = function(e) {
  28500. if (e <= o.TILE_SIZE)
  28501. return o.FACES_PER_PANO;
  28502. var t = Math.floor(e / o.TILE_SIZE)
  28503. , i = t * t
  28504. , n = i * o.FACES_PER_PANO;
  28505. return n
  28506. }
  28507. ,
  28508. o.getRelativeDirection = function() {
  28509. var e = new r.Matrix4
  28510. , t = new r.Quaternion;
  28511. return function(i, n) {
  28512. t.copy(i),
  28513. t.inverse(),
  28514. e.makeRotationFromQuaternion(t),
  28515. e.applyToVector3(n),
  28516. r.normalize(n)
  28517. }
  28518. }(),
  28519. o.matchingTilesInDirection = function() {
  28520. var e = new r.Vector3
  28521. , t = new r.Vector3(0,0,-1)
  28522. , i = new r.Quaternion
  28523. , n = function(e, t) {
  28524. e.push({
  28525. face: t.face,
  28526. faceTileIndex: t.faceTileIndex,
  28527. tileX: t.tileX,
  28528. tileY: t.tileY
  28529. })
  28530. }
  28531. , a = function() {
  28532. var e = {
  28533. face: -1,
  28534. faceTileIndex: -1,
  28535. tileX: -1,
  28536. tileY: -1
  28537. };
  28538. return function(t, i, r) {
  28539. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  28540. o.getTileLocation(t, l, e),
  28541. i && !i(e) || (s++,
  28542. r && n(r, e));
  28543. return s
  28544. }
  28545. }();
  28546. return function(n, s, l, c, h, u) {
  28547. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  28548. o.getTileCountForSize(s);
  28549. if (!c && !h)
  28550. return a(s, null, u);
  28551. var p = !!h;
  28552. if (h = h || c,
  28553. h = Math.max(0, Math.min(h, 360)),
  28554. c = Math.max(0, Math.min(c, 360)),
  28555. r.copyVector(l, e),
  28556. o.getRelativeDirection(n.quaternion, e),
  28557. p) {
  28558. i.setFromUnitVectors(e, t);
  28559. var f = function(e) {
  28560. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28561. };
  28562. return a(s, f, u)
  28563. }
  28564. var g = function(t) {
  28565. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28566. };
  28567. return a(s, g, u)
  28568. }
  28569. }(),
  28570. o.isTileWithinFrustum = function() {
  28571. var e = new r.Vector3
  28572. , t = 1e-5;
  28573. return function(i, n, a, s, l, c, h, u) {
  28574. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  28575. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  28576. r.applyQuaternionToVector(c, e),
  28577. e.z >= -t)
  28578. I++;
  28579. else {
  28580. var w = -1 / e.z
  28581. , _ = e.x * w
  28582. , T = e.y * w;
  28583. T > d ? v++ : T < p && A++,
  28584. _ > f ? y++ : _ < g && C++,
  28585. E++
  28586. }
  28587. return A !== E && v !== E && y !== E && C !== E
  28588. }
  28589. }(),
  28590. o.isTileWithinFOV = function() {
  28591. var e = new r.Vector3
  28592. , t = new r.Vector3(0,1,0)
  28593. , i = new r.Vector3(1,0,0);
  28594. return function(n, a, s, l, c, h, u) {
  28595. var d = o.mapFaceToCubemapFace(s);
  28596. if (r.cross(h, t, i),
  28597. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  28598. o.isWithinFOV(e, h, u, null))
  28599. return !0;
  28600. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28601. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  28602. if (o.getTileVector(n, a, d, l, c, v, g, e),
  28603. o.isWithinFOV(e, h, u, null))
  28604. return !0;
  28605. g += p
  28606. }
  28607. return !1
  28608. }
  28609. }(),
  28610. o.isWithinFOV = function() {
  28611. var e = new r.Vector3
  28612. , t = new r.Vector3;
  28613. return function(i, n, o, a) {
  28614. if (r.copyVector(i, t),
  28615. a) {
  28616. r.copyVector(a, e),
  28617. r.normalize(e);
  28618. var s = r.dot(e, i);
  28619. e.x *= s,
  28620. e.y *= s,
  28621. e.z *= s,
  28622. r.subVector(t, e)
  28623. }
  28624. var l = o / 2 * r.RADIANS_PER_DEGREE
  28625. , c = Math.cos(l)
  28626. , h = r.dot(t, n);
  28627. return h >= c
  28628. }
  28629. }(),
  28630. o.mapFaceToCubemapFace = function() {
  28631. var e = {
  28632. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28633. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28634. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28635. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28636. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28637. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28638. };
  28639. return function(t) {
  28640. return e[t]
  28641. }
  28642. }(),
  28643. t.exports = o
  28644. }
  28645. , {
  28646. "../enum/GLCubeFaces": 25,
  28647. "../util/MathLight": 176
  28648. }],
  28649. 175: [function(e, t, i) {
  28650. (function(i) {
  28651. "use strict";
  28652. function n() {
  28653. this.list = [],
  28654. this.index = {},
  28655. Object.defineProperty(this, "length", {
  28656. get: function() {
  28657. return this.list.length
  28658. }
  28659. })
  28660. }
  28661. var r = (e("./common"),
  28662. e("./logger"));
  28663. new r(i);
  28664. n.prototype.forEach = function(e) {
  28665. this.list.forEach(e)
  28666. }
  28667. ,
  28668. n.prototype.add = function(e) {
  28669. this.list.push(e),
  28670. this.index[this.getIndex(e)] = e
  28671. }
  28672. ,
  28673. n.prototype.getIndex = function(e) {
  28674. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  28675. }
  28676. ,
  28677. n.prototype.extend = function(e) {
  28678. for (var t = 0; t < e.length; t++)
  28679. this.add(e[t])
  28680. }
  28681. ,
  28682. n.prototype.get = function(e) {
  28683. return this.index[e]
  28684. }
  28685. ,
  28686. n.prototype.first = function() {
  28687. return this.list[0]
  28688. }
  28689. ,
  28690. n.prototype.last = function() {
  28691. return this.list[this.list.length - 1]
  28692. }
  28693. ,
  28694. n.prototype.reIndex = function() {
  28695. this.index = {};
  28696. var e = this;
  28697. this.forEach(function(t) {
  28698. e.index[e.getIndex(t)] = t
  28699. })
  28700. }
  28701. ,
  28702. n.prototype.filter = function(e) {
  28703. var t = this.list.filter(e);
  28704. return this.reIndex(),
  28705. t
  28706. }
  28707. ,
  28708. n.prototype.reduce = function(e, t) {
  28709. return this.list.reduce(e, t)
  28710. }
  28711. ,
  28712. n.prototype.sort = function(e) {
  28713. return this.list.sort(e)
  28714. }
  28715. ,
  28716. n.prototype.indexOf = function(e) {
  28717. for (var t = 0; t < this.list.length; ++t)
  28718. if (this.list[t] === e)
  28719. return t;
  28720. return -1
  28721. }
  28722. ,
  28723. t.exports = n
  28724. }
  28725. ).call(this, "/js/util/IndexedCollection.js")
  28726. }
  28727. , {
  28728. "./common": 185,
  28729. "./logger": 189
  28730. }],
  28731. 176: [function(e, t, i) {
  28732. "use strict";
  28733. var n = e("../constants")
  28734. , r = {};
  28735. r.RADIANS_PER_DEGREE = Math.PI / 180,
  28736. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  28737. r.Vector3 = function(e, t, i) {
  28738. this.x = e || 0,
  28739. this.y = t || 0,
  28740. this.z = i || 0
  28741. }
  28742. ,
  28743. r.Matrix4 = function() {
  28744. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  28745. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  28746. }
  28747. ,
  28748. r.Matrix4.prototype = {
  28749. identity: function() {
  28750. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  28751. this
  28752. },
  28753. copy: function(e) {
  28754. return this.elements.set(e.elements),
  28755. this
  28756. },
  28757. applyToVector3: function(e) {
  28758. var t = e.x
  28759. , i = e.y
  28760. , n = e.z
  28761. , r = this.elements;
  28762. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  28763. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  28764. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  28765. this
  28766. },
  28767. getInverse: function(e, t) {
  28768. var i = this.elements
  28769. , n = e.elements
  28770. , r = n[0]
  28771. , o = n[1]
  28772. , a = n[2]
  28773. , s = n[3]
  28774. , l = n[4]
  28775. , c = n[5]
  28776. , h = n[6]
  28777. , u = n[7]
  28778. , d = n[8]
  28779. , p = n[9]
  28780. , f = n[10]
  28781. , g = n[11]
  28782. , m = n[12]
  28783. , v = n[13]
  28784. , A = n[14]
  28785. , y = n[15]
  28786. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  28787. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  28788. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  28789. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  28790. , w = r * C + o * I + a * E + s * b;
  28791. if (0 === w) {
  28792. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  28793. if (t)
  28794. throw new Error(_);
  28795. return console.warn(_),
  28796. this.identity()
  28797. }
  28798. var T = 1 / w;
  28799. return i[0] = C * T,
  28800. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  28801. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  28802. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  28803. i[4] = I * T,
  28804. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  28805. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  28806. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  28807. i[8] = E * T,
  28808. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  28809. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  28810. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  28811. i[12] = b * T,
  28812. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  28813. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  28814. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  28815. this
  28816. },
  28817. makeRotationFromQuaternion: function(e) {
  28818. var t = this.elements
  28819. , i = e.x
  28820. , n = e.y
  28821. , r = e.z
  28822. , o = e.w
  28823. , a = i + i
  28824. , s = n + n
  28825. , l = r + r
  28826. , c = i * a
  28827. , h = i * s
  28828. , u = i * l
  28829. , d = n * s
  28830. , p = n * l
  28831. , f = r * l
  28832. , g = o * a
  28833. , m = o * s
  28834. , v = o * l;
  28835. return t[0] = 1 - (d + f),
  28836. t[4] = h - v,
  28837. t[8] = u + m,
  28838. t[1] = h + v,
  28839. t[5] = 1 - (c + f),
  28840. t[9] = p - g,
  28841. t[2] = u - m,
  28842. t[6] = p + g,
  28843. t[10] = 1 - (c + d),
  28844. t[3] = 0,
  28845. t[7] = 0,
  28846. t[11] = 0,
  28847. t[12] = 0,
  28848. t[13] = 0,
  28849. t[14] = 0,
  28850. t[15] = 1,
  28851. this
  28852. }
  28853. },
  28854. r.Quaternion = function(e, t, i, n) {
  28855. this._x = e || 0,
  28856. this._y = t || 0,
  28857. this._z = i || 0,
  28858. this._w = void 0 !== n ? n : 1
  28859. }
  28860. ,
  28861. r.Quaternion.prototype = {
  28862. get x() {
  28863. return this._x
  28864. },
  28865. set x(e) {
  28866. this._x = e
  28867. },
  28868. get y() {
  28869. return this._y
  28870. },
  28871. set y(e) {
  28872. this._y = e
  28873. },
  28874. get z() {
  28875. return this._z
  28876. },
  28877. set z(e) {
  28878. this._z = e
  28879. },
  28880. get w() {
  28881. return this._w
  28882. },
  28883. set w(e) {
  28884. this._w = e
  28885. },
  28886. copy: function(e) {
  28887. this._x = e.x,
  28888. this._y = e.y,
  28889. this._z = e.z,
  28890. this._w = e.w
  28891. },
  28892. inverse: function() {
  28893. return this.conjugate().normalize()
  28894. },
  28895. conjugate: function() {
  28896. return this._x *= -1,
  28897. this._y *= -1,
  28898. this._z *= -1,
  28899. this
  28900. },
  28901. length: function() {
  28902. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  28903. },
  28904. normalize: function() {
  28905. var e = this.length();
  28906. return 0 === e ? (this._x = 0,
  28907. this._y = 0,
  28908. this._z = 0,
  28909. this._w = 1) : (e = 1 / e,
  28910. this._x = this._x * e,
  28911. this._y = this._y * e,
  28912. this._z = this._z * e,
  28913. this._w = this._w * e),
  28914. this
  28915. },
  28916. setFromAxisAngle: function(e, t) {
  28917. var i = t / 2
  28918. , n = Math.sin(i);
  28919. return this._x = e.x * n,
  28920. this._y = e.y * n,
  28921. this._z = e.z * n,
  28922. this._w = Math.cos(i),
  28923. this
  28924. },
  28925. setFromUnitVectors: function() {
  28926. var e, t, i = 1e-6;
  28927. return function(n, o) {
  28928. return void 0 === e && (e = new r.Vector3),
  28929. t = r.dot(n, o) + 1,
  28930. t < i ? (t = 0,
  28931. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  28932. this._x = e.x,
  28933. this._y = e.y,
  28934. this._z = e.z,
  28935. this._w = t,
  28936. this.normalize()
  28937. }
  28938. }(),
  28939. multiply: function(e) {
  28940. return this.multiplyQuaternions(this, e)
  28941. },
  28942. premultiply: function(e) {
  28943. return this.multiplyQuaternions(e, this)
  28944. },
  28945. multiplyQuaternions: function(e, t) {
  28946. var i = e._x
  28947. , n = e._y
  28948. , r = e._z
  28949. , o = e._w
  28950. , a = t._x
  28951. , s = t._y
  28952. , l = t._z
  28953. , c = t._w;
  28954. return this._x = i * c + o * a + n * l - r * s,
  28955. this._y = n * c + o * s + r * a - i * l,
  28956. this._z = r * c + o * l + i * s - n * a,
  28957. this._w = o * c - i * a - n * s - r * l,
  28958. this
  28959. }
  28960. },
  28961. r.convertWorkshopVector = function(e) {
  28962. return new r.Vector3(-e.x,e.y,e.z)
  28963. }
  28964. ,
  28965. r.convertWorkshopQuaternion = function(e) {
  28966. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28967. }
  28968. ;
  28969. r.convertWorkshopOrthoZoom = function(e) {//xzw
  28970. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  28971. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28972. }
  28973. ,
  28974. r.convertWorkshopPanoramaQuaternion = function(e) {
  28975. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  28976. }
  28977. ,
  28978. r.normalize = function(e) {
  28979. var t = e.x * e.x + e.y * e.y + e.z * e.z
  28980. , i = Math.sqrt(t);
  28981. e.x /= i,
  28982. e.y /= i,
  28983. e.z /= i
  28984. }
  28985. ,
  28986. r.dot = function(e, t) {
  28987. return e.x * t.x + e.y * t.y + e.z * t.z
  28988. }
  28989. ,
  28990. r.cross = function(e, t, i) {
  28991. var n = e.x
  28992. , r = e.y
  28993. , o = e.z;
  28994. i.x = r * t.z - o * t.y,
  28995. i.y = o * t.x - n * t.z,
  28996. i.z = n * t.y - r * t.x
  28997. }
  28998. ,
  28999. r.setVector = function(e, t, i, n) {
  29000. e.x = t,
  29001. e.y = i,
  29002. e.z = n
  29003. }
  29004. ,
  29005. r.copyVector = function(e, t) {
  29006. t.x = e.x,
  29007. t.y = e.y,
  29008. t.z = e.z
  29009. }
  29010. ,
  29011. r.addVector = function(e, t) {
  29012. e.x += t.x,
  29013. e.y += t.y,
  29014. e.z += t.z
  29015. }
  29016. ,
  29017. r.subVector = function(e, t) {
  29018. e.x -= t.x,
  29019. e.y -= t.y,
  29020. e.z -= t.z
  29021. }
  29022. ,
  29023. r.applyQuaternionToVector = function(e, t) {
  29024. var i = t.x
  29025. , n = t.y
  29026. , r = t.z
  29027. , o = e.x
  29028. , a = e.y
  29029. , s = e.z
  29030. , l = e.w
  29031. , c = l * i + a * r - s * n
  29032. , h = l * n + s * i - o * r
  29033. , u = l * r + o * n - a * i
  29034. , d = -o * i - a * n - s * r;
  29035. t.x = c * l + d * -o + h * -s - u * -a,
  29036. t.y = h * l + d * -a + u * -o - c * -s,
  29037. t.z = u * l + d * -s + c * -a - h * -o
  29038. }
  29039. ,
  29040. r.angleBetweenVectors = function(e, t) {
  29041. return Math.acos(r.dot(e, t))
  29042. }
  29043. ,
  29044. t.exports = r
  29045. }
  29046. , {
  29047. "../constants": 8
  29048. }],
  29049. 177: [function(e, t, i) {
  29050. (function(i) {
  29051. "use strict";
  29052. function n(e) {
  29053. this.cache = null,
  29054. this.expires = 0
  29055. }
  29056. function r() {
  29057. this.baseUrl = null,
  29058. this.cache = null,
  29059. this.expires = 0
  29060. }
  29061. function o() {
  29062. this.baseUrl = null,
  29063. this.expires = 0
  29064. }
  29065. function a(e) {
  29066. this.initialLoadingPromise = null,
  29067. this.endpoint = e + "?type=3",
  29068. this.urlContainer = null,
  29069. this.authorizationHeader = h.getAuthorizationHeader(),
  29070. this.containerClasses = [o, r, n]
  29071. }
  29072. var s = e("./ajax")
  29073. , l = e("./logger")
  29074. , c = e("../constants")
  29075. , h = e("./showcase")
  29076. , u = (e("../ab"),
  29077. new l(i));
  29078. n.prototype = {
  29079. version: 1,
  29080. validate: function(e) {
  29081. return "catalog.json"in e && Object.keys(e).length > 0
  29082. },
  29083. update: function(e) {
  29084. return this.cache = e,
  29085. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29086. $.when()
  29087. },
  29088. get: function(e) {
  29089. return this.cache[e]
  29090. }
  29091. },
  29092. r.prototype = {
  29093. version: 2,
  29094. validate: function(e) {
  29095. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29096. },
  29097. update: function(e) {
  29098. return this.baseUrl = e["base.url"],
  29099. this.cache = e,
  29100. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29101. $.when()
  29102. },
  29103. get: function(e) {
  29104. var t = this.cache[e];
  29105. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29106. }
  29107. },
  29108. o.prototype = {
  29109. version: 3,
  29110. validate: function(e) {
  29111. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29112. },
  29113. update: function(e) {
  29114. return this.baseUrl = e.templates[0],
  29115. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29116. $.when()
  29117. },
  29118. get: function(e) {
  29119. return this.baseUrl.replace("{{filename}}", e)
  29120. }
  29121. },
  29122. a.prototype = {
  29123. init: function() {
  29124. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29125. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29126. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29127. this.refresh().done(function() {
  29128. u.debug("Refreshed")
  29129. }).fail(function() {
  29130. u.error("Failed url refresh, urls might go stale soon")
  29131. }))
  29132. }
  29133. .bind(this), c.signedUrlCheckInterval),
  29134. this.initialLoadingPromise = this.refresh(),
  29135. this.initialLoadingPromise)
  29136. },
  29137. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29138. e = e || {};
  29139. /*var t = void 0 === e.cache || e.cache;
  29140. return s.get( this.endpoint , { //file
  29141. responseType: "json",
  29142. prefetchFrom: t ? "files" : null,
  29143. cache: t,
  29144. auth: this.authorizationHeader
  29145. }).then(function(e) {
  29146. if (this.urlContainer && this.urlContainer.validate(e))
  29147. return this.urlContainer.update(e);
  29148. for (var i = 0; i < this.containerClasses.length; i++) {
  29149. var n = this.containerClasses[i]
  29150. , r = new n;
  29151. if (r.validate(e))
  29152. return u.info("Using urls version " + r.version),
  29153. this.urlContainer = r,
  29154. this.urlContainer.update(e)
  29155. }
  29156. return t ? this.refresh({
  29157. cache: !1
  29158. }) : $.Deferred().reject("missing-urls")
  29159. }
  29160. .bind(this), function(e) {
  29161. return "loading-failed"
  29162. }) */
  29163. return $.Deferred().resolve();
  29164. },
  29165. get: function(e) {
  29166. //return this.urlContainer.get(e)
  29167. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  29168. }
  29169. },
  29170. t.exports = a
  29171. }
  29172. ).call(this, "/js/util/ModelUrls.js")
  29173. }
  29174. , {
  29175. "../ab": 3,
  29176. "../constants": 8,
  29177. "./ajax": 181,
  29178. "./logger": 189,
  29179. "./showcase": 193
  29180. }],
  29181. 178: [function(e, t, i) {
  29182. (function(i) {
  29183. "use strict";
  29184. function n() {
  29185. u.call(this),
  29186. this.neighbourMap = {},
  29187. this.map = null
  29188. }
  29189. var r = e("three")
  29190. , o = e("./common")
  29191. , a = e("../settings")
  29192. , s = e("../objects/Panorama")
  29193. , a = e("../settings")
  29194. , l = e("./aStar")
  29195. , c = e("./logger")
  29196. , h = new c(i)
  29197. , u = e("./IndexedCollection")
  29198. , d = e("./transitions");
  29199. o.inherit(n, u),
  29200. n.prototype.getIndex = function(e) {
  29201. return e.id
  29202. }
  29203. ,
  29204. n.prototype.find = function(e, t) {
  29205. var i = o.filterAll(this.list, e);
  29206. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29207. i = o.stableSort(i, e)
  29208. }),
  29209. i[0])
  29210. }
  29211. ,
  29212. n.prototype.sortByScore = function(e, t) {
  29213. var i = o.filterAll(this.list, e);
  29214. return 0 === i.length ? null : i = i.map(function(e) {
  29215. return {
  29216. pano: e,
  29217. score: t.reduce(function(t, i) {
  29218. return t + i(e)
  29219. }, 0)
  29220. }
  29221. }).sort(function(e, t) {
  29222. return t.score - e.score;
  29223. })
  29224. }
  29225. ,
  29226. n.prototype.lowestByScore = function(e, t, i) {
  29227. return this.findRankedByScore(0, e, t, i)
  29228. }
  29229. ,
  29230. n.prototype.findRankedByScore = function(e, t, i, n) {
  29231. n && (n.candidates = null,
  29232. n.pano = null),
  29233. e || (e = 0);
  29234. var r = this.sortByScore(t, i);
  29235. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29236. n.pano = r[e].pano),
  29237. r[e].pano)
  29238. }
  29239. ,
  29240. n.prototype.showPanoScores = function(e) {
  29241. this.list.forEach(function(e) {
  29242. e.removeTextSprite()
  29243. });
  29244. var t = 6344768;
  29245. e.forEach(function(e) {
  29246. e.pano.addTextSprite(e.score.toFixed(2), t),
  29247. t = 16428055
  29248. })
  29249. }
  29250. ,
  29251. n.prototype.isNeighbour = function(e, t) {
  29252. return this.neighbourMap[e.id][t.id]
  29253. }
  29254. ,
  29255. n.prototype.getNeighbours = function(e) {
  29256. return this.neighbourMap[e.id]
  29257. }
  29258. ,
  29259. n.prototype.setNeighbour = function(e, t, i) {
  29260. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29261. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29262. this.neighbourMap[e.id][e.id] = !0,
  29263. this.neighbourMap[t.id][t.id] = !0,
  29264. this.neighbourMap[e.id][t.id] = i,
  29265. this.neighbourMap[t.id][e.id] = i,
  29266. this.neighbourMap[e.id]
  29267. }
  29268. ,
  29269. n.prototype.findClosest = function(e, t) {
  29270. var i = [s.filters.isPanoAligned()];
  29271. return t && i.push(s.filters.inDirection(e, t, .75)),
  29272. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29273. }
  29274. ,
  29275. n.prototype.dualNeighbors = function(e, t) {
  29276. var i, n = [];
  29277. for (i in this.neighbourMap[e.id])
  29278. this.neighbourMap[t.id][i] && n.push(i);
  29279. return n
  29280. }
  29281. ,
  29282. n.prototype.populate_path_graph = function() {
  29283. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  29284. for (e = 0; e < this.list.length; e += 1) {
  29285. o = this.list[e],
  29286. s = {},
  29287. l = !1,
  29288. i = o.neighbourPanos || o.findNeighourPanos();
  29289. for (t in i)
  29290. if (i[t]) {
  29291. a = this.index[t],
  29292. p.copy(o.floorPosition),
  29293. p.sub(a.floorPosition);
  29294. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29295. , v = (Math.abs(p.y) / Math.max(m, .01),
  29296. Math.max(0, Math.abs(p.y) - .2));
  29297. v > 0 ? (f += 1,
  29298. v = Math.pow(4 * v, 2),
  29299. m = Math.pow(m, 2),
  29300. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29301. n = p.length()),
  29302. s[a.id] = n,
  29303. l = !0
  29304. }
  29305. l ? u[o.id] = s : d += 1
  29306. }
  29307. this.map = u,
  29308. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29309. }
  29310. ,
  29311. n.prototype.aStarSearch = function(e, t) {
  29312. var i = Date.now()
  29313. , n = new l({
  29314. start: e,
  29315. isEnd: function(e) {
  29316. return e === t
  29317. },
  29318. neighbor: function(e) {
  29319. var t = e.neighbourPanos || e.findNeighourPanos()
  29320. , i = [];
  29321. for (var n in t)
  29322. i.push(this.index[n]);
  29323. return i
  29324. }
  29325. .bind(this),
  29326. distance: function(e, t) {
  29327. var i = this.map[e.id]
  29328. , n = i[t.id];
  29329. return n
  29330. }
  29331. .bind(this),
  29332. heuristic: function(e, t) {
  29333. return 1
  29334. }
  29335. .bind(this),
  29336. hash: function(e) {
  29337. return e.id
  29338. },
  29339. timeout: 5e3
  29340. });
  29341. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29342. "success" !== n.status)
  29343. return h.debug("Did not find A* path from " + e + " to " + t),
  29344. null;
  29345. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29346. var r = [];
  29347. return n.path.forEach(function(e) {
  29348. r.push(e.id)
  29349. }),
  29350. r
  29351. }
  29352. ,
  29353. n.prototype.includeNodesNearPath = function() {
  29354. var e = new r.Vector3
  29355. , t = new r.Vector3
  29356. , i = new r.Vector3
  29357. , n = new r.Vector3
  29358. , o = new r.Vector3
  29359. , a = new r.Vector3
  29360. , s = new r.Vector3
  29361. , l = new r.Vector3
  29362. , c = []
  29363. , h = new r.Vector3
  29364. , u = new r.Vector3;
  29365. return function(r, d) {
  29366. if (r)
  29367. for (var p = function(e, t, i) {
  29368. return o.copy(t).sub(e),
  29369. o.dot(i)
  29370. }, f = function(e, t) {
  29371. return p(h, e.position, i) - p(h, t.position, i)
  29372. }, g = 0; g < r.length - 1; ) {
  29373. var m = r[g]
  29374. , v = r[g + 1]
  29375. , A = this.index[m]
  29376. , y = this.index[v];
  29377. h.copy(A.position),
  29378. u.copy(y.position),
  29379. c.length = 0,
  29380. e.copy(u).sub(h),
  29381. i.copy(e).normalize();
  29382. for (var C = 0; C < this.list.length; C++) {
  29383. var I = this.list[C];
  29384. o.copy(I.position).sub(h);
  29385. var E = o.dot(i);
  29386. if (E > 0) {
  29387. s.copy(i),
  29388. s.multiplyScalar(E),
  29389. a.copy(o),
  29390. a.sub(s);
  29391. var b = a.length();
  29392. if (b < d) {
  29393. t.copy(e).negate(),
  29394. n.copy(t).normalize(),
  29395. l.copy(I.position).sub(u);
  29396. var w = l.dot(n);
  29397. w > 0 && c.push(I)
  29398. }
  29399. }
  29400. }
  29401. if (c.length > 0) {
  29402. c.sort(f);
  29403. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29404. r[_] = r[_ - c.length];
  29405. for (var T = 0; T < c.length; T++)
  29406. r[T + g + 1] = c[T].id
  29407. }
  29408. g += c.length + 1
  29409. }
  29410. }
  29411. }(),
  29412. n.prototype.fadeMarkerOpacity = function(e, t) {
  29413. var i = void 0 === e ? a.panorama.markerOpacity : e
  29414. , n = this.list.findIndex(function(e) {
  29415. return e.marker
  29416. });
  29417. if (!(n < 0)) {
  29418. var r = this.list[n].marker.material.opacity;
  29419. if (r !== e) {
  29420. var o = i - r;
  29421. d.trigger({
  29422. func: function(e, t) {
  29423. var i = r + e * o;
  29424. this.forEach(function(e) {
  29425. e.marker && (e.marker.material.opacity = i)
  29426. })
  29427. }
  29428. .bind(this),
  29429. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29430. name: "_fpm"
  29431. })
  29432. }
  29433. }
  29434. }
  29435. ,
  29436. t.exports = n
  29437. }
  29438. ).call(this, "/js/util/PanoramaCollection.js")
  29439. }
  29440. , {
  29441. "../objects/Panorama": 148,
  29442. "../settings": 166,
  29443. "./IndexedCollection": 175,
  29444. "./aStar": 180,
  29445. "./common": 185,
  29446. "./logger": 189,
  29447. "./transitions": 195,
  29448. three: 217
  29449. }],
  29450. 179: [function(e, t, i) {
  29451. "use strict";
  29452. function n() {
  29453. this.actionSequence = [],
  29454. this.actionSequenceInProgress = !1
  29455. }
  29456. function r(e, t, i, n) {
  29457. s.trackAlways("zoom_" + e, {
  29458. from: t,
  29459. to: i,
  29460. pano: n
  29461. })
  29462. }
  29463. function o(e, t) {
  29464. r("initial", 1, e, t)
  29465. }
  29466. function a(e, t, i) {
  29467. r("followup", e, t, i)
  29468. }
  29469. var s = e("../analytics");
  29470. n.prototype.reset = function(e) {
  29471. this.actionSequenceInProgress = !1,
  29472. this.actionSequence.length = 0
  29473. }
  29474. ,
  29475. n.prototype.addZoomAction = function() {
  29476. var e = null
  29477. , t = null
  29478. , i = !1
  29479. , n = function() {
  29480. if (e = null,
  29481. this.actionSequence.length > 0) {
  29482. var i = this.actionSequence[0].start
  29483. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29484. 1 === i ? o(n, t) : a(i, n, t)
  29485. }
  29486. this.reset()
  29487. };
  29488. return function(r, o, a) {
  29489. if (r !== o) {
  29490. i || (n = n.bind(this),
  29491. i = !0),
  29492. e && (window.clearTimeout(e),
  29493. e = null),
  29494. a === t && this.actionSequenceInProgress || (this.reset(),
  29495. t = a),
  29496. this.actionSequenceInProgress = !0;
  29497. var s = {
  29498. start: r,
  29499. end: o
  29500. };
  29501. this.actionSequence.push(s),
  29502. e = window.setTimeout(n, 150)
  29503. }
  29504. }
  29505. }(),
  29506. t.exports = n
  29507. }
  29508. , {
  29509. "../analytics": 4
  29510. }],
  29511. 180: [function(e, t, i) {
  29512. "use strict";
  29513. function n(e) {
  29514. void 0 === e.timeout && (e.timeout = 1 / 0);
  29515. var t = e.hash || o
  29516. , i = {
  29517. data: e.start,
  29518. g: 0,
  29519. h: e.heuristic(e.start)
  29520. }
  29521. , n = i;
  29522. i.f = i.h;
  29523. var h = new s
  29524. , u = new l(a)
  29525. , d = c();
  29526. u.push(i),
  29527. d.set(t(i.data), i);
  29528. for (var p = new Date; u.size(); ) {
  29529. if (new Date - p > e.timeout)
  29530. return {
  29531. status: "timeout",
  29532. cost: n.g,
  29533. path: r(n)
  29534. };
  29535. var f = u.pop();
  29536. if (d.delete(t(f.data)),
  29537. e.isEnd(f.data))
  29538. return {
  29539. status: "success",
  29540. cost: f.g,
  29541. path: r(f)
  29542. };
  29543. h.add(t(f.data));
  29544. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29545. var v = g[m];
  29546. if (!h.contains(t(v))) {
  29547. var A = f.g + e.distance(f.data, v)
  29548. , y = d.get(t(v))
  29549. , C = !1;
  29550. if (void 0 === y)
  29551. y = {
  29552. data: v
  29553. },
  29554. d.set(t(v), y);
  29555. else {
  29556. if (y.g < A)
  29557. continue;
  29558. C = !0
  29559. }
  29560. y.parent = f,
  29561. y.g = A,
  29562. y.h = e.heuristic(v),
  29563. y.f = A + y.h,
  29564. y.h < n.h && (n = y),
  29565. C ? u.heapify() : u.push(y)
  29566. }
  29567. }
  29568. }
  29569. return {
  29570. status: "noPath",
  29571. cost: n.g,
  29572. path: r(n)
  29573. }
  29574. }
  29575. function r(e) {
  29576. if (void 0 !== e.parent) {
  29577. var t = r(e.parent);
  29578. return t.push(e.data),
  29579. t
  29580. }
  29581. return [e.data]
  29582. }
  29583. function o(e) {
  29584. return e.toString()
  29585. }
  29586. function a(e, t) {
  29587. return e.f - t.f
  29588. }
  29589. var s = e("Set")
  29590. , l = e("heap")
  29591. , c = e("dict");
  29592. t.exports = n
  29593. }
  29594. , {
  29595. Set: 196,
  29596. dict: 210,
  29597. heap: 211
  29598. }],
  29599. 181: [function(e, t, i) {
  29600. (function(i) {
  29601. "use strict";
  29602. function n(e, t, i) {
  29603. var n = new XMLHttpRequest;
  29604. if (i && "withCredentials"in n)
  29605. n.open(e, t, i);
  29606. else if ("undefined" != typeof XDomainRequest)
  29607. n = new XDomainRequest,
  29608. n.open(e, t);
  29609. else {
  29610. if (i)
  29611. throw "Browser does not support CORS!";
  29612. n.open(e, t)
  29613. }
  29614. return n
  29615. }
  29616. function r(e, t, i) {
  29617. function o() {
  29618. u.warn("Retrying ", t),
  29619. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29620. }
  29621. function a(e, t) {
  29622. var i = e.response;
  29623. if ("json" === t && "object" != typeof i)
  29624. try {
  29625. i = JSON.parse(e.responseText)
  29626. } catch (e) {
  29627. return void c.reject({
  29628. error: "Failed parsing JSON"
  29629. })
  29630. }
  29631. else if ("image/jpeg" === t) {
  29632. var n = new Uint8Array(e.response)
  29633. , r = new Blob([n],{
  29634. type: "image/jpeg"
  29635. })
  29636. , o = URL.createObjectURL(r);
  29637. i = new Image,
  29638. i.src = o,
  29639. i.crossOrigin = "Anonymous",
  29640. i.onload = function() {
  29641. URL.revokeObjectURL(o)
  29642. }
  29643. }
  29644. return i
  29645. }
  29646. var s = n(e, t, !1);
  29647. if (i = i || {},
  29648. i.retries = void 0 !== i.retries ? i.retries : 0,
  29649. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  29650. i.responseType)
  29651. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  29652. s.responseType = i.responseType;
  29653. else {
  29654. if ("image/jpeg" !== i.responseType)
  29655. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  29656. s.responseType = "arraybuffer"
  29657. }
  29658. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  29659. i.auth && s.setRequestHeader("Authorization", i.auth),
  29660. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  29661. s.setRequestHeader("Content-Type", "application/json")),
  29662. "object" == typeof i.headers)
  29663. for (var l in i.headers)
  29664. s.setRequestHeader(l, i.headers[l]);
  29665. var c = $.Deferred();
  29666. return s.onreadystatechange = function(e) {
  29667. if (4 === this.readyState)
  29668. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  29669. i.retries++,
  29670. setTimeout(o, 1e3);
  29671. else if (200 === this.status) {
  29672. var t = a(this, i.responseType);
  29673. c.resolve(t)
  29674. } else
  29675. c.reject(this)
  29676. }
  29677. ,
  29678. s.onprogress = function(e) {
  29679. c.notify(e)
  29680. }
  29681. ,
  29682. s.send(i.data),
  29683. c.promise()
  29684. }
  29685. function o(e) {
  29686. return Object.keys(e).sort().map(function(t) {
  29687. return {
  29688. key: t,
  29689. value: e[t]
  29690. }
  29691. })
  29692. }
  29693. function a(e, t) {
  29694. var i = t.responseType || null
  29695. , n = t.auth || null
  29696. , r = t.prefetchFrom || null
  29697. , a = e + "__" + i + "__" + n + "__" + r;
  29698. return t.headers && o(t.headers).forEach(function(e) {
  29699. a += "__" + e.key + ":" + e.value
  29700. }),
  29701. a
  29702. }
  29703. function s(e, t) {
  29704. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29705. }
  29706. function l(e, t, i) {
  29707. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29708. }
  29709. var c = e("./logger")
  29710. , h = e("../ab")
  29711. , u = new c(i);
  29712. window.URL = window.URL || window.webkitURL,
  29713. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  29714. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  29715. /* setTimeout(function() {//MP-- xzw delete
  29716. window.MP_REQUEST_CACHE = null,
  29717. window.MP_PREFETCHED_MODELDATA = {}
  29718. }, 6e4),
  29719. window.onpageshow = function(e) {
  29720. e.persisted && (window.MP_REQUEST_CACHE = null,
  29721. window.MP_PREFETCHED_MODELDATA = {})
  29722. } */
  29723. ,
  29724. t.exports = {
  29725. get: function(e, t) {
  29726. t = t || {};
  29727. var i = void 0 === t.cache || t.cache;
  29728. if (i) {
  29729. var n = s(e, t);
  29730. if (n)
  29731. return n
  29732. }
  29733. var o;
  29734. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  29735. i && l(e, t, o),
  29736. o
  29737. },
  29738. post: function(e, t) {
  29739. return r("POST", e, t)
  29740. },
  29741. patch: function(e, t) {
  29742. return r("PATCH", e, t)
  29743. },
  29744. getImage: function(e, t) {
  29745. function i() {
  29746. u.warn("Retrying ", e),
  29747. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  29748. }
  29749. var n = $.Deferred()
  29750. , r = new Image
  29751. , o = this;
  29752. return e = h.changeIfImageOptimzing(e),
  29753. null !== t && void 0 !== t || (t = 3),
  29754. r.onerror = function() {
  29755. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29756. }
  29757. ,
  29758. r.onload = function() {
  29759. n.resolve(r)
  29760. }
  29761. ,
  29762. r.crossOrigin = "anonymous",
  29763. r.src = e,
  29764. n
  29765. }
  29766. }
  29767. }
  29768. ).call(this, "/js/util/ajax.js")
  29769. }
  29770. , {
  29771. "../ab": 3,
  29772. "./logger": 189
  29773. }],
  29774. 182: [function(e, t, i) {
  29775. "use strict";
  29776. function n(e, t) {
  29777. var i = window.navigator.userAgent
  29778. , n = i.match(e);
  29779. return n = n ? n[1].split(t) : [],
  29780. {
  29781. major: parseInt(n[0]) || 0,
  29782. minor: parseInt(n[1]) || 0,
  29783. patch: parseInt(n[2]) || 0
  29784. }
  29785. }
  29786. var r = e("../exception/DeviceMismatchException");
  29787. t.exports = {
  29788. isFullscreen: function() {
  29789. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  29790. },
  29791. supportsFullscreen: function() {
  29792. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  29793. },
  29794. isPointerLocked: function() {
  29795. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  29796. },
  29797. requestFullscreen: function(e, t) {
  29798. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  29799. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  29800. },
  29801. requestPointerLock: function() {
  29802. var e;
  29803. if (document.fullscreenElement)
  29804. e = document.fullscreenElement();
  29805. else if (document.mozFullscreenElement)
  29806. e = document.mozFullscreenElement();
  29807. else if (document.mozFullScreenElement)
  29808. e = document.mozFullScreenElement();
  29809. else {
  29810. if (!document.webkitFullscreenElement)
  29811. return;
  29812. e = document.webkitFullscreenElement()
  29813. }
  29814. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  29815. e.requestPointerLock(),
  29816. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  29817. },
  29818. exitPointerLock: function() {
  29819. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  29820. document.exitPointerLock()
  29821. },
  29822. exitFullscreen: function() {
  29823. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  29824. },
  29825. details: function() {
  29826. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  29827. return e ? {
  29828. name: e[1],
  29829. version: parseInt(e[2]),
  29830. platform: navigator.platform
  29831. } : {}
  29832. },
  29833. is: function(e) {
  29834. return this.details() && this.details().name === e
  29835. },
  29836. inIframe: function() {
  29837. return window.parent !== window
  29838. },
  29839. aspectRatio: function() {
  29840. var e = $("#player").width() / $("#player").height();
  29841. return isFinite(e) ? e : 0
  29842. },
  29843. userAgent: function() {
  29844. return window.navigator.userAgent
  29845. },
  29846. isMobile: function() {
  29847. var e = navigator.userAgent || navigator.vendor || window.opera;
  29848. 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))
  29849. },
  29850. isLandscape: function() {
  29851. return this.isMobile && this.aspectRatio() > 1
  29852. },
  29853. isSmallScreen: function() {
  29854. var e = screen.width / window.devicePixelRatio;
  29855. return e < 240
  29856. },
  29857. detectIE: function() {
  29858. var e = window.navigator.userAgent
  29859. , t = e.indexOf("MSIE ");
  29860. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  29861. },
  29862. detectSafari: function() {
  29863. var e = window.navigator.userAgent
  29864. , t = e.indexOf("Safari");
  29865. return t !== -1 && !this.detectChrome()
  29866. },
  29867. detectFirefox: function() {
  29868. var e = window.navigator.userAgent;
  29869. return e.indexOf("Firefox") !== -1
  29870. },
  29871. detectChrome: function() {
  29872. var e = window.navigator.userAgent;
  29873. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  29874. },
  29875. detectOpera: function() {
  29876. var e = window.navigator.userAgent;
  29877. return e.indexOf("OPR") !== -1
  29878. },
  29879. detectIOS: function() {
  29880. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  29881. },
  29882. detectIPad: function() {
  29883. var e = window.navigator.userAgent
  29884. , t = /iPad/;
  29885. return t.test(e)
  29886. },
  29887. detectIPod: function() {
  29888. var e = window.navigator.userAgent
  29889. , t = /iPod/;
  29890. return t.test(e)
  29891. },
  29892. detectIPhone: function() {
  29893. var e = window.navigator.userAgent
  29894. , t = /iPhone/;
  29895. return t.test(e)
  29896. },
  29897. detectAndroid: function() {
  29898. var e = window.navigator.userAgent;
  29899. return e.indexOf("Android") !== -1
  29900. },
  29901. detectAndroidMobile: function() {
  29902. var e = window.navigator.userAgent;
  29903. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  29904. },
  29905. detectSamsungNative: function() {
  29906. var e = window.navigator.userAgent;
  29907. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  29908. },
  29909. detectSamsungS6: function() {
  29910. var e = window.navigator.userAgent;
  29911. return e.indexOf("SM-G92") !== -1
  29912. },
  29913. /************************************************************fyz改from徐世廷*************************************************************/
  29914. detectHUAWEI5X: function() {
  29915. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  29916. },
  29917. /*******************************************************************************************************************************/
  29918. detectWebVR: function() {
  29919. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  29920. },
  29921. getVRDisplay: function() {
  29922. var e = $.Deferred();
  29923. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  29924. t.length >= 1 && e.resolve(t[0]),
  29925. e.reject(null)
  29926. }),
  29927. e) : e.reject(null)
  29928. },
  29929. iosVersion: function() {
  29930. if (!this.detectIOS())
  29931. throw new r("Did not detect an iDevice");
  29932. var e = /((?:\d+\_?){1,3}) like Mac OS/
  29933. , t = "_";
  29934. return n(e, t)
  29935. },
  29936. androidVersion: function() {
  29937. if (!this.detectAndroid())
  29938. throw new r("Did not detect an Android based device");
  29939. var e = /Android ((?:\d+\.?){1,3})/
  29940. , t = ".";
  29941. return n(e, t)
  29942. },
  29943. valueFromCookie: function(e, t) {
  29944. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  29945. if (!i)
  29946. return t;
  29947. var n = i[1];
  29948. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  29949. },
  29950. valueFromHash: function(e, t) {
  29951. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  29952. , n = i.exec(window.location.href);
  29953. if (!n)
  29954. return t;
  29955. var r = n[1];
  29956. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  29957. }
  29958. }
  29959. }
  29960. , {
  29961. "../exception/DeviceMismatchException": 56
  29962. }],
  29963. 183: [function(e, t, i) {
  29964. (function(i) {
  29965. "use strict";
  29966. function n(e, t) {
  29967. var i = r(t);
  29968. var replaceAll = function (str, f, e) {
  29969. //f全部替换成e
  29970. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  29971. return str.replace(reg, e);
  29972. };
  29973. var urlFirstView = c.valueFromHash('firstView');
  29974. if(urlFirstView){
  29975. try{
  29976. urlFirstView = replaceAll(urlFirstView, "pano", '"pano"')
  29977. urlFirstView = replaceAll(urlFirstView, "qua:", '"qua":[')
  29978. urlFirstView = "{"+urlFirstView+"]}"
  29979. let info = JSON.parse(urlFirstView);
  29980. i.pano = t.list[info.pano] //panos.get(info.pano)
  29981. if(!i.pano){
  29982. urlFirstView = false
  29983. console.error('检测到firstView但是 找不到该pano')
  29984. }else{
  29985. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  29986. i.zoom = -1;
  29987. i.mode = "panorama"
  29988. i.setByUrl = true
  29989. }
  29990. }catch(e){
  29991. urlFirstView = false
  29992. console.error('检测到firstView但是解析出错'+e)
  29993. }
  29994. }
  29995. if (Object.keys(i).length > 0)
  29996. return i;
  29997. if (e.heroImage)
  29998. i = o(e, t);
  29999. else if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  30000. i.mode = "dollhouse"
  30001. }else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  30002. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  30003. try {
  30004. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30005. i.position = n.camera.position,
  30006. //i.quaternion = n.camera.quaternion,
  30007. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30008. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30009. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30010. d.debug("Using camera_start"),
  30011. d.debug("Modeldata pano: ", i.pano.quaternion),
  30012. d.debug("Camera start pano: ", n.pano.quaternion)),
  30013. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30014. } catch (e) {
  30015. d.warn(e.message)
  30016. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30017. }
  30018. }
  30019. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30020. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30021. i.pano = t.findClosest(i.position),
  30022. i.quaternion = i.pano.quaternion),
  30023. 0 === Object.keys(i).length) {
  30024. var a = t.list[0];
  30025. a && (i.mode = h.PANORAMA,
  30026. i.pano = a,
  30027. i.position = a.position,
  30028. i.quaternion = a.quaternion,
  30029. d.info("Starting at 1st pano " + a.id))
  30030. }
  30031. return i.mode = i.mode || h.DOLLHOUSE,
  30032. i
  30033. }
  30034. function r(e) {
  30035. var t = c.valueFromHash("start", "")
  30036. , i = {};
  30037. if ("" !== t) {
  30038. d.debug("Start override found in parameters, trying to parse..."),
  30039. i = a(t) || {};
  30040. var n = c.valueFromHash("tag", null);
  30041. n && (i.tag = n),
  30042. i.panoId && (i.pano = e.get(i.panoId))
  30043. }
  30044. return i
  30045. }
  30046. function o(e, t) {
  30047. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30048. return {};
  30049. var i = {}
  30050. , n = e.heroImage.metadata;
  30051. d.debug("Using start position from thumbnail image"),
  30052. i.position = n.camera_position,
  30053. i.quaternion = n.camera_quaternion;
  30054. try {
  30055. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30056. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30057. } catch (e) {
  30058. d.debug(e.message)
  30059. }
  30060. return i
  30061. }
  30062. function a(e) {
  30063. return s.deserialize(e)
  30064. }
  30065. var s = e("../controls/serializer")
  30066. , l = e("../util/math")
  30067. , c = e("./browser")
  30068. , h = e("../enum/Viewmode")
  30069. , u = e("../util/logger")
  30070. , th = e("three")//xzw
  30071. , d = new u(i);
  30072. t.exports = {
  30073. getStartCameraOptions: n
  30074. }
  30075. }
  30076. ).call(this, "/js/util/camera.js")
  30077. }
  30078. , {
  30079. "../controls/serializer": 14,
  30080. "../enum/Viewmode": 51,
  30081. "../util/logger": 189,
  30082. "../util/math": 190,
  30083. "./browser": 182,
  30084. "three": 217
  30085. }],
  30086. 184: [function(e, t, i) {
  30087. "use strict";
  30088. function n(e, t, i) {
  30089. return o(e.fov, t, i)
  30090. }
  30091. var r = e("./MathLight")
  30092. , o = function(e, t, i) {
  30093. var n = t
  30094. , o = i
  30095. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30096. return a
  30097. }
  30098. , a = function(e, t, i) {
  30099. var n = t
  30100. , o = i
  30101. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30102. return a
  30103. }
  30104. , s = function(e, t, i, n) {
  30105. var r = o(e, i, n);
  30106. return r > t ? a(t, i, n) : e
  30107. };
  30108. t.exports = {
  30109. clampVFOV: s,
  30110. getHFOVForCamera: n,
  30111. getHFOVFromVFOV: o,
  30112. getVFOVFromHFOV: a
  30113. }
  30114. }
  30115. , {
  30116. "./MathLight": 176
  30117. }],
  30118. 185: [function(e, t, i) {
  30119. "use strict";
  30120. var n = e("three");
  30121. t.exports = {
  30122. delayOneFrame: function(e) {
  30123. window.setTimeout(e, 1)
  30124. },
  30125. normalizeUrl: function(e) {
  30126. return e.replace("https://", "http://")
  30127. },
  30128. domainFromUrl: function(e) {
  30129. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30130. return t ? t[3] : e
  30131. },
  30132. average: function(e, t) {
  30133. if (0 === e.length)
  30134. return null;
  30135. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30136. var o = t ? e[r][t] : e[r];
  30137. i += o,
  30138. n++
  30139. }
  30140. return i / n
  30141. },
  30142. countUnique: function(e) {
  30143. for (var t = {}, i = 0; i < e.length; i++)
  30144. t[e[i]] = 1 + (t[e[i]] || 0);
  30145. return Object.keys(t).length
  30146. },
  30147. averageVectors: function(e, t) {
  30148. var i = new n.Vector3;
  30149. if (0 === e.length)
  30150. return i;
  30151. for (var r = 0, o = 0; o < e.length; o++) {
  30152. var a = t ? e[o][t] : e[o];
  30153. i.add(a),
  30154. r++
  30155. }
  30156. return i.divideScalar(r)
  30157. },
  30158. equalLists: function(e, t) {
  30159. if (e.length !== t.length)
  30160. return !1;
  30161. for (var i = 0; i < e.length; i++)
  30162. if (e[i] !== t[i])
  30163. return !1;
  30164. return !0
  30165. },
  30166. lowerMedian: function(e, t) {
  30167. if (0 === e.length)
  30168. return null;
  30169. t = t || 2,
  30170. e.sort(function(e, t) {
  30171. return e - t
  30172. });
  30173. var i = Math.floor(e.length / t);
  30174. return e[i]
  30175. },
  30176. stableSort: function(e, t) {
  30177. return e.map(function(e, t) {
  30178. return {
  30179. value: e,
  30180. index: t
  30181. }
  30182. }).sort(function(e, i) {
  30183. var n = t(e.value, i.value);
  30184. return 0 !== n ? n : e.index - i.index
  30185. }).map(function(e) {
  30186. return e.value
  30187. })
  30188. },
  30189. filterAll: function(e, t) {
  30190. return e.filter(function(e) {
  30191. return t.every(function(t) {
  30192. return t(e)
  30193. })
  30194. })
  30195. },
  30196. formatDate: function(e) {
  30197. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30198. },
  30199. formatDatetime: function(e) {
  30200. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30201. },
  30202. randomString: function(e) {
  30203. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30204. t += i.charAt(Math.floor(Math.random() * i.length));
  30205. return t
  30206. },
  30207. uint8ToBase64: function(e, t) {
  30208. t && "number" == typeof t || (t = 8192);
  30209. for (var i = [], n = 0; n < e.length; n += t)
  30210. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30211. return btoa(i.join(""))
  30212. },
  30213. uuid4: function e(t) {
  30214. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30215. },
  30216. nth: function(e) {
  30217. return e %= 10,
  30218. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30219. },
  30220. extendObject: function(e, t) {
  30221. return Object.keys(t).forEach(function(i) {
  30222. e[i] = t[i]
  30223. }),
  30224. e
  30225. },
  30226. deepExtend: function e(t) {
  30227. t = t || {};
  30228. for (var i = 1; i < arguments.length; i++) {
  30229. var n = arguments[i];
  30230. if (n)
  30231. for (var r in n)
  30232. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30233. }
  30234. return t
  30235. },
  30236. inherit: function(e, t) {
  30237. e.prototype = Object.create(t.prototype),
  30238. e.prototype.constructor = e
  30239. },
  30240. extend: function(e, t) {
  30241. for (var i in t.prototype)
  30242. e.prototype[i] = t.prototype[i]
  30243. }
  30244. },
  30245. Math.sign = function(e) {
  30246. return e < 0 ? -1 : 1
  30247. }
  30248. }
  30249. , {
  30250. three: 217
  30251. }],
  30252. 186: [function(e, t, i) {
  30253. "use strict";
  30254. var n = {};
  30255. n.linearTween = function(e, t, i, n) {
  30256. return i * e / n + t
  30257. }
  30258. ,
  30259. n.easeInQuad = function(e, t, i, n) {
  30260. return e /= n,
  30261. i * e * e + t
  30262. }
  30263. ,
  30264. n.easeOutQuad = function(e, t, i, n) {
  30265. return e /= n,
  30266. -i * e * (e - 2) + t
  30267. }
  30268. ,
  30269. n.easeInOutQuad = function(e, t, i, n) {
  30270. return e /= n / 2,
  30271. e < 1 ? i / 2 * e * e + t : (e--,
  30272. -i / 2 * (e * (e - 2) - 1) + t)
  30273. }
  30274. ,
  30275. n.easeInCubic = function(e, t, i, n) {
  30276. return e /= n,
  30277. i * e * e * e + t
  30278. }
  30279. ,
  30280. n.easeOutCubic = function(e, t, i, n) {
  30281. return e /= n,
  30282. e--,
  30283. i * (e * e * e + 1) + t
  30284. }
  30285. ,
  30286. n.easeInOutCubic = function(e, t, i, n) {
  30287. return e /= n / 2,
  30288. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30289. i / 2 * (e * e * e + 2) + t)
  30290. }
  30291. ,
  30292. n.easeInQuart = function(e, t, i, n) {
  30293. return e /= n,
  30294. i * e * e * e * e + t
  30295. }
  30296. ,
  30297. n.easeOutQuart = function(e, t, i, n) {
  30298. return e /= n,
  30299. e--,
  30300. -i * (e * e * e * e - 1) + t
  30301. }
  30302. ,
  30303. n.easeInOutQuart = function(e, t, i, n) {
  30304. return e /= n / 2,
  30305. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30306. -i / 2 * (e * e * e * e - 2) + t)
  30307. }
  30308. ,
  30309. n.easeInQuint = function(e, t, i, n) {
  30310. return e /= n,
  30311. i * e * e * e * e * e + t
  30312. }
  30313. ,
  30314. n.easeOutQuint = function(e, t, i, n) {
  30315. return e /= n,
  30316. e--,
  30317. i * (e * e * e * e * e + 1) + t
  30318. }
  30319. ,
  30320. n.easeInOutQuint = function(e, t, i, n) {
  30321. return e /= n / 2,
  30322. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30323. i / 2 * (e * e * e * e * e + 2) + t)
  30324. }
  30325. ,
  30326. n.easeInSine = function(e, t, i, n) {
  30327. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30328. }
  30329. ,
  30330. n.easeOutSine = function(e, t, i, n) {
  30331. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30332. }
  30333. ,
  30334. n.easeInOutSine = function(e, t, i, n) {
  30335. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30336. }
  30337. ,
  30338. n.easeInExpo = function(e, t, i, n) {
  30339. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30340. }
  30341. ,
  30342. n.easeOutExpo = function(e, t, i, n) {
  30343. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30344. }
  30345. ,
  30346. n.easeInOutExpo = function(e, t, i, n) {
  30347. return e /= n / 2,
  30348. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30349. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30350. }
  30351. ,
  30352. n.easeInCirc = function(e, t, i, n) {
  30353. return e /= n,
  30354. -i * (Math.sqrt(1 - e * e) - 1) + t
  30355. }
  30356. ,
  30357. n.easeOutCirc = function(e, t, i, n) {
  30358. return e /= n,
  30359. e--,
  30360. i * Math.sqrt(1 - e * e) + t
  30361. }
  30362. ,
  30363. n.easeInOutCirc = function(e, t, i, n) {
  30364. return e /= n / 2,
  30365. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30366. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30367. }
  30368. ,
  30369. n.easeInElastic = function(e, t, i, n) {
  30370. var r = 1.70158
  30371. , o = 0
  30372. , a = i;
  30373. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30374. a < Math.abs(i) ? (a = i,
  30375. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30376. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30377. }
  30378. ,
  30379. n.easeOutElastic = function(e, t, i, n) {
  30380. var r = 1.70158
  30381. , o = 0
  30382. , a = i;
  30383. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30384. a < Math.abs(i) ? (a = i,
  30385. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30386. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30387. }
  30388. ,
  30389. n.easeInOutElastic = function(e, t, i, n) {
  30390. var r = 1.70158
  30391. , o = 0
  30392. , a = i;
  30393. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30394. a < Math.abs(i) ? (a = i,
  30395. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30396. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  30397. }
  30398. ,
  30399. n.easeInBack = function(e, t, i, n, r) {
  30400. return void 0 === r && (r = 1.70158),
  30401. i * (e /= n) * e * ((r + 1) * e - r) + t
  30402. }
  30403. ,
  30404. n.easeOutBack = function(e, t, i, n, r) {
  30405. return void 0 === r && (r = 1.70158),
  30406. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30407. }
  30408. ,
  30409. n.easeInOutBack = function(e, t, i, n, r) {
  30410. return void 0 === r && (r = 1.70158),
  30411. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  30412. }
  30413. ,
  30414. n.easeOutBounce = function(e, t, i, n) {
  30415. 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
  30416. }
  30417. ,
  30418. n.easeInBounce = function(e, t, i, r) {
  30419. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30420. }
  30421. ,
  30422. n.easeInOutBounce = function(e, t, i, r) {
  30423. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  30424. }
  30425. ,
  30426. t.exports = n
  30427. }
  30428. , {}],
  30429. 187: [function(e, t, i) {
  30430. "use strict";
  30431. function n() {
  30432. this.events = [],
  30433. this.valid = !1
  30434. }
  30435. var r = e("../enum/Joystick");
  30436. n.prototype.push = function(e, t) {
  30437. this.events.push({
  30438. direction: e,
  30439. pano: t
  30440. }),
  30441. this.valid = !0
  30442. }
  30443. ,
  30444. n.prototype.pop = function(e) {
  30445. var t = this.events.pop();
  30446. return this.events.length < 1 && (this.valid = !1),
  30447. t
  30448. }
  30449. ,
  30450. n.prototype.peek = function() {
  30451. return this.events.length ? this.events[this.events.length - 1] : {
  30452. direction: null,
  30453. pano: null
  30454. }
  30455. }
  30456. ,
  30457. n.prototype.invalidate = function() {
  30458. this.events = [],
  30459. this.valid = !1
  30460. }
  30461. ,
  30462. n.prototype.reversePano = function(e) {
  30463. if (!this.valid)
  30464. return null;
  30465. var t = this.peek();
  30466. return r.opposite(e) === t.direction ? (this.pop(),
  30467. t.pano) : null
  30468. }
  30469. ,
  30470. t.exports = n
  30471. }
  30472. , {
  30473. "../enum/Joystick": 29
  30474. }],
  30475. 188: [function(e, t, i) {
  30476. "use strict";
  30477. t.exports = {
  30478. vector: function(e, t) {
  30479. var i = e.clone();
  30480. return t = t.clone(),
  30481. function(n) {
  30482. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30483. }
  30484. },
  30485. quaternion: function(e, t) {
  30486. var i = e.clone();
  30487. return function(n) {
  30488. e.copy(i).slerp(t, n)
  30489. }
  30490. },
  30491. property: function(e, t, i, n) {
  30492. var r = e[t];
  30493. return function(o) {
  30494. e[t] = r * (1 - o) + i * o,
  30495. n && n(e[t])
  30496. }
  30497. },
  30498. uniform: function(e, t, i) {
  30499. var n = e.material.uniforms[t].value;
  30500. return function(r) {
  30501. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30502. }
  30503. },
  30504. matrix4: function(e, t) {
  30505. var i = e.clone();
  30506. return function(n) {
  30507. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  30508. r[s] = o[s] * (1 - n) + a[s] * n
  30509. }
  30510. },
  30511. allUniforms: function(e, t, i) {
  30512. var n = e.map(function(e) {
  30513. return this.uniform(e, t, i)
  30514. }
  30515. .bind(this));
  30516. return function(e) {
  30517. n.forEach(function(t) {
  30518. t(e)
  30519. })
  30520. }
  30521. }
  30522. }
  30523. }
  30524. , {}],
  30525. 189: [function(e, t, i) {
  30526. "use strict";
  30527. function n(e) {
  30528. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  30529. if (n.consoleEnabled) {
  30530. var h = function(e) {
  30531. $("#debug-console").append("<p>" + e + "</p>"),
  30532. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  30533. };
  30534. t = function(e) {
  30535. h(Array.prototype.slice.call(arguments).join(" "))
  30536. }
  30537. ,
  30538. i = function(e) {
  30539. h(Array.prototype.slice.call(arguments).join(" "))
  30540. }
  30541. ,
  30542. o = function(e) {
  30543. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  30544. }
  30545. ,
  30546. a = function(e) {
  30547. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  30548. }
  30549. } else
  30550. console.log ? (t = console.log,
  30551. i = console.info ? console.info : console.log,
  30552. o = console.warn ? console.warn : console.log,
  30553. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  30554. ;
  30555. var u = function(e) {
  30556. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30557. }
  30558. , d = function(t, i) {
  30559. if (r) {
  30560. var o = Array.prototype.slice.call(t).join(" ");
  30561. r.captureMessage(o, {
  30562. level: i,
  30563. path: e,
  30564. timestamp: n.timestamp()
  30565. })
  30566. }
  30567. }
  30568. , p = function(t, i) {
  30569. if (r) {
  30570. var o = Array.prototype.slice.call(t).join(" ");
  30571. r.captureException(new Error(o), {
  30572. level: i,
  30573. path: e,
  30574. timestamp: n.timestamp()
  30575. })
  30576. }
  30577. };
  30578. return {
  30579. debug: function() {
  30580. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30581. },
  30582. info: function() {
  30583. n.level >= n.levels.info && i.apply(console, u(arguments))
  30584. },
  30585. warn: function() {
  30586. d(arguments, "warn"),
  30587. n.level >= n.levels.warn && o.apply(console, u(arguments))
  30588. },
  30589. error: function() {
  30590. p(arguments, "error"),
  30591. n.level >= n.levels.error && a.apply(console, u(arguments))
  30592. },
  30593. v3str: function(e, t) {
  30594. var i = void 0 === t ? 2 : t;
  30595. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  30596. },
  30597. eulstr: function(e, t) {
  30598. var i = void 0 === t ? 2 : t;
  30599. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30600. },
  30601. time: function(e) {
  30602. n.level >= n.levels.debug && (c[e] = Date.now())
  30603. },
  30604. timeEnd: function(e) {
  30605. if (n.level >= n.levels.debug) {
  30606. var t = c[e];
  30607. if (!t)
  30608. return;
  30609. var i = (Date.now() - t) / 1e3;
  30610. this.debug(e, i + "s")
  30611. }
  30612. }
  30613. }
  30614. }
  30615. var r = window.Raven;
  30616. n.timestamp = function() {
  30617. return (Date.now() - window.navigationStart) / 1e3 + "s"
  30618. }
  30619. ,
  30620. n.levels = {
  30621. debug: 3,
  30622. info: 2,
  30623. warn: 1,
  30624. error: 0
  30625. },
  30626. n.level = n.levels.info,
  30627. t.exports = n
  30628. }
  30629. , {}],
  30630. 190: [function(e, t, i) {
  30631. "use strict";
  30632. var n = e("three")
  30633. , r = e("../enum/GLCubeFaces")
  30634. , o = e("../constants");
  30635. t.exports = {
  30636. convertVisionVector: function(e) {
  30637. return new n.Vector3(e.x,e.z,-e.y)
  30638. },
  30639. convertVisionQuaternion: function(e) {
  30640. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  30641. },
  30642. convertWorkshopVector: function(e) {
  30643. return new n.Vector3(-e.x,e.y,e.z)
  30644. },
  30645. convertWorkshopQuaternion: function(e) {
  30646. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  30647. },
  30648. convertWorkshopPanoramaQuaternion: function(e) {
  30649. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  30650. },
  30651. convertWorkshopOrthoZoom: function(e) {// xzw
  30652. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30653. //return e;
  30654. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  30655. },
  30656. toPrecision: function(e, t) {//xzw change
  30657. var f = function(e, t){
  30658. var i = Math.pow(10, t);
  30659. return Math.round(e * i) / i
  30660. }
  30661. if(e instanceof Array){
  30662. for(var s=0; s<e.length; s++){
  30663. e[s] = f(e[s],t);
  30664. }
  30665. return e;
  30666. }
  30667. else return f(e,t)
  30668. },
  30669. isEmptyQuaternion: function(e) {
  30670. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30671. },
  30672. projectPositionToCanvas: function(e, t, i) {
  30673. i = i || new n.Vector3,
  30674. i.copy(e);
  30675. var r = .5 * $("#player").width()
  30676. , o = .5 * $("#player").height();
  30677. return i.project(t),
  30678. i.x = i.x * r + r,
  30679. i.y = -(i.y * o) + o,
  30680. i
  30681. },
  30682. convertScreenPositionToNDC: function(e, t, i) {
  30683. return i = i || new n.Vector2,
  30684. i.x = e / $("#player").width() * 2 - 1,
  30685. i.y = 2 * -(t / $("#player").height()) + 1,
  30686. i
  30687. },
  30688. constrainedTurn: function(e) {
  30689. var t = e % (2 * Math.PI);
  30690. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  30691. },
  30692. getFOVDotThreshold: function(e) {
  30693. return Math.cos(n.Math.degToRad(e / 2))
  30694. },
  30695. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  30696. switch (e) {
  30697. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30698. i.set(1, t.y, t.x);
  30699. break;
  30700. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30701. i.set(-1, t.y, -t.x);
  30702. break;
  30703. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30704. i.set(-t.x, 1, -t.y);
  30705. break;
  30706. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30707. i.set(-t.x, -1, t.y);
  30708. break;
  30709. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30710. i.set(-t.x, t.y, 1);
  30711. break;
  30712. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30713. i.set(t.x, t.y, -1)
  30714. }
  30715. n && i.normalize()
  30716. },
  30717. //add:
  30718. getPos2d : function(point, camera, dom){
  30719. var camera = camera ;
  30720. var dom = dom;
  30721. 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);
  30722. var x,y;
  30723. x = (pos.x + 1) / 2 * dom.clientWidth;
  30724. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  30725. var inSight = x <= dom.clientWidth && x >= 0
  30726. && y <= dom.clientHeight && y >= 0
  30727. return {
  30728. pos: new THREE.Vector2(x,y),
  30729. vector: pos,
  30730. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30731. inSight : inSight //在屏幕范围内可见
  30732. };
  30733. }
  30734. }
  30735. }
  30736. , {
  30737. "../constants": 8,
  30738. "../enum/GLCubeFaces": 25,
  30739. three: 217
  30740. }],
  30741. 191: [function(e, t, i) {
  30742. "use strict";
  30743. function n(e, t, i) {
  30744. return a.map(function(n, o) {
  30745. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  30746. }
  30747. .bind(this))
  30748. }
  30749. function r(e) {
  30750. return s[e]
  30751. }
  30752. var o = e("../enum/GLCubeFaces")
  30753. , a = [0, 1, 2, 3, 4, 5]
  30754. , s = {
  30755. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30756. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30757. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30758. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30759. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30760. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30761. };
  30762. t.exports = {
  30763. mapFaceToCubemapFace: r,
  30764. getCubemapUrls: n
  30765. }
  30766. }
  30767. , {
  30768. "../enum/GLCubeFaces": 25
  30769. }],
  30770. 192: [function(e, t, i) {
  30771. "use strict";
  30772. t.exports = {
  30773. captureErrors: function(e, t, i) {
  30774. if ("Raven"in window) {
  30775. Raven.config(e, t).install(),
  30776. i && Raven.setTagsContext(i);
  30777. var n = console.warn
  30778. , r = console.error;
  30779. console.warn = function() {
  30780. var e = Array.prototype.slice.call(arguments);
  30781. Raven.captureMessage(e.join(" "), {
  30782. level: "warning"
  30783. }),
  30784. n.apply(console, e)
  30785. }
  30786. ,
  30787. console.error = function() {
  30788. var e = Array.prototype.slice.call(arguments);
  30789. Raven.captureException(new Error(e.join(" ")), {
  30790. level: "error"
  30791. }),
  30792. r.apply(console, e)
  30793. }
  30794. } else
  30795. console.error("Raven not found, not capturing errors.")
  30796. }
  30797. }
  30798. }
  30799. , {}],
  30800. 193: [function(e, t, i) {
  30801. (function(i) {
  30802. "use strict";
  30803. var n = e("./browser")
  30804. , r = e("../constants")
  30805. , o = e("url")
  30806. , a = e("./logger")
  30807. , ss = e('three')
  30808. , s = new a(i)
  30809. , l = {
  30810. getAuthorizationHeader: function() {
  30811. var e = n.valueFromHash("auth");
  30812. if (e)
  30813. return e.replace(",", " ");
  30814. var t = n.valueFromCookie("token");
  30815. return t ? "Token " + t : null
  30816. },
  30817. parseSidUrl: function(e) {
  30818. var t, i;
  30819. t=g_Prefix;
  30820. if (e = e || "",
  30821. e.match(/^https?/)) {
  30822. var n = o.parse(e);
  30823. t = g_Prefix,
  30824. i = e
  30825. } else{
  30826. //xzw 原先的不能用
  30827. //t = window.location.protocol + "//" + window.location.host, //MP
  30828. t = g_Prefix
  30829. //i = t + "/api/player/models/" + e; //MP
  30830. i = t + "data/" + e;
  30831. }
  30832. return {
  30833. urlBase: t,
  30834. urlModel: i,
  30835. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  30836. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  30837. }
  30838. },
  30839. getModelIDFromQueryString: function() {
  30840. return n.valueFromHash("model") || n.valueFromHash("m")
  30841. },
  30842. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30843. e = JSON.parse(JSON.stringify(e));
  30844. var i = null;
  30845. if (e.images.forEach(function(n) {
  30846. if(!n.metadata) return;
  30847. if ("string" == typeof n.metadata)
  30848. try {
  30849. n.metadata = JSON.parse(n.metadata)
  30850. } catch (e) {
  30851. s.warn("Unable to parse image metadata"),
  30852. n.metadata = null
  30853. }
  30854. else{
  30855. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30856. }
  30857. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30858. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30859. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30860. }else{
  30861. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30862. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  30863. n.metadata.zoom = n.metadata.zoom || 1;
  30864. }
  30865. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30866. }),
  30867. //icon初始视角的:
  30868. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30869. var n = {};
  30870. n.pano = {
  30871. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30872. position: t.convertWorkshopVector(i.scan_position),
  30873. uuid: i.scan_id
  30874. },
  30875. n.camera = {
  30876. quaternion: i.camera_quaternion,
  30877. position: i.camera_position
  30878. },
  30879. e.startPano = n
  30880. }
  30881. return e
  30882. },
  30883. */
  30884. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30885. e = JSON.parse(JSON.stringify(e));
  30886. var i = null;
  30887. if (e.images.forEach(function(n) {
  30888. if(!n.metadata) return;
  30889. if ("string" == typeof n.metadata)
  30890. try {
  30891. n.metadata = JSON.parse(n.metadata)
  30892. } catch (e) {
  30893. s.warn("Unable to parse image metadata"),
  30894. n.metadata = null
  30895. }
  30896. else{
  30897. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30898. }
  30899. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30900. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30901. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30902. }else{
  30903. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  30904. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  30905. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30906. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position)) */
  30907. }
  30908. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30909. }),
  30910. //icon初始视角的:
  30911. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30912. var n = {};
  30913. n.pano = {
  30914. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30915. position: t.convertWorkshopVector(i.scan_position),
  30916. uuid: i.scan_id
  30917. },
  30918. n.camera = {
  30919. quaternion: i.camera_quaternion,
  30920. position: i.camera_position
  30921. },
  30922. e.startPano = n
  30923. }
  30924. return e
  30925. },
  30926. visionVersionToInt: function() {
  30927. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  30928. return function(t) {
  30929. if (!t)
  30930. throw new Error("Vision version is required");
  30931. var i = e.exec(t);
  30932. if (null === i)
  30933. throw new Error("String is not a vision version: " + t);
  30934. return parseInt(i[1])
  30935. }
  30936. }(),
  30937. modelDataPromisesTiles: function(e) {
  30938. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  30939. if (vision_version)
  30940. try {
  30941. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  30942. } catch (t) {
  30943. s.warn("Invalid vision version: " + vision_version)
  30944. }
  30945. // var t = e.created ? new Date(e.created) : null;
  30946. // return t && t >= r.visionTilingStartDate
  30947. return false
  30948. }
  30949. };
  30950. t.exports = l
  30951. }
  30952. ).call(this, "/js/util/showcase.js")
  30953. }
  30954. , {
  30955. "../constants": 8,
  30956. "./browser": 182,
  30957. "./logger": 189,
  30958. three:217,
  30959. url: 208
  30960. }],
  30961. 194: [function(e, t, i) {
  30962. "use strict";
  30963. var n = e("../util/ajax")
  30964. , r = e("three")
  30965. , o = e("../settings")
  30966. , a = {};
  30967. t.exports = {
  30968. load: function(e, t, i) {
  30969. var s = a[e];
  30970. return s ? (t && setTimeout(function() {
  30971. t(s)
  30972. }, 1),
  30973. s) : (s = new r.Texture,
  30974. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  30975. s.magFilter = r.LinearFilter,
  30976. s.generateMipmaps = !1),
  30977. s.sourceFile = e,
  30978. a[e] = s,
  30979. n.getImage(e).then(function(e) {
  30980. s.image = e,
  30981. s.needsUpdate = !0,
  30982. t && t(s)
  30983. }).fail(i),
  30984. s)
  30985. },
  30986. loadBase64: function(e, t) {
  30987. t = t || "png";
  30988. var i = new r.Texture;
  30989. return i.image = document.createElement("img"),
  30990. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  30991. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  30992. i.magFilter = r.LinearFilter,
  30993. i.generateMipmaps = !1),
  30994. i.needsUpdate = !0,
  30995. i
  30996. },
  30997. isLoaded: function(e) {
  30998. return !!a[e]
  30999. }
  31000. }
  31001. window.Texture = t.exports
  31002. }
  31003. , {
  31004. "../settings": 166,
  31005. "../util/ajax": 181,
  31006. three: 217
  31007. }],
  31008. 195: [function(e, t, i) {
  31009. "use strict";
  31010. var n = e("./easing");
  31011. t.exports = {
  31012. globalDone: null,
  31013. funcs: [],
  31014. counter: 0,
  31015. uniqueID: 0,
  31016. start: function(e, t, i, r, o, a, s) {
  31017. return r = r || 0,
  31018. this.funcs.push({
  31019. func: e,
  31020. current: -r * Math.abs(t),
  31021. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31022. done: i,
  31023. easing: o || n.linearTween,
  31024. cycling: t < 0,
  31025. running: !0,
  31026. debug: r < 0,
  31027. name: a || "T" + this.counter,
  31028. id: void 0 === s ? this.counter : s,
  31029. paused: !1
  31030. }),
  31031. e(0, 16),
  31032. this.counter += 1,
  31033. e
  31034. },
  31035. trigger: function(e) {
  31036. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31037. , i = e.func || function() {}
  31038. , r = void 0 === e.duration ? 0 : e.duration;
  31039. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31040. var o = e.done || null
  31041. , a = e.easing || n.linearTween
  31042. , s = e.name || "R" + this.counter
  31043. , l = void 0 === e.id ? this.counter : e.id;
  31044. return this.start(i, r, o, t, a, s, l)
  31045. },
  31046. setTimeout: function(e, t, i) {
  31047. var n = void 0 === i ? this.counter : i;
  31048. return this.trigger({
  31049. done: e,
  31050. duration: void 0 === t ? 0 : t,
  31051. name: "O" + this.counter,
  31052. id: n
  31053. })
  31054. },
  31055. pause: function() {
  31056. this.paused = !0
  31057. },
  31058. resume: function() {
  31059. this.paused = !1
  31060. },
  31061. update: function(e) {
  31062. this.funcs.forEach(function(t) {
  31063. if (!(t.paused || (t.current += 1e3 * e,
  31064. t.current < 0)))
  31065. if (t.current >= t.duration && !t.cycling) {
  31066. var i = t.easing(1, 0, 1, 1);
  31067. t.func(i, 1e3 * e),
  31068. t.done && t.done(),
  31069. t.running = !1
  31070. } else {
  31071. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31072. , r = t.func(n, 1e3 * e) || !1;
  31073. r && (t.done && t.done(),
  31074. t.running = !1)
  31075. }
  31076. });
  31077. var t = this.funcs.length;
  31078. this.funcs = this.funcs.filter(function(e) {
  31079. return e.running
  31080. });
  31081. var i = this.funcs.length;
  31082. if (t > 0 && 0 === i && this.globalDone) {
  31083. var n = this.globalDone;
  31084. this.globalDone = null,
  31085. n()
  31086. }
  31087. },
  31088. adjustSpeed: function(e, t) {
  31089. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31090. var r = i[n];
  31091. r.duration /= t,
  31092. r.current /= t
  31093. }
  31094. },
  31095. getById: function(e) {
  31096. return this.funcs.filter(function(t) {
  31097. return e === t.id
  31098. })
  31099. },
  31100. get: function(e) {
  31101. for (var t = 0; t < this.funcs.length; t += 1)
  31102. if (this.funcs[t].func === e)
  31103. return this.funcs[t];
  31104. return null
  31105. },
  31106. isRunning: function(e) {
  31107. var t = this.get(e);
  31108. return null !== t && t.running
  31109. },
  31110. countActive: function() {
  31111. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31112. e += this.funcs[t].running;
  31113. return e
  31114. },
  31115. listActive: function() {
  31116. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31117. this.funcs[t].running && e.push(this.funcs[t].name);
  31118. return e
  31119. },
  31120. done: function(e) {
  31121. this.globalDone = e
  31122. },
  31123. cancelById: function(e) {
  31124. var t = void 0 === e ? 0 : e;
  31125. this.funcs = this.funcs.filter(function(e) {
  31126. return e.id !== t
  31127. })
  31128. },
  31129. cancel: function(e) {
  31130. this.funcs = this.funcs.filter(function(t) {
  31131. return t.func !== e
  31132. })
  31133. },
  31134. getUniqueId: function() {
  31135. return this.uniqueID -= 1,
  31136. this.uniqueID
  31137. }
  31138. }
  31139. }
  31140. , {
  31141. "./easing": 186
  31142. }],
  31143. 196: [function(e, t, i) {
  31144. function n(e) {
  31145. if (this.set = {},
  31146. this.infContains = function() {
  31147. return !0
  31148. }
  31149. ,
  31150. "object" == typeof e)
  31151. if (e instanceof Array)
  31152. for (var t = 0; t < e.length; t++)
  31153. this.set[e[t]] = !0;
  31154. else
  31155. this.set = e;
  31156. else if ("function" == typeof e)
  31157. this.infContains = e;
  31158. else if ("undefined" != typeof e)
  31159. throw new Error("set must be either an array or an object.")
  31160. }
  31161. t.exports = n,
  31162. n.prototype.contains = function(e) {
  31163. return !!this.set[e]
  31164. }
  31165. ,
  31166. n.prototype.has = n.prototype.contains,
  31167. n.prototype.add = function(e) {
  31168. if (1 == arguments.length)
  31169. this.set[e] = !0;
  31170. else
  31171. for (var t = 0; t < arguments.length; t++)
  31172. this.set[arguments[t]] = !0
  31173. }
  31174. ,
  31175. n.prototype.addAll = function(e) {
  31176. if ("object" != typeof e && !(e instanceof Array))
  31177. throw new Error("arr must be an array.");
  31178. for (var t = 0; t < e.length; t++)
  31179. this.add(e[t])
  31180. }
  31181. ,
  31182. n.prototype.remove = function(e) {
  31183. if (1 == arguments.length)
  31184. delete this.set[e];
  31185. else
  31186. for (var t = 0; t < arguments.length; t++)
  31187. delete this.set[arguments[t]]
  31188. }
  31189. ,
  31190. n.prototype.delete = n.prototype.remove,
  31191. n.prototype.clear = function() {
  31192. this.set = {}
  31193. }
  31194. ,
  31195. n.prototype.size = function() {
  31196. return Object.keys(this.set).length
  31197. }
  31198. ,
  31199. n.prototype.toString = function() {
  31200. return "{" + Object.keys(this.set).toString() + "}"
  31201. }
  31202. ,
  31203. n.prototype.toArray = function() {
  31204. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31205. }
  31206. ,
  31207. n.prototype["*values"] = n.prototype.toArray
  31208. }
  31209. , {}],
  31210. 197: [function(e, t, i) {}
  31211. , {}],
  31212. 198: [function(e, t, i) {
  31213. (function(t) {
  31214. "use strict";
  31215. function n() {
  31216. try {
  31217. var e = new Uint8Array(1);
  31218. return e.__proto__ = {
  31219. __proto__: Uint8Array.prototype,
  31220. foo: function() {
  31221. return 42
  31222. }
  31223. },
  31224. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31225. } catch (e) {
  31226. return !1
  31227. }
  31228. }
  31229. function r() {
  31230. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31231. }
  31232. function o(e, t) {
  31233. if (r() < t)
  31234. throw new RangeError("Invalid typed array length");
  31235. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31236. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31237. e.length = t),
  31238. e
  31239. }
  31240. function a(e, t, i) {
  31241. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31242. return new a(e,t,i);
  31243. if ("number" == typeof e) {
  31244. if ("string" == typeof t)
  31245. throw new Error("If encoding is specified then the first argument must be a string");
  31246. return h(this, e)
  31247. }
  31248. return s(this, e, t, i)
  31249. }
  31250. function s(e, t, i, n) {
  31251. if ("number" == typeof t)
  31252. throw new TypeError('"value" argument must not be a number');
  31253. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31254. }
  31255. function l(e) {
  31256. if ("number" != typeof e)
  31257. throw new TypeError('"size" argument must be a number');
  31258. if (e < 0)
  31259. throw new RangeError('"size" argument must not be negative')
  31260. }
  31261. function c(e, t, i, n) {
  31262. return l(t),
  31263. 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)
  31264. }
  31265. function h(e, t) {
  31266. if (l(t),
  31267. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31268. !a.TYPED_ARRAY_SUPPORT)
  31269. for (var i = 0; i < t; ++i)
  31270. e[i] = 0;
  31271. return e
  31272. }
  31273. function u(e, t, i) {
  31274. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31275. !a.isEncoding(i))
  31276. throw new TypeError('"encoding" must be a valid string encoding');
  31277. var n = 0 | v(t, i);
  31278. e = o(e, n);
  31279. var r = e.write(t, i);
  31280. return r !== n && (e = e.slice(0, r)),
  31281. e
  31282. }
  31283. function d(e, t) {
  31284. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31285. e = o(e, i);
  31286. for (var n = 0; n < i; n += 1)
  31287. e[n] = 255 & t[n];
  31288. return e
  31289. }
  31290. function p(e, t, i, n) {
  31291. if (t.byteLength,
  31292. i < 0 || t.byteLength < i)
  31293. throw new RangeError("'offset' is out of bounds");
  31294. if (t.byteLength < i + (n || 0))
  31295. throw new RangeError("'length' is out of bounds");
  31296. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31297. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31298. e.__proto__ = a.prototype) : e = d(e, t),
  31299. e
  31300. }
  31301. function f(e, t) {
  31302. if (a.isBuffer(t)) {
  31303. var i = 0 | g(t.length);
  31304. return e = o(e, i),
  31305. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31306. e)
  31307. }
  31308. if (t) {
  31309. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31310. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31311. if ("Buffer" === t.type && $(t.data))
  31312. return d(e, t.data)
  31313. }
  31314. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31315. }
  31316. function g(e) {
  31317. if (e >= r())
  31318. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31319. return 0 | e
  31320. }
  31321. function m(e) {
  31322. return +e != e && (e = 0),
  31323. a.alloc(+e)
  31324. }
  31325. function v(e, t) {
  31326. if (a.isBuffer(e))
  31327. return e.length;
  31328. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31329. return e.byteLength;
  31330. "string" != typeof e && (e = "" + e);
  31331. var i = e.length;
  31332. if (0 === i)
  31333. return 0;
  31334. for (var n = !1; ; )
  31335. switch (t) {
  31336. case "ascii":
  31337. case "latin1":
  31338. case "binary":
  31339. return i;
  31340. case "utf8":
  31341. case "utf-8":
  31342. case void 0:
  31343. return j(e).length;
  31344. case "ucs2":
  31345. case "ucs-2":
  31346. case "utf16le":
  31347. case "utf-16le":
  31348. return 2 * i;
  31349. case "hex":
  31350. return i >>> 1;
  31351. case "base64":
  31352. return Z(e).length;
  31353. default:
  31354. if (n)
  31355. return j(e).length;
  31356. t = ("" + t).toLowerCase(),
  31357. n = !0
  31358. }
  31359. }
  31360. function A(e, t, i) {
  31361. var n = !1;
  31362. if ((void 0 === t || t < 0) && (t = 0),
  31363. t > this.length)
  31364. return "";
  31365. if ((void 0 === i || i > this.length) && (i = this.length),
  31366. i <= 0)
  31367. return "";
  31368. if (i >>>= 0,
  31369. t >>>= 0,
  31370. i <= t)
  31371. return "";
  31372. for (e || (e = "utf8"); ; )
  31373. switch (e) {
  31374. case "hex":
  31375. return L(this, t, i);
  31376. case "utf8":
  31377. case "utf-8":
  31378. return M(this, t, i);
  31379. case "ascii":
  31380. return P(this, t, i);
  31381. case "latin1":
  31382. case "binary":
  31383. return O(this, t, i);
  31384. case "base64":
  31385. return S(this, t, i);
  31386. case "ucs2":
  31387. case "ucs-2":
  31388. case "utf16le":
  31389. case "utf-16le":
  31390. return D(this, t, i);
  31391. default:
  31392. if (n)
  31393. throw new TypeError("Unknown encoding: " + e);
  31394. e = (e + "").toLowerCase(),
  31395. n = !0
  31396. }
  31397. }
  31398. function y(e, t, i) {
  31399. var n = e[t];
  31400. e[t] = e[i],
  31401. e[i] = n
  31402. }
  31403. function C(e, t, i, n, r) {
  31404. if (0 === e.length)
  31405. return -1;
  31406. if ("string" == typeof i ? (n = i,
  31407. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31408. i = +i,
  31409. isNaN(i) && (i = r ? 0 : e.length - 1),
  31410. i < 0 && (i = e.length + i),
  31411. i >= e.length) {
  31412. if (r)
  31413. return -1;
  31414. i = e.length - 1
  31415. } else if (i < 0) {
  31416. if (!r)
  31417. return -1;
  31418. i = 0
  31419. }
  31420. if ("string" == typeof t && (t = a.from(t, n)),
  31421. a.isBuffer(t))
  31422. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31423. if ("number" == typeof t)
  31424. return t &= 255,
  31425. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  31426. throw new TypeError("val must be string, number or Buffer")
  31427. }
  31428. function I(e, t, i, n, r) {
  31429. function o(e, t) {
  31430. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31431. }
  31432. var a = 1
  31433. , s = e.length
  31434. , l = t.length;
  31435. if (void 0 !== n && (n = String(n).toLowerCase(),
  31436. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31437. if (e.length < 2 || t.length < 2)
  31438. return -1;
  31439. a = 2,
  31440. s /= 2,
  31441. l /= 2,
  31442. i /= 2
  31443. }
  31444. var c;
  31445. if (r) {
  31446. var h = -1;
  31447. for (c = i; c < s; c++)
  31448. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31449. if (h === -1 && (h = c),
  31450. c - h + 1 === l)
  31451. return h * a
  31452. } else
  31453. h !== -1 && (c -= c - h),
  31454. h = -1
  31455. } else
  31456. for (i + l > s && (i = s - l),
  31457. c = i; c >= 0; c--) {
  31458. for (var u = !0, d = 0; d < l; d++)
  31459. if (o(e, c + d) !== o(t, d)) {
  31460. u = !1;
  31461. break
  31462. }
  31463. if (u)
  31464. return c
  31465. }
  31466. return -1
  31467. }
  31468. function E(e, t, i, n) {
  31469. i = Number(i) || 0;
  31470. var r = e.length - i;
  31471. n ? (n = Number(n),
  31472. n > r && (n = r)) : n = r;
  31473. var o = t.length;
  31474. if (o % 2 !== 0)
  31475. throw new TypeError("Invalid hex string");
  31476. n > o / 2 && (n = o / 2);
  31477. for (var a = 0; a < n; ++a) {
  31478. var s = parseInt(t.substr(2 * a, 2), 16);
  31479. if (isNaN(s))
  31480. return a;
  31481. e[i + a] = s
  31482. }
  31483. return a
  31484. }
  31485. function b(e, t, i, n) {
  31486. return q(j(t, e.length - i), e, i, n)
  31487. }
  31488. function w(e, t, i, n) {
  31489. return q(Y(t), e, i, n)
  31490. }
  31491. function _(e, t, i, n) {
  31492. return w(e, t, i, n)
  31493. }
  31494. function T(e, t, i, n) {
  31495. return q(Z(t), e, i, n)
  31496. }
  31497. function x(e, t, i, n) {
  31498. return q(X(t, e.length - i), e, i, n)
  31499. }
  31500. function S(e, t, i) {
  31501. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31502. }
  31503. function M(e, t, i) {
  31504. i = Math.min(e.length, i);
  31505. for (var n = [], r = t; r < i; ) {
  31506. var o = e[r]
  31507. , a = null
  31508. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  31509. if (r + s <= i) {
  31510. var l, c, h, u;
  31511. switch (s) {
  31512. case 1:
  31513. o < 128 && (a = o);
  31514. break;
  31515. case 2:
  31516. l = e[r + 1],
  31517. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  31518. u > 127 && (a = u));
  31519. break;
  31520. case 3:
  31521. l = e[r + 1],
  31522. c = e[r + 2],
  31523. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  31524. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  31525. break;
  31526. case 4:
  31527. l = e[r + 1],
  31528. c = e[r + 2],
  31529. h = e[r + 3],
  31530. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  31531. u > 65535 && u < 1114112 && (a = u))
  31532. }
  31533. }
  31534. null === a ? (a = 65533,
  31535. s = 1) : a > 65535 && (a -= 65536,
  31536. n.push(a >>> 10 & 1023 | 55296),
  31537. a = 56320 | 1023 & a),
  31538. n.push(a),
  31539. r += s
  31540. }
  31541. return R(n)
  31542. }
  31543. function R(e) {
  31544. var t = e.length;
  31545. if (t <= ee)
  31546. return String.fromCharCode.apply(String, e);
  31547. for (var i = "", n = 0; n < t; )
  31548. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  31549. return i
  31550. }
  31551. function P(e, t, i) {
  31552. var n = "";
  31553. i = Math.min(e.length, i);
  31554. for (var r = t; r < i; ++r)
  31555. n += String.fromCharCode(127 & e[r]);
  31556. return n
  31557. }
  31558. function O(e, t, i) {
  31559. var n = "";
  31560. i = Math.min(e.length, i);
  31561. for (var r = t; r < i; ++r)
  31562. n += String.fromCharCode(e[r]);
  31563. return n
  31564. }
  31565. function L(e, t, i) {
  31566. var n = e.length;
  31567. (!t || t < 0) && (t = 0),
  31568. (!i || i < 0 || i > n) && (i = n);
  31569. for (var r = "", o = t; o < i; ++o)
  31570. r += W(e[o]);
  31571. return r
  31572. }
  31573. function D(e, t, i) {
  31574. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  31575. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  31576. return r
  31577. }
  31578. function N(e, t, i) {
  31579. if (e % 1 !== 0 || e < 0)
  31580. throw new RangeError("offset is not uint");
  31581. if (e + t > i)
  31582. throw new RangeError("Trying to access beyond buffer length")
  31583. }
  31584. function B(e, t, i, n, r, o) {
  31585. if (!a.isBuffer(e))
  31586. throw new TypeError('"buffer" argument must be a Buffer instance');
  31587. if (t > r || t < o)
  31588. throw new RangeError('"value" argument is out of bounds');
  31589. if (i + n > e.length)
  31590. throw new RangeError("Index out of range")
  31591. }
  31592. function F(e, t, i, n) {
  31593. t < 0 && (t = 65535 + t + 1);
  31594. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  31595. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  31596. }
  31597. function V(e, t, i, n) {
  31598. t < 0 && (t = 4294967295 + t + 1);
  31599. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  31600. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  31601. }
  31602. function U(e, t, i, n, r, o) {
  31603. if (i + n > e.length)
  31604. throw new RangeError("Index out of range");
  31605. if (i < 0)
  31606. throw new RangeError("Index out of range")
  31607. }
  31608. function k(e, t, i, n, r) {
  31609. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  31610. J.write(e, t, i, n, 23, 4),
  31611. i + 4
  31612. }
  31613. function H(e, t, i, n, r) {
  31614. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  31615. J.write(e, t, i, n, 52, 8),
  31616. i + 8
  31617. }
  31618. function G(e) {
  31619. if (e = z(e).replace(te, ""),
  31620. e.length < 2)
  31621. return "";
  31622. for (; e.length % 4 !== 0; )
  31623. e += "=";
  31624. return e
  31625. }
  31626. function z(e) {
  31627. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  31628. }
  31629. function W(e) {
  31630. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  31631. }
  31632. function j(e, t) {
  31633. t = t || 1 / 0;
  31634. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31635. if (i = e.charCodeAt(a),
  31636. i > 55295 && i < 57344) {
  31637. if (!r) {
  31638. if (i > 56319) {
  31639. (t -= 3) > -1 && o.push(239, 191, 189);
  31640. continue
  31641. }
  31642. if (a + 1 === n) {
  31643. (t -= 3) > -1 && o.push(239, 191, 189);
  31644. continue
  31645. }
  31646. r = i;
  31647. continue
  31648. }
  31649. if (i < 56320) {
  31650. (t -= 3) > -1 && o.push(239, 191, 189),
  31651. r = i;
  31652. continue
  31653. }
  31654. i = (r - 55296 << 10 | i - 56320) + 65536
  31655. } else
  31656. r && (t -= 3) > -1 && o.push(239, 191, 189);
  31657. if (r = null,
  31658. i < 128) {
  31659. if ((t -= 1) < 0)
  31660. break;
  31661. o.push(i)
  31662. } else if (i < 2048) {
  31663. if ((t -= 2) < 0)
  31664. break;
  31665. o.push(i >> 6 | 192, 63 & i | 128)
  31666. } else if (i < 65536) {
  31667. if ((t -= 3) < 0)
  31668. break;
  31669. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  31670. } else {
  31671. if (!(i < 1114112))
  31672. throw new Error("Invalid code point");
  31673. if ((t -= 4) < 0)
  31674. break;
  31675. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  31676. }
  31677. }
  31678. return o
  31679. }
  31680. function Y(e) {
  31681. for (var t = [], i = 0; i < e.length; ++i)
  31682. t.push(255 & e.charCodeAt(i));
  31683. return t
  31684. }
  31685. function X(e, t) {
  31686. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  31687. i = e.charCodeAt(a),
  31688. n = i >> 8,
  31689. r = i % 256,
  31690. o.push(r),
  31691. o.push(n);
  31692. return o
  31693. }
  31694. function Z(e) {
  31695. return Q.toByteArray(G(e))
  31696. }
  31697. function q(e, t, i, n) {
  31698. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  31699. t[r + i] = e[r];
  31700. return r
  31701. }
  31702. function K(e) {
  31703. return e !== e
  31704. }
  31705. var Q = e("base64-js")
  31706. , J = e("ieee754")
  31707. , $ = e("isarray");
  31708. i.Buffer = a,
  31709. i.SlowBuffer = m,
  31710. i.INSPECT_MAX_BYTES = 50,
  31711. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  31712. i.kMaxLength = r(),
  31713. a.poolSize = 8192,
  31714. a._augment = function(e) {
  31715. return e.__proto__ = a.prototype,
  31716. e
  31717. }
  31718. ,
  31719. a.from = function(e, t, i) {
  31720. return s(null, e, t, i)
  31721. }
  31722. ,
  31723. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  31724. a.__proto__ = Uint8Array,
  31725. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  31726. value: null,
  31727. configurable: !0
  31728. })),
  31729. a.alloc = function(e, t, i) {
  31730. return c(null, e, t, i)
  31731. }
  31732. ,
  31733. a.allocUnsafe = function(e) {
  31734. return h(null, e)
  31735. }
  31736. ,
  31737. a.allocUnsafeSlow = function(e) {
  31738. return h(null, e)
  31739. }
  31740. ,
  31741. a.isBuffer = function(e) {
  31742. return !(null == e || !e._isBuffer)
  31743. }
  31744. ,
  31745. a.compare = function(e, t) {
  31746. if (!a.isBuffer(e) || !a.isBuffer(t))
  31747. throw new TypeError("Arguments must be Buffers");
  31748. if (e === t)
  31749. return 0;
  31750. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31751. if (e[r] !== t[r]) {
  31752. i = e[r],
  31753. n = t[r];
  31754. break
  31755. }
  31756. return i < n ? -1 : n < i ? 1 : 0
  31757. }
  31758. ,
  31759. a.isEncoding = function(e) {
  31760. switch (String(e).toLowerCase()) {
  31761. case "hex":
  31762. case "utf8":
  31763. case "utf-8":
  31764. case "ascii":
  31765. case "latin1":
  31766. case "binary":
  31767. case "base64":
  31768. case "ucs2":
  31769. case "ucs-2":
  31770. case "utf16le":
  31771. case "utf-16le":
  31772. return !0;
  31773. default:
  31774. return !1
  31775. }
  31776. }
  31777. ,
  31778. a.concat = function(e, t) {
  31779. if (!$(e))
  31780. throw new TypeError('"list" argument must be an Array of Buffers');
  31781. if (0 === e.length)
  31782. return a.alloc(0);
  31783. var i;
  31784. if (void 0 === t)
  31785. for (t = 0,
  31786. i = 0; i < e.length; ++i)
  31787. t += e[i].length;
  31788. var n = a.allocUnsafe(t)
  31789. , r = 0;
  31790. for (i = 0; i < e.length; ++i) {
  31791. var o = e[i];
  31792. if (!a.isBuffer(o))
  31793. throw new TypeError('"list" argument must be an Array of Buffers');
  31794. o.copy(n, r),
  31795. r += o.length
  31796. }
  31797. return n
  31798. }
  31799. ,
  31800. a.byteLength = v,
  31801. a.prototype._isBuffer = !0,
  31802. a.prototype.swap16 = function() {
  31803. var e = this.length;
  31804. if (e % 2 !== 0)
  31805. throw new RangeError("Buffer size must be a multiple of 16-bits");
  31806. for (var t = 0; t < e; t += 2)
  31807. y(this, t, t + 1);
  31808. return this
  31809. }
  31810. ,
  31811. a.prototype.swap32 = function() {
  31812. var e = this.length;
  31813. if (e % 4 !== 0)
  31814. throw new RangeError("Buffer size must be a multiple of 32-bits");
  31815. for (var t = 0; t < e; t += 4)
  31816. y(this, t, t + 3),
  31817. y(this, t + 1, t + 2);
  31818. return this
  31819. }
  31820. ,
  31821. a.prototype.swap64 = function() {
  31822. var e = this.length;
  31823. if (e % 8 !== 0)
  31824. throw new RangeError("Buffer size must be a multiple of 64-bits");
  31825. for (var t = 0; t < e; t += 8)
  31826. y(this, t, t + 7),
  31827. y(this, t + 1, t + 6),
  31828. y(this, t + 2, t + 5),
  31829. y(this, t + 3, t + 4);
  31830. return this
  31831. }
  31832. ,
  31833. a.prototype.toString = function() {
  31834. var e = 0 | this.length;
  31835. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31836. }
  31837. ,
  31838. a.prototype.equals = function(e) {
  31839. if (!a.isBuffer(e))
  31840. throw new TypeError("Argument must be a Buffer");
  31841. return this === e || 0 === a.compare(this, e)
  31842. }
  31843. ,
  31844. a.prototype.inspect = function() {
  31845. var e = ""
  31846. , t = i.INSPECT_MAX_BYTES;
  31847. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  31848. this.length > t && (e += " ... ")),
  31849. "<Buffer " + e + ">"
  31850. }
  31851. ,
  31852. a.prototype.compare = function(e, t, i, n, r) {
  31853. if (!a.isBuffer(e))
  31854. throw new TypeError("Argument must be a Buffer");
  31855. if (void 0 === t && (t = 0),
  31856. void 0 === i && (i = e ? e.length : 0),
  31857. void 0 === n && (n = 0),
  31858. void 0 === r && (r = this.length),
  31859. t < 0 || i > e.length || n < 0 || r > this.length)
  31860. throw new RangeError("out of range index");
  31861. if (n >= r && t >= i)
  31862. return 0;
  31863. if (n >= r)
  31864. return -1;
  31865. if (t >= i)
  31866. return 1;
  31867. if (t >>>= 0,
  31868. i >>>= 0,
  31869. n >>>= 0,
  31870. r >>>= 0,
  31871. this === e)
  31872. return 0;
  31873. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  31874. if (c[u] !== h[u]) {
  31875. o = c[u],
  31876. s = h[u];
  31877. break
  31878. }
  31879. return o < s ? -1 : s < o ? 1 : 0
  31880. }
  31881. ,
  31882. a.prototype.includes = function(e, t, i) {
  31883. return this.indexOf(e, t, i) !== -1
  31884. }
  31885. ,
  31886. a.prototype.indexOf = function(e, t, i) {
  31887. return C(this, e, t, i, !0)
  31888. }
  31889. ,
  31890. a.prototype.lastIndexOf = function(e, t, i) {
  31891. return C(this, e, t, i, !1)
  31892. }
  31893. ,
  31894. a.prototype.write = function(e, t, i, n) {
  31895. if (void 0 === t)
  31896. n = "utf8",
  31897. i = this.length,
  31898. t = 0;
  31899. else if (void 0 === i && "string" == typeof t)
  31900. n = t,
  31901. i = this.length,
  31902. t = 0;
  31903. else {
  31904. if (!isFinite(t))
  31905. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  31906. t |= 0,
  31907. isFinite(i) ? (i |= 0,
  31908. void 0 === n && (n = "utf8")) : (n = i,
  31909. i = void 0)
  31910. }
  31911. var r = this.length - t;
  31912. if ((void 0 === i || i > r) && (i = r),
  31913. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  31914. throw new RangeError("Attempt to write outside buffer bounds");
  31915. n || (n = "utf8");
  31916. for (var o = !1; ; )
  31917. switch (n) {
  31918. case "hex":
  31919. return E(this, e, t, i);
  31920. case "utf8":
  31921. case "utf-8":
  31922. return b(this, e, t, i);
  31923. case "ascii":
  31924. return w(this, e, t, i);
  31925. case "latin1":
  31926. case "binary":
  31927. return _(this, e, t, i);
  31928. case "base64":
  31929. return T(this, e, t, i);
  31930. case "ucs2":
  31931. case "ucs-2":
  31932. case "utf16le":
  31933. case "utf-16le":
  31934. return x(this, e, t, i);
  31935. default:
  31936. if (o)
  31937. throw new TypeError("Unknown encoding: " + n);
  31938. n = ("" + n).toLowerCase(),
  31939. o = !0
  31940. }
  31941. }
  31942. ,
  31943. a.prototype.toJSON = function() {
  31944. return {
  31945. type: "Buffer",
  31946. data: Array.prototype.slice.call(this._arr || this, 0)
  31947. }
  31948. }
  31949. ;
  31950. var ee = 4096;
  31951. a.prototype.slice = function(e, t) {
  31952. var i = this.length;
  31953. e = ~~e,
  31954. t = void 0 === t ? i : ~~t,
  31955. e < 0 ? (e += i,
  31956. e < 0 && (e = 0)) : e > i && (e = i),
  31957. t < 0 ? (t += i,
  31958. t < 0 && (t = 0)) : t > i && (t = i),
  31959. t < e && (t = e);
  31960. var n;
  31961. if (a.TYPED_ARRAY_SUPPORT)
  31962. n = this.subarray(e, t),
  31963. n.__proto__ = a.prototype;
  31964. else {
  31965. var r = t - e;
  31966. n = new a(r,void 0);
  31967. for (var o = 0; o < r; ++o)
  31968. n[o] = this[o + e]
  31969. }
  31970. return n
  31971. }
  31972. ,
  31973. a.prototype.readUIntLE = function(e, t, i) {
  31974. e |= 0,
  31975. t |= 0,
  31976. i || N(e, t, this.length);
  31977. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31978. n += this[e + o] * r;
  31979. return n
  31980. }
  31981. ,
  31982. a.prototype.readUIntBE = function(e, t, i) {
  31983. e |= 0,
  31984. t |= 0,
  31985. i || N(e, t, this.length);
  31986. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  31987. n += this[e + --t] * r;
  31988. return n
  31989. }
  31990. ,
  31991. a.prototype.readUInt8 = function(e, t) {
  31992. return t || N(e, 1, this.length),
  31993. this[e]
  31994. }
  31995. ,
  31996. a.prototype.readUInt16LE = function(e, t) {
  31997. return t || N(e, 2, this.length),
  31998. this[e] | this[e + 1] << 8
  31999. }
  32000. ,
  32001. a.prototype.readUInt16BE = function(e, t) {
  32002. return t || N(e, 2, this.length),
  32003. this[e] << 8 | this[e + 1]
  32004. }
  32005. ,
  32006. a.prototype.readUInt32LE = function(e, t) {
  32007. return t || N(e, 4, this.length),
  32008. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32009. }
  32010. ,
  32011. a.prototype.readUInt32BE = function(e, t) {
  32012. return t || N(e, 4, this.length),
  32013. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32014. }
  32015. ,
  32016. a.prototype.readIntLE = function(e, t, i) {
  32017. e |= 0,
  32018. t |= 0,
  32019. i || N(e, t, this.length);
  32020. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32021. n += this[e + o] * r;
  32022. return r *= 128,
  32023. n >= r && (n -= Math.pow(2, 8 * t)),
  32024. n
  32025. }
  32026. ,
  32027. a.prototype.readIntBE = function(e, t, i) {
  32028. e |= 0,
  32029. t |= 0,
  32030. i || N(e, t, this.length);
  32031. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32032. o += this[e + --n] * r;
  32033. return r *= 128,
  32034. o >= r && (o -= Math.pow(2, 8 * t)),
  32035. o
  32036. }
  32037. ,
  32038. a.prototype.readInt8 = function(e, t) {
  32039. return t || N(e, 1, this.length),
  32040. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32041. }
  32042. ,
  32043. a.prototype.readInt16LE = function(e, t) {
  32044. t || N(e, 2, this.length);
  32045. var i = this[e] | this[e + 1] << 8;
  32046. return 32768 & i ? 4294901760 | i : i
  32047. }
  32048. ,
  32049. a.prototype.readInt16BE = function(e, t) {
  32050. t || N(e, 2, this.length);
  32051. var i = this[e + 1] | this[e] << 8;
  32052. return 32768 & i ? 4294901760 | i : i
  32053. }
  32054. ,
  32055. a.prototype.readInt32LE = function(e, t) {
  32056. return t || N(e, 4, this.length),
  32057. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32058. }
  32059. ,
  32060. a.prototype.readInt32BE = function(e, t) {
  32061. return t || N(e, 4, this.length),
  32062. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32063. }
  32064. ,
  32065. a.prototype.readFloatLE = function(e, t) {
  32066. return t || N(e, 4, this.length),
  32067. J.read(this, e, !0, 23, 4)
  32068. }
  32069. ,
  32070. a.prototype.readFloatBE = function(e, t) {
  32071. return t || N(e, 4, this.length),
  32072. J.read(this, e, !1, 23, 4)
  32073. }
  32074. ,
  32075. a.prototype.readDoubleLE = function(e, t) {
  32076. return t || N(e, 8, this.length),
  32077. J.read(this, e, !0, 52, 8)
  32078. }
  32079. ,
  32080. a.prototype.readDoubleBE = function(e, t) {
  32081. return t || N(e, 8, this.length),
  32082. J.read(this, e, !1, 52, 8)
  32083. }
  32084. ,
  32085. a.prototype.writeUIntLE = function(e, t, i, n) {
  32086. if (e = +e,
  32087. t |= 0,
  32088. i |= 0,
  32089. !n) {
  32090. var r = Math.pow(2, 8 * i) - 1;
  32091. B(this, e, t, i, r, 0)
  32092. }
  32093. var o = 1
  32094. , a = 0;
  32095. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32096. this[t + a] = e / o & 255;
  32097. return t + i
  32098. }
  32099. ,
  32100. a.prototype.writeUIntBE = function(e, t, i, n) {
  32101. if (e = +e,
  32102. t |= 0,
  32103. i |= 0,
  32104. !n) {
  32105. var r = Math.pow(2, 8 * i) - 1;
  32106. B(this, e, t, i, r, 0)
  32107. }
  32108. var o = i - 1
  32109. , a = 1;
  32110. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32111. this[t + o] = e / a & 255;
  32112. return t + i
  32113. }
  32114. ,
  32115. a.prototype.writeUInt8 = function(e, t, i) {
  32116. return e = +e,
  32117. t |= 0,
  32118. i || B(this, e, t, 1, 255, 0),
  32119. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32120. this[t] = 255 & e,
  32121. t + 1
  32122. }
  32123. ,
  32124. a.prototype.writeUInt16LE = function(e, t, i) {
  32125. return e = +e,
  32126. t |= 0,
  32127. i || B(this, e, t, 2, 65535, 0),
  32128. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32129. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32130. t + 2
  32131. }
  32132. ,
  32133. a.prototype.writeUInt16BE = function(e, t, i) {
  32134. return e = +e,
  32135. t |= 0,
  32136. i || B(this, e, t, 2, 65535, 0),
  32137. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32138. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32139. t + 2
  32140. }
  32141. ,
  32142. a.prototype.writeUInt32LE = function(e, t, i) {
  32143. return e = +e,
  32144. t |= 0,
  32145. i || B(this, e, t, 4, 4294967295, 0),
  32146. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32147. this[t + 2] = e >>> 16,
  32148. this[t + 1] = e >>> 8,
  32149. this[t] = 255 & e) : V(this, e, t, !0),
  32150. t + 4
  32151. }
  32152. ,
  32153. a.prototype.writeUInt32BE = function(e, t, i) {
  32154. return e = +e,
  32155. t |= 0,
  32156. i || B(this, e, t, 4, 4294967295, 0),
  32157. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32158. this[t + 1] = e >>> 16,
  32159. this[t + 2] = e >>> 8,
  32160. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32161. t + 4
  32162. }
  32163. ,
  32164. a.prototype.writeIntLE = function(e, t, i, n) {
  32165. if (e = +e,
  32166. t |= 0,
  32167. !n) {
  32168. var r = Math.pow(2, 8 * i - 1);
  32169. B(this, e, t, i, r - 1, -r)
  32170. }
  32171. var o = 0
  32172. , a = 1
  32173. , s = 0;
  32174. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32175. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32176. this[t + o] = (e / a >> 0) - s & 255;
  32177. return t + i
  32178. }
  32179. ,
  32180. a.prototype.writeIntBE = function(e, t, i, n) {
  32181. if (e = +e,
  32182. t |= 0,
  32183. !n) {
  32184. var r = Math.pow(2, 8 * i - 1);
  32185. B(this, e, t, i, r - 1, -r)
  32186. }
  32187. var o = i - 1
  32188. , a = 1
  32189. , s = 0;
  32190. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32191. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32192. this[t + o] = (e / a >> 0) - s & 255;
  32193. return t + i
  32194. }
  32195. ,
  32196. a.prototype.writeInt8 = function(e, t, i) {
  32197. return e = +e,
  32198. t |= 0,
  32199. i || B(this, e, t, 1, 127, -128),
  32200. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32201. e < 0 && (e = 255 + e + 1),
  32202. this[t] = 255 & e,
  32203. t + 1
  32204. }
  32205. ,
  32206. a.prototype.writeInt16LE = function(e, t, i) {
  32207. return e = +e,
  32208. t |= 0,
  32209. i || B(this, e, t, 2, 32767, -32768),
  32210. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32211. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32212. t + 2
  32213. }
  32214. ,
  32215. a.prototype.writeInt16BE = function(e, t, i) {
  32216. return e = +e,
  32217. t |= 0,
  32218. i || B(this, e, t, 2, 32767, -32768),
  32219. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32220. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32221. t + 2
  32222. }
  32223. ,
  32224. a.prototype.writeInt32LE = function(e, t, i) {
  32225. return e = +e,
  32226. t |= 0,
  32227. i || B(this, e, t, 4, 2147483647, -2147483648),
  32228. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32229. this[t + 1] = e >>> 8,
  32230. this[t + 2] = e >>> 16,
  32231. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32232. t + 4
  32233. }
  32234. ,
  32235. a.prototype.writeInt32BE = function(e, t, i) {
  32236. return e = +e,
  32237. t |= 0,
  32238. i || B(this, e, t, 4, 2147483647, -2147483648),
  32239. e < 0 && (e = 4294967295 + e + 1),
  32240. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32241. this[t + 1] = e >>> 16,
  32242. this[t + 2] = e >>> 8,
  32243. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32244. t + 4
  32245. }
  32246. ,
  32247. a.prototype.writeFloatLE = function(e, t, i) {
  32248. return k(this, e, t, !0, i)
  32249. }
  32250. ,
  32251. a.prototype.writeFloatBE = function(e, t, i) {
  32252. return k(this, e, t, !1, i)
  32253. }
  32254. ,
  32255. a.prototype.writeDoubleLE = function(e, t, i) {
  32256. return H(this, e, t, !0, i)
  32257. }
  32258. ,
  32259. a.prototype.writeDoubleBE = function(e, t, i) {
  32260. return H(this, e, t, !1, i)
  32261. }
  32262. ,
  32263. a.prototype.copy = function(e, t, i, n) {
  32264. if (i || (i = 0),
  32265. n || 0 === n || (n = this.length),
  32266. t >= e.length && (t = e.length),
  32267. t || (t = 0),
  32268. n > 0 && n < i && (n = i),
  32269. n === i)
  32270. return 0;
  32271. if (0 === e.length || 0 === this.length)
  32272. return 0;
  32273. if (t < 0)
  32274. throw new RangeError("targetStart out of bounds");
  32275. if (i < 0 || i >= this.length)
  32276. throw new RangeError("sourceStart out of bounds");
  32277. if (n < 0)
  32278. throw new RangeError("sourceEnd out of bounds");
  32279. n > this.length && (n = this.length),
  32280. e.length - t < n - i && (n = e.length - t + i);
  32281. var r, o = n - i;
  32282. if (this === e && i < t && t < n)
  32283. for (r = o - 1; r >= 0; --r)
  32284. e[r + t] = this[r + i];
  32285. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32286. for (r = 0; r < o; ++r)
  32287. e[r + t] = this[r + i];
  32288. else
  32289. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32290. return o
  32291. }
  32292. ,
  32293. a.prototype.fill = function(e, t, i, n) {
  32294. if ("string" == typeof e) {
  32295. if ("string" == typeof t ? (n = t,
  32296. t = 0,
  32297. i = this.length) : "string" == typeof i && (n = i,
  32298. i = this.length),
  32299. 1 === e.length) {
  32300. var r = e.charCodeAt(0);
  32301. r < 256 && (e = r)
  32302. }
  32303. if (void 0 !== n && "string" != typeof n)
  32304. throw new TypeError("encoding must be a string");
  32305. if ("string" == typeof n && !a.isEncoding(n))
  32306. throw new TypeError("Unknown encoding: " + n)
  32307. } else
  32308. "number" == typeof e && (e &= 255);
  32309. if (t < 0 || this.length < t || this.length < i)
  32310. throw new RangeError("Out of range index");
  32311. if (i <= t)
  32312. return this;
  32313. t >>>= 0,
  32314. i = void 0 === i ? this.length : i >>> 0,
  32315. e || (e = 0);
  32316. var o;
  32317. if ("number" == typeof e)
  32318. for (o = t; o < i; ++o)
  32319. this[o] = e;
  32320. else {
  32321. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32322. , l = s.length;
  32323. for (o = 0; o < i - t; ++o)
  32324. this[o + t] = s[o % l]
  32325. }
  32326. return this
  32327. }
  32328. ;
  32329. var te = /[^+\/0-9A-Za-z-_]/g
  32330. }
  32331. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32332. }
  32333. , {
  32334. "base64-js": 199,
  32335. ieee754: 200,
  32336. isarray: 201
  32337. }],
  32338. 199: [function(e, t, i) {
  32339. "use strict";
  32340. function n(e) {
  32341. var t = e.length;
  32342. if (t % 4 > 0)
  32343. throw new Error("Invalid string. Length must be a multiple of 4");
  32344. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32345. }
  32346. function r(e) {
  32347. return 3 * e.length / 4 - n(e)
  32348. }
  32349. function o(e) {
  32350. var t, i, r, o, a, s, l = e.length;
  32351. a = n(e),
  32352. s = new u(3 * l / 4 - a),
  32353. r = a > 0 ? l - 4 : l;
  32354. var c = 0;
  32355. for (t = 0,
  32356. i = 0; t < r; t += 4,
  32357. i += 3)
  32358. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32359. s[c++] = o >> 16 & 255,
  32360. s[c++] = o >> 8 & 255,
  32361. s[c++] = 255 & o;
  32362. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32363. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32364. s[c++] = o >> 8 & 255,
  32365. s[c++] = 255 & o),
  32366. s
  32367. }
  32368. function a(e) {
  32369. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32370. }
  32371. function s(e, t, i) {
  32372. for (var n, r = [], o = t; o < i; o += 3)
  32373. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32374. r.push(a(n));
  32375. return r.join("")
  32376. }
  32377. function l(e) {
  32378. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32379. o.push(s(e, l, l + a > h ? h : l + a));
  32380. return 1 === n ? (t = e[i - 1],
  32381. r += c[t >> 2],
  32382. r += c[t << 4 & 63],
  32383. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32384. r += c[t >> 10],
  32385. r += c[t >> 4 & 63],
  32386. r += c[t << 2 & 63],
  32387. r += "="),
  32388. o.push(r),
  32389. o.join("")
  32390. }
  32391. i.byteLength = r,
  32392. i.toByteArray = o,
  32393. i.fromByteArray = l;
  32394. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32395. c[p] = d[p],
  32396. h[d.charCodeAt(p)] = p;
  32397. h["-".charCodeAt(0)] = 62,
  32398. h["_".charCodeAt(0)] = 63
  32399. }
  32400. , {}],
  32401. 200: [function(e, t, i) {
  32402. i.read = function(e, t, i, n, r) {
  32403. 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];
  32404. for (u += d,
  32405. o = p & (1 << -h) - 1,
  32406. p >>= -h,
  32407. h += s; h > 0; o = 256 * o + e[t + u],
  32408. u += d,
  32409. h -= 8)
  32410. ;
  32411. for (a = o & (1 << -h) - 1,
  32412. o >>= -h,
  32413. h += n; h > 0; a = 256 * a + e[t + u],
  32414. u += d,
  32415. h -= 8)
  32416. ;
  32417. if (0 === o)
  32418. o = 1 - c;
  32419. else {
  32420. if (o === l)
  32421. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32422. a += Math.pow(2, n),
  32423. o -= c
  32424. }
  32425. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32426. }
  32427. ,
  32428. i.write = function(e, t, i, n, r, o) {
  32429. 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;
  32430. for (t = Math.abs(t),
  32431. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32432. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32433. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32434. l *= 2),
  32435. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32436. t * l >= 2 && (a++,
  32437. l /= 2),
  32438. a + u >= h ? (s = 0,
  32439. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32440. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32441. a = 0)); r >= 8; e[i + p] = 255 & s,
  32442. p += f,
  32443. s /= 256,
  32444. r -= 8)
  32445. ;
  32446. for (a = a << r | s,
  32447. c += r; c > 0; e[i + p] = 255 & a,
  32448. p += f,
  32449. a /= 256,
  32450. c -= 8)
  32451. ;
  32452. e[i + p - f] |= 128 * g
  32453. }
  32454. }
  32455. , {}],
  32456. 201: [function(e, t, i) {
  32457. var n = {}.toString;
  32458. t.exports = Array.isArray || function(e) {
  32459. return "[object Array]" == n.call(e)
  32460. }
  32461. }
  32462. , {}],
  32463. 202: [function(e, t, i) {
  32464. function n() {
  32465. this._events = this._events || {},
  32466. this._maxListeners = this._maxListeners || void 0
  32467. }
  32468. function r(e) {
  32469. return "function" == typeof e
  32470. }
  32471. function o(e) {
  32472. return "number" == typeof e
  32473. }
  32474. function a(e) {
  32475. return "object" == typeof e && null !== e
  32476. }
  32477. function s(e) {
  32478. return void 0 === e
  32479. }
  32480. t.exports = n,
  32481. n.EventEmitter = n,
  32482. n.prototype._events = void 0,
  32483. n.prototype._maxListeners = void 0,
  32484. n.defaultMaxListeners = 10,
  32485. n.prototype.setMaxListeners = function(e) {
  32486. if (!o(e) || e < 0 || isNaN(e))
  32487. throw TypeError("n must be a positive number");
  32488. return this._maxListeners = e,
  32489. this
  32490. }
  32491. ,
  32492. n.prototype.emit = function(e) {
  32493. var t, i, n, o, l, c;
  32494. if (this._events || (this._events = {}),
  32495. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  32496. if (t = arguments[1],
  32497. t instanceof Error)
  32498. throw t;
  32499. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  32500. throw h.context = t,
  32501. h
  32502. }
  32503. if (i = this._events[e],
  32504. s(i))
  32505. return !1;
  32506. if (r(i))
  32507. switch (arguments.length) {
  32508. case 1:
  32509. i.call(this);
  32510. break;
  32511. case 2:
  32512. i.call(this, arguments[1]);
  32513. break;
  32514. case 3:
  32515. i.call(this, arguments[1], arguments[2]);
  32516. break;
  32517. default:
  32518. o = Array.prototype.slice.call(arguments, 1),
  32519. i.apply(this, o)
  32520. }
  32521. else if (a(i))
  32522. for (o = Array.prototype.slice.call(arguments, 1),
  32523. c = i.slice(),
  32524. n = c.length,
  32525. l = 0; l < n; l++)
  32526. c[l].apply(this, o);
  32527. return !0
  32528. }
  32529. ,
  32530. n.prototype.addListener = function(e, t) {
  32531. var i;
  32532. if (!r(t))
  32533. throw TypeError("listener must be a function");
  32534. return this._events || (this._events = {}),
  32535. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  32536. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  32537. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  32538. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  32539. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  32540. "function" == typeof console.trace && console.trace())),
  32541. this
  32542. }
  32543. ,
  32544. n.prototype.on = n.prototype.addListener,
  32545. n.prototype.once = function(e, t) {
  32546. function i() {
  32547. this.removeListener(e, i),
  32548. n || (n = !0,
  32549. t.apply(this, arguments))
  32550. }
  32551. if (!r(t))
  32552. throw TypeError("listener must be a function");
  32553. var n = !1;
  32554. return i.listener = t,
  32555. this.on(e, i),
  32556. this
  32557. }
  32558. ,
  32559. n.prototype.removeListener = function(e, t) {
  32560. var i, n, o, s;
  32561. if (!r(t))
  32562. throw TypeError("listener must be a function");
  32563. if (!this._events || !this._events[e])
  32564. return this;
  32565. if (i = this._events[e],
  32566. o = i.length,
  32567. n = -1,
  32568. i === t || r(i.listener) && i.listener === t)
  32569. delete this._events[e],
  32570. this._events.removeListener && this.emit("removeListener", e, t);
  32571. else if (a(i)) {
  32572. for (s = o; s-- > 0; )
  32573. if (i[s] === t || i[s].listener && i[s].listener === t) {
  32574. n = s;
  32575. break
  32576. }
  32577. if (n < 0)
  32578. return this;
  32579. 1 === i.length ? (i.length = 0,
  32580. delete this._events[e]) : i.splice(n, 1),
  32581. this._events.removeListener && this.emit("removeListener", e, t)
  32582. }
  32583. return this
  32584. }
  32585. ,
  32586. n.prototype.removeAllListeners = function(e) {
  32587. var t, i;
  32588. if (!this._events)
  32589. return this;
  32590. if (!this._events.removeListener)
  32591. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  32592. this;
  32593. if (0 === arguments.length) {
  32594. for (t in this._events)
  32595. "removeListener" !== t && this.removeAllListeners(t);
  32596. return this.removeAllListeners("removeListener"),
  32597. this._events = {},
  32598. this
  32599. }
  32600. if (i = this._events[e],
  32601. r(i))
  32602. this.removeListener(e, i);
  32603. else if (i)
  32604. for (; i.length; )
  32605. this.removeListener(e, i[i.length - 1]);
  32606. return delete this._events[e],
  32607. this
  32608. }
  32609. ,
  32610. n.prototype.listeners = function(e) {
  32611. var t;
  32612. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  32613. }
  32614. ,
  32615. n.prototype.listenerCount = function(e) {
  32616. if (this._events) {
  32617. var t = this._events[e];
  32618. if (r(t))
  32619. return 1;
  32620. if (t)
  32621. return t.length
  32622. }
  32623. return 0
  32624. }
  32625. ,
  32626. n.listenerCount = function(e, t) {
  32627. return e.listenerCount(t)
  32628. }
  32629. }
  32630. , {}],
  32631. 203: [function(e, t, i) {
  32632. function n() {
  32633. throw new Error("setTimeout has not been defined")
  32634. }
  32635. function r() {
  32636. throw new Error("clearTimeout has not been defined")
  32637. }
  32638. function o(e) {
  32639. if (u === setTimeout)
  32640. return setTimeout(e, 0);
  32641. if ((u === n || !u) && setTimeout)
  32642. return u = setTimeout,
  32643. setTimeout(e, 0);
  32644. try {
  32645. return u(e, 0)
  32646. } catch (t) {
  32647. try {
  32648. return u.call(null, e, 0)
  32649. } catch (t) {
  32650. return u.call(this, e, 0)
  32651. }
  32652. }
  32653. }
  32654. function a(e) {
  32655. if (d === clearTimeout)
  32656. return clearTimeout(e);
  32657. if ((d === r || !d) && clearTimeout)
  32658. return d = clearTimeout,
  32659. clearTimeout(e);
  32660. try {
  32661. return d(e)
  32662. } catch (t) {
  32663. try {
  32664. return d.call(null, e)
  32665. } catch (t) {
  32666. return d.call(this, e)
  32667. }
  32668. }
  32669. }
  32670. function s() {
  32671. m && f && (m = !1,
  32672. f.length ? g = f.concat(g) : v = -1,
  32673. g.length && l())
  32674. }
  32675. function l() {
  32676. if (!m) {
  32677. var e = o(s);
  32678. m = !0;
  32679. for (var t = g.length; t; ) {
  32680. for (f = g,
  32681. g = []; ++v < t; )
  32682. f && f[v].run();
  32683. v = -1,
  32684. t = g.length
  32685. }
  32686. f = null,
  32687. m = !1,
  32688. a(e)
  32689. }
  32690. }
  32691. function c(e, t) {
  32692. this.fun = e,
  32693. this.array = t
  32694. }
  32695. function h() {}
  32696. var u, d, p = t.exports = {};
  32697. !function() {
  32698. try {
  32699. u = "function" == typeof setTimeout ? setTimeout : n
  32700. } catch (e) {
  32701. u = n
  32702. }
  32703. try {
  32704. d = "function" == typeof clearTimeout ? clearTimeout : r
  32705. } catch (e) {
  32706. d = r
  32707. }
  32708. }();
  32709. var f, g = [], m = !1, v = -1;
  32710. p.nextTick = function(e) {
  32711. var t = new Array(arguments.length - 1);
  32712. if (arguments.length > 1)
  32713. for (var i = 1; i < arguments.length; i++)
  32714. t[i - 1] = arguments[i];
  32715. g.push(new c(e,t)),
  32716. 1 !== g.length || m || o(l)
  32717. }
  32718. ,
  32719. c.prototype.run = function() {
  32720. this.fun.apply(null, this.array)
  32721. }
  32722. ,
  32723. p.title = "browser",
  32724. p.browser = !0,
  32725. p.env = {},
  32726. p.argv = [],
  32727. p.version = "",
  32728. p.versions = {},
  32729. p.on = h,
  32730. p.addListener = h,
  32731. p.once = h,
  32732. p.off = h,
  32733. p.removeListener = h,
  32734. p.removeAllListeners = h,
  32735. p.emit = h,
  32736. p.binding = function(e) {
  32737. throw new Error("process.binding is not supported")
  32738. }
  32739. ,
  32740. p.cwd = function() {
  32741. return "/"
  32742. }
  32743. ,
  32744. p.chdir = function(e) {
  32745. throw new Error("process.chdir is not supported")
  32746. }
  32747. ,
  32748. p.umask = function() {
  32749. return 0
  32750. }
  32751. }
  32752. , {}],
  32753. 204: [function(e, t, i) {
  32754. (function(e) {
  32755. !function(n) {
  32756. function r(e) {
  32757. throw new RangeError(L[e])
  32758. }
  32759. function o(e, t) {
  32760. for (var i = e.length, n = []; i--; )
  32761. n[i] = t(e[i]);
  32762. return n
  32763. }
  32764. function a(e, t) {
  32765. var i = e.split("@")
  32766. , n = "";
  32767. i.length > 1 && (n = i[0] + "@",
  32768. e = i[1]),
  32769. e = e.replace(O, ".");
  32770. var r = e.split(".")
  32771. , a = o(r, t).join(".");
  32772. return n + a
  32773. }
  32774. function s(e) {
  32775. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32776. t = e.charCodeAt(r++),
  32777. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  32778. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  32779. r--)) : n.push(t);
  32780. return n
  32781. }
  32782. function l(e) {
  32783. return o(e, function(e) {
  32784. var t = "";
  32785. return e > 65535 && (e -= 65536,
  32786. t += B(e >>> 10 & 1023 | 55296),
  32787. e = 56320 | 1023 & e),
  32788. t += B(e)
  32789. }).join("")
  32790. }
  32791. function c(e) {
  32792. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32793. }
  32794. function h(e, t) {
  32795. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32796. }
  32797. function u(e, t, i) {
  32798. var n = 0;
  32799. for (e = i ? N(e / T) : e >> 1,
  32800. e += N(e / t); e > D * w >> 1; n += E)
  32801. e = N(e / D);
  32802. return N(n + (D + 1) * e / (e + _))
  32803. }
  32804. function d(e) {
  32805. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  32806. for (i = e.lastIndexOf(M),
  32807. i < 0 && (i = 0),
  32808. n = 0; n < i; ++n)
  32809. e.charCodeAt(n) >= 128 && r("not-basic"),
  32810. g.push(e.charCodeAt(n));
  32811. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32812. for (a = v,
  32813. s = 1,
  32814. h = E; o >= m && r("invalid-input"),
  32815. d = c(e.charCodeAt(o++)),
  32816. (d >= E || d > N((I - v) / s)) && r("overflow"),
  32817. v += d * s,
  32818. p = h <= y ? b : h >= y + w ? w : h - y,
  32819. !(d < p); h += E)
  32820. f = E - p,
  32821. s > N(I / f) && r("overflow"),
  32822. s *= f;
  32823. t = g.length + 1,
  32824. y = u(v - a, t, 0 == a),
  32825. N(v / t) > I - A && r("overflow"),
  32826. A += N(v / t),
  32827. v %= t,
  32828. g.splice(v++, 0, A)
  32829. }
  32830. return l(g)
  32831. }
  32832. function p(e) {
  32833. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  32834. for (e = s(e),
  32835. m = e.length,
  32836. t = S,
  32837. i = 0,
  32838. a = x,
  32839. l = 0; l < m; ++l)
  32840. g = e[l],
  32841. g < 128 && C.push(B(g));
  32842. for (n = o = C.length,
  32843. o && C.push(M); n < m; ) {
  32844. for (c = I,
  32845. l = 0; l < m; ++l)
  32846. g = e[l],
  32847. g >= t && g < c && (c = g);
  32848. for (v = n + 1,
  32849. c - t > N((I - i) / v) && r("overflow"),
  32850. i += (c - t) * v,
  32851. t = c,
  32852. l = 0; l < m; ++l)
  32853. if (g = e[l],
  32854. g < t && ++i > I && r("overflow"),
  32855. g == t) {
  32856. for (d = i,
  32857. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  32858. !(d < f); p += E)
  32859. y = d - f,
  32860. A = E - f,
  32861. C.push(B(h(f + y % A, 0))),
  32862. d = N(y / A);
  32863. C.push(B(h(d, 0))),
  32864. a = u(i, v, n == o),
  32865. i = 0,
  32866. ++n
  32867. }
  32868. ++i,
  32869. ++t
  32870. }
  32871. return C.join("")
  32872. }
  32873. function f(e) {
  32874. return a(e, function(e) {
  32875. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32876. })
  32877. }
  32878. function g(e) {
  32879. return a(e, function(e) {
  32880. return P.test(e) ? "xn--" + p(e) : e
  32881. })
  32882. }
  32883. var m = "object" == typeof i && i && !i.nodeType && i
  32884. , v = "object" == typeof t && t && !t.nodeType && t
  32885. , A = "object" == typeof e && e;
  32886. A.global !== A && A.window !== A && A.self !== A || (n = A);
  32887. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  32888. overflow: "Overflow: input needs wider integers to process",
  32889. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  32890. "invalid-input": "Invalid input"
  32891. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  32892. if (y = {
  32893. version: "1.4.1",
  32894. ucs2: {
  32895. decode: s,
  32896. encode: l
  32897. },
  32898. decode: d,
  32899. encode: p,
  32900. toASCII: g,
  32901. toUnicode: f
  32902. },
  32903. "function" == typeof define && "object" == typeof define.amd && define.amd)
  32904. define("punycode", function() {
  32905. return y
  32906. });
  32907. else if (m && v)
  32908. if (t.exports == m)
  32909. v.exports = y;
  32910. else
  32911. for (C in y)
  32912. y.hasOwnProperty(C) && (m[C] = y[C]);
  32913. else
  32914. n.punycode = y
  32915. }(this)
  32916. }
  32917. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32918. }
  32919. , {}],
  32920. 205: [function(e, t, i) {
  32921. "use strict";
  32922. function n(e, t) {
  32923. return Object.prototype.hasOwnProperty.call(e, t)
  32924. }
  32925. t.exports = function(e, t, i, o) {
  32926. t = t || "&",
  32927. i = i || "=";
  32928. var a = {};
  32929. if ("string" != typeof e || 0 === e.length)
  32930. return a;
  32931. var s = /\+/g;
  32932. e = e.split(t);
  32933. var l = 1e3;
  32934. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  32935. var c = e.length;
  32936. l > 0 && c > l && (c = l);
  32937. for (var h = 0; h < c; ++h) {
  32938. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  32939. m >= 0 ? (u = g.substr(0, m),
  32940. d = g.substr(m + 1)) : (u = g,
  32941. d = ""),
  32942. p = decodeURIComponent(u),
  32943. f = decodeURIComponent(d),
  32944. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  32945. }
  32946. return a
  32947. }
  32948. ;
  32949. var r = Array.isArray || function(e) {
  32950. return "[object Array]" === Object.prototype.toString.call(e)
  32951. }
  32952. }
  32953. , {}],
  32954. 206: [function(e, t, i) {
  32955. "use strict";
  32956. function n(e, t) {
  32957. if (e.map)
  32958. return e.map(t);
  32959. for (var i = [], n = 0; n < e.length; n++)
  32960. i.push(t(e[n], n));
  32961. return i
  32962. }
  32963. var r = function(e) {
  32964. switch (typeof e) {
  32965. case "string":
  32966. return e;
  32967. case "boolean":
  32968. return e ? "true" : "false";
  32969. case "number":
  32970. return isFinite(e) ? e : "";
  32971. default:
  32972. return ""
  32973. }
  32974. };
  32975. t.exports = function(e, t, i, s) {
  32976. return t = t || "&",
  32977. i = i || "=",
  32978. null === e && (e = void 0),
  32979. "object" == typeof e ? n(a(e), function(a) {
  32980. var s = encodeURIComponent(r(a)) + i;
  32981. return o(e[a]) ? n(e[a], function(e) {
  32982. return s + encodeURIComponent(r(e))
  32983. }).join(t) : s + encodeURIComponent(r(e[a]))
  32984. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  32985. }
  32986. ;
  32987. var o = Array.isArray || function(e) {
  32988. return "[object Array]" === Object.prototype.toString.call(e)
  32989. }
  32990. , a = Object.keys || function(e) {
  32991. var t = [];
  32992. for (var i in e)
  32993. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  32994. return t
  32995. }
  32996. }
  32997. , {}],
  32998. 207: [function(e, t, i) {
  32999. "use strict";
  33000. i.decode = i.parse = e("./decode"),
  33001. i.encode = i.stringify = e("./encode")
  33002. }
  33003. , {
  33004. "./decode": 205,
  33005. "./encode": 206
  33006. }],
  33007. 208: [function(e, t, i) {
  33008. "use strict";
  33009. function n() {
  33010. this.protocol = null,
  33011. this.slashes = null,
  33012. this.auth = null,
  33013. this.host = null,
  33014. this.port = null,
  33015. this.hostname = null,
  33016. this.hash = null,
  33017. this.search = null,
  33018. this.query = null,
  33019. this.pathname = null,
  33020. this.path = null,
  33021. this.href = null
  33022. }
  33023. function r(e, t, i) {
  33024. if (e && c.isObject(e) && e instanceof n)
  33025. return e;
  33026. var r = new n;
  33027. return r.parse(e, t, i),
  33028. r
  33029. }
  33030. function o(e) {
  33031. return c.isString(e) && (e = r(e)),
  33032. e instanceof n ? e.format() : n.prototype.format.call(e)
  33033. }
  33034. function a(e, t) {
  33035. return r(e, !1, !0).resolve(t)
  33036. }
  33037. function s(e, t) {
  33038. return e ? r(e, !1, !0).resolveObject(t) : t
  33039. }
  33040. var l = e("punycode")
  33041. , c = e("./util");
  33042. i.parse = r,
  33043. i.resolve = a,
  33044. i.resolveObject = s,
  33045. i.format = o,
  33046. i.Url = n;
  33047. var h = /^([a-z0-9.+-]+:)/i
  33048. , u = /:[0-9]*$/
  33049. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33050. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33051. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33052. , g = ["'"].concat(f)
  33053. , m = ["%", "/", "?", ";", "#"].concat(g)
  33054. , v = ["/", "?", "#"]
  33055. , A = 255
  33056. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33057. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33058. , I = {
  33059. javascript: !0,
  33060. "javascript:": !0
  33061. }
  33062. , E = {
  33063. javascript: !0,
  33064. "javascript:": !0
  33065. }
  33066. , b = {
  33067. http: !0,
  33068. https: !0,
  33069. ftp: !0,
  33070. gopher: !0,
  33071. file: !0,
  33072. "http:": !0,
  33073. "https:": !0,
  33074. "ftp:": !0,
  33075. "gopher:": !0,
  33076. "file:": !0
  33077. }
  33078. , w = e("querystring");
  33079. n.prototype.parse = function(e, t, i) {
  33080. if (!c.isString(e))
  33081. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33082. var n = e.indexOf("?")
  33083. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33084. , o = e.split(r)
  33085. , a = /\\/g;
  33086. o[0] = o[0].replace(a, "/"),
  33087. e = o.join(r);
  33088. var s = e;
  33089. if (s = s.trim(),
  33090. !i && 1 === e.split("#").length) {
  33091. var u = d.exec(s);
  33092. if (u)
  33093. return this.path = s,
  33094. this.href = s,
  33095. this.pathname = u[1],
  33096. u[2] ? (this.search = u[2],
  33097. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33098. this.query = {}),
  33099. this
  33100. }
  33101. var p = h.exec(s);
  33102. if (p) {
  33103. p = p[0];
  33104. var f = p.toLowerCase();
  33105. this.protocol = f,
  33106. s = s.substr(p.length)
  33107. }
  33108. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33109. var _ = "//" === s.substr(0, 2);
  33110. !_ || p && E[p] || (s = s.substr(2),
  33111. this.slashes = !0)
  33112. }
  33113. if (!E[p] && (_ || p && !b[p])) {
  33114. for (var T = -1, x = 0; x < v.length; x++) {
  33115. var S = s.indexOf(v[x]);
  33116. S !== -1 && (T === -1 || S < T) && (T = S)
  33117. }
  33118. var M, R;
  33119. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33120. R !== -1 && (M = s.slice(0, R),
  33121. s = s.slice(R + 1),
  33122. this.auth = decodeURIComponent(M)),
  33123. T = -1;
  33124. for (var x = 0; x < m.length; x++) {
  33125. var S = s.indexOf(m[x]);
  33126. S !== -1 && (T === -1 || S < T) && (T = S)
  33127. }
  33128. T === -1 && (T = s.length),
  33129. this.host = s.slice(0, T),
  33130. s = s.slice(T),
  33131. this.parseHost(),
  33132. this.hostname = this.hostname || "";
  33133. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33134. if (!P)
  33135. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33136. var D = O[x];
  33137. if (D && !D.match(y)) {
  33138. for (var N = "", B = 0, F = D.length; B < F; B++)
  33139. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33140. if (!N.match(y)) {
  33141. var V = O.slice(0, x)
  33142. , U = O.slice(x + 1)
  33143. , k = D.match(C);
  33144. k && (V.push(k[1]),
  33145. U.unshift(k[2])),
  33146. U.length && (s = "/" + U.join(".") + s),
  33147. this.hostname = V.join(".");
  33148. break
  33149. }
  33150. }
  33151. }
  33152. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33153. P || (this.hostname = l.toASCII(this.hostname));
  33154. var H = this.port ? ":" + this.port : ""
  33155. , G = this.hostname || "";
  33156. this.host = G + H,
  33157. this.href += this.host,
  33158. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33159. "/" !== s[0] && (s = "/" + s))
  33160. }
  33161. if (!I[f])
  33162. for (var x = 0, L = g.length; x < L; x++) {
  33163. var z = g[x];
  33164. if (s.indexOf(z) !== -1) {
  33165. var W = encodeURIComponent(z);
  33166. W === z && (W = escape(z)),
  33167. s = s.split(z).join(W)
  33168. }
  33169. }
  33170. var j = s.indexOf("#");
  33171. j !== -1 && (this.hash = s.substr(j),
  33172. s = s.slice(0, j));
  33173. var Y = s.indexOf("?");
  33174. if (Y !== -1 ? (this.search = s.substr(Y),
  33175. this.query = s.substr(Y + 1),
  33176. t && (this.query = w.parse(this.query)),
  33177. s = s.slice(0, Y)) : t && (this.search = "",
  33178. this.query = {}),
  33179. s && (this.pathname = s),
  33180. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33181. this.pathname || this.search) {
  33182. var H = this.pathname || ""
  33183. , X = this.search || "";
  33184. this.path = H + X
  33185. }
  33186. return this.href = this.format(),
  33187. this
  33188. }
  33189. ,
  33190. n.prototype.format = function() {
  33191. var e = this.auth || "";
  33192. e && (e = encodeURIComponent(e),
  33193. e = e.replace(/%3A/i, ":"),
  33194. e += "@");
  33195. var t = this.protocol || ""
  33196. , i = this.pathname || ""
  33197. , n = this.hash || ""
  33198. , r = !1
  33199. , o = "";
  33200. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33201. this.port && (r += ":" + this.port)),
  33202. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33203. var a = this.search || o && "?" + o || "";
  33204. return t && ":" !== t.substr(-1) && (t += ":"),
  33205. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33206. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33207. n && "#" !== n.charAt(0) && (n = "#" + n),
  33208. a && "?" !== a.charAt(0) && (a = "?" + a),
  33209. i = i.replace(/[?#]/g, function(e) {
  33210. return encodeURIComponent(e)
  33211. }),
  33212. a = a.replace("#", "%23"),
  33213. t + r + i + a + n
  33214. }
  33215. ,
  33216. n.prototype.resolve = function(e) {
  33217. return this.resolveObject(r(e, !1, !0)).format()
  33218. }
  33219. ,
  33220. n.prototype.resolveObject = function(e) {
  33221. if (c.isString(e)) {
  33222. var t = new n;
  33223. t.parse(e, !1, !0),
  33224. e = t
  33225. }
  33226. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33227. var a = r[o];
  33228. i[a] = this[a]
  33229. }
  33230. if (i.hash = e.hash,
  33231. "" === e.href)
  33232. return i.href = i.format(),
  33233. i;
  33234. if (e.slashes && !e.protocol) {
  33235. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33236. var h = s[l];
  33237. "protocol" !== h && (i[h] = e[h])
  33238. }
  33239. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33240. i.href = i.format(),
  33241. i
  33242. }
  33243. if (e.protocol && e.protocol !== i.protocol) {
  33244. if (!b[e.protocol]) {
  33245. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33246. var p = u[d];
  33247. i[p] = e[p]
  33248. }
  33249. return i.href = i.format(),
  33250. i
  33251. }
  33252. if (i.protocol = e.protocol,
  33253. e.host || E[e.protocol])
  33254. i.pathname = e.pathname;
  33255. else {
  33256. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33257. ;
  33258. e.host || (e.host = ""),
  33259. e.hostname || (e.hostname = ""),
  33260. "" !== f[0] && f.unshift(""),
  33261. f.length < 2 && f.unshift(""),
  33262. i.pathname = f.join("/")
  33263. }
  33264. if (i.search = e.search,
  33265. i.query = e.query,
  33266. i.host = e.host || "",
  33267. i.auth = e.auth,
  33268. i.hostname = e.hostname || e.host,
  33269. i.port = e.port,
  33270. i.pathname || i.search) {
  33271. var g = i.pathname || ""
  33272. , m = i.search || "";
  33273. i.path = g + m
  33274. }
  33275. return i.slashes = i.slashes || e.slashes,
  33276. i.href = i.format(),
  33277. i
  33278. }
  33279. var v = i.pathname && "/" === i.pathname.charAt(0)
  33280. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33281. , y = A || v || i.host && e.pathname
  33282. , C = y
  33283. , I = i.pathname && i.pathname.split("/") || []
  33284. , f = e.pathname && e.pathname.split("/") || []
  33285. , w = i.protocol && !b[i.protocol];
  33286. if (w && (i.hostname = "",
  33287. i.port = null,
  33288. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33289. i.host = "",
  33290. e.protocol && (e.hostname = null,
  33291. e.port = null,
  33292. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33293. e.host = null),
  33294. y = y && ("" === f[0] || "" === I[0])),
  33295. A)
  33296. i.host = e.host || "" === e.host ? e.host : i.host,
  33297. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33298. i.search = e.search,
  33299. i.query = e.query,
  33300. I = f;
  33301. else if (f.length)
  33302. I || (I = []),
  33303. I.pop(),
  33304. I = I.concat(f),
  33305. i.search = e.search,
  33306. i.query = e.query;
  33307. else if (!c.isNullOrUndefined(e.search)) {
  33308. if (w) {
  33309. i.hostname = i.host = I.shift();
  33310. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33311. _ && (i.auth = _.shift(),
  33312. i.host = i.hostname = _.shift())
  33313. }
  33314. return i.search = e.search,
  33315. i.query = e.query,
  33316. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33317. i.href = i.format(),
  33318. i
  33319. }
  33320. if (!I.length)
  33321. return i.pathname = null,
  33322. i.search ? i.path = "/" + i.search : i.path = null,
  33323. i.href = i.format(),
  33324. i;
  33325. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  33326. T = I[M],
  33327. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33328. S++) : S && (I.splice(M, 1),
  33329. S--);
  33330. if (!y && !C)
  33331. for (; S--; S)
  33332. I.unshift("..");
  33333. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33334. x && "/" !== I.join("/").substr(-1) && I.push("");
  33335. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33336. if (w) {
  33337. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33338. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33339. _ && (i.auth = _.shift(),
  33340. i.host = i.hostname = _.shift())
  33341. }
  33342. return y = y || i.host && I.length,
  33343. y && !R && I.unshift(""),
  33344. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33345. i.path = null),
  33346. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33347. i.auth = e.auth || i.auth,
  33348. i.slashes = i.slashes || e.slashes,
  33349. i.href = i.format(),
  33350. i
  33351. }
  33352. ,
  33353. n.prototype.parseHost = function() {
  33354. var e = this.host
  33355. , t = u.exec(e);
  33356. t && (t = t[0],
  33357. ":" !== t && (this.port = t.substr(1)),
  33358. e = e.substr(0, e.length - t.length)),
  33359. e && (this.hostname = e)
  33360. }
  33361. }
  33362. , {
  33363. "./util": 209,
  33364. punycode: 204,
  33365. querystring: 207
  33366. }],
  33367. 209: [function(e, t, i) {
  33368. "use strict";
  33369. t.exports = {
  33370. isString: function(e) {
  33371. return "string" == typeof e
  33372. },
  33373. isObject: function(e) {
  33374. return "object" == typeof e && null !== e
  33375. },
  33376. isNull: function(e) {
  33377. return null === e
  33378. },
  33379. isNullOrUndefined: function(e) {
  33380. return null == e
  33381. }
  33382. }
  33383. }
  33384. , {}],
  33385. 210: [function(e, t, i) {
  33386. "use strict";
  33387. function n(e) {
  33388. return l + e
  33389. }
  33390. function r(e) {
  33391. return e.substring(l.length)
  33392. }
  33393. function o(e, t) {
  33394. for (var i in t)
  33395. Object.defineProperty(e, i, {
  33396. value: t[i],
  33397. configurable: !0,
  33398. writable: !0
  33399. })
  33400. }
  33401. function a(e) {
  33402. if ("string" != typeof e)
  33403. throw new TypeError("key must be a string.")
  33404. }
  33405. var s = Object.prototype.hasOwnProperty
  33406. , l = "~";
  33407. t.exports = function(e) {
  33408. var t = Object.create(null)
  33409. , i = 0
  33410. , l = {};
  33411. return o(l, {
  33412. get: function(e, i) {
  33413. a(e);
  33414. var r = n(e);
  33415. return r in t ? t[r] : i
  33416. },
  33417. set: function(e, r) {
  33418. a(e);
  33419. var o = n(e);
  33420. return o in t || ++i,
  33421. t[o] = r
  33422. },
  33423. has: function(e) {
  33424. return a(e),
  33425. n(e)in t
  33426. },
  33427. delete: function(e) {
  33428. a(e);
  33429. var r = n(e);
  33430. return r in t && (--i,
  33431. delete t[r],
  33432. !0)
  33433. },
  33434. clear: function() {
  33435. t = Object.create(null),
  33436. i = 0
  33437. },
  33438. forEach: function(e, i) {
  33439. if ("function" != typeof e)
  33440. throw new TypeError("`callback` must be a function");
  33441. for (var n in t)
  33442. if (s.call(t, n)) {
  33443. var o = r(n)
  33444. , a = t[n];
  33445. e.call(i, a, o, l)
  33446. }
  33447. }
  33448. }),
  33449. Object.defineProperty(l, "size", {
  33450. get: function() {
  33451. return i
  33452. },
  33453. configurable: !0
  33454. }),
  33455. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  33456. l.set(t, e[t])
  33457. }),
  33458. l
  33459. }
  33460. }
  33461. , {}],
  33462. 211: [function(e, t, i) {
  33463. t.exports = e("./lib/heap")
  33464. }
  33465. , {
  33466. "./lib/heap": 212
  33467. }],
  33468. 212: [function(e, t, i) {
  33469. (function() {
  33470. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  33471. r = Math.floor,
  33472. u = Math.min,
  33473. n = function(e, t) {
  33474. return e < t ? -1 : e > t ? 1 : 0
  33475. }
  33476. ,
  33477. h = function(e, t, i, o, a) {
  33478. var s;
  33479. if (null == i && (i = 0),
  33480. null == a && (a = n),
  33481. i < 0)
  33482. throw new Error("lo must be non-negative");
  33483. for (null == o && (o = e.length); i < o; )
  33484. s = r((i + o) / 2),
  33485. a(t, e[s]) < 0 ? o = s : i = s + 1;
  33486. return [].splice.apply(e, [i, i - i].concat(t)),
  33487. t
  33488. }
  33489. ,
  33490. s = function(e, t, i) {
  33491. return null == i && (i = n),
  33492. e.push(t),
  33493. g(e, 0, e.length - 1, i)
  33494. }
  33495. ,
  33496. a = function(e, t) {
  33497. var i, r;
  33498. return null == t && (t = n),
  33499. i = e.pop(),
  33500. e.length ? (r = e[0],
  33501. e[0] = i,
  33502. m(e, 0, t)) : r = i,
  33503. r
  33504. }
  33505. ,
  33506. c = function(e, t, i) {
  33507. var r;
  33508. return null == i && (i = n),
  33509. r = e[0],
  33510. e[0] = t,
  33511. m(e, 0, i),
  33512. r
  33513. }
  33514. ,
  33515. l = function(e, t, i) {
  33516. var r;
  33517. return null == i && (i = n),
  33518. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  33519. t = r[0],
  33520. e[0] = r[1],
  33521. m(e, 0, i)),
  33522. t
  33523. }
  33524. ,
  33525. o = function(e, t) {
  33526. var i, o, a, s, l, c;
  33527. for (null == t && (t = n),
  33528. s = function() {
  33529. c = [];
  33530. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  33531. c.push(t);
  33532. return c
  33533. }
  33534. .apply(this).reverse(),
  33535. l = [],
  33536. o = 0,
  33537. a = s.length; o < a; o++)
  33538. i = s[o],
  33539. l.push(m(e, i, t));
  33540. return l
  33541. }
  33542. ,
  33543. f = function(e, t, i) {
  33544. var r;
  33545. if (null == i && (i = n),
  33546. r = e.indexOf(t),
  33547. r !== -1)
  33548. return g(e, 0, r, i),
  33549. m(e, r, i)
  33550. }
  33551. ,
  33552. d = function(e, t, i) {
  33553. var r, a, s, c, h;
  33554. if (null == i && (i = n),
  33555. a = e.slice(0, t),
  33556. !a.length)
  33557. return a;
  33558. for (o(a, i),
  33559. h = e.slice(t),
  33560. s = 0,
  33561. c = h.length; s < c; s++)
  33562. r = h[s],
  33563. l(a, r, i);
  33564. return a.sort(i).reverse()
  33565. }
  33566. ,
  33567. p = function(e, t, i) {
  33568. var r, s, l, c, d, p, f, g, m, v;
  33569. if (null == i && (i = n),
  33570. 10 * t <= e.length) {
  33571. if (c = e.slice(0, t).sort(i),
  33572. !c.length)
  33573. return c;
  33574. for (l = c[c.length - 1],
  33575. g = e.slice(t),
  33576. d = 0,
  33577. f = g.length; d < f; d++)
  33578. r = g[d],
  33579. i(r, l) < 0 && (h(c, r, 0, null, i),
  33580. c.pop(),
  33581. l = c[c.length - 1]);
  33582. return c
  33583. }
  33584. for (o(e, i),
  33585. v = [],
  33586. s = p = 0,
  33587. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  33588. v.push(a(e, i));
  33589. return v
  33590. }
  33591. ,
  33592. g = function(e, t, i, r) {
  33593. var o, a, s;
  33594. for (null == r && (r = n),
  33595. o = e[i]; i > t && (s = i - 1 >> 1,
  33596. a = e[s],
  33597. r(o, a) < 0); )
  33598. e[i] = a,
  33599. i = s;
  33600. return e[i] = o
  33601. }
  33602. ,
  33603. m = function(e, t, i) {
  33604. var r, o, a, s, l;
  33605. for (null == i && (i = n),
  33606. o = e.length,
  33607. l = t,
  33608. a = e[t],
  33609. r = 2 * t + 1; r < o; )
  33610. s = r + 1,
  33611. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  33612. e[t] = e[r],
  33613. t = r,
  33614. r = 2 * t + 1;
  33615. return e[t] = a,
  33616. g(e, l, t, i)
  33617. }
  33618. ,
  33619. e = function() {
  33620. function e(e) {
  33621. this.cmp = null != e ? e : n,
  33622. this.nodes = []
  33623. }
  33624. return e.push = s,
  33625. e.pop = a,
  33626. e.replace = c,
  33627. e.pushpop = l,
  33628. e.heapify = o,
  33629. e.updateItem = f,
  33630. e.nlargest = d,
  33631. e.nsmallest = p,
  33632. e.prototype.push = function(e) {
  33633. return s(this.nodes, e, this.cmp)
  33634. }
  33635. ,
  33636. e.prototype.pop = function() {
  33637. return a(this.nodes, this.cmp)
  33638. }
  33639. ,
  33640. e.prototype.peek = function() {
  33641. return this.nodes[0]
  33642. }
  33643. ,
  33644. e.prototype.contains = function(e) {
  33645. return this.nodes.indexOf(e) !== -1
  33646. }
  33647. ,
  33648. e.prototype.replace = function(e) {
  33649. return c(this.nodes, e, this.cmp)
  33650. }
  33651. ,
  33652. e.prototype.pushpop = function(e) {
  33653. return l(this.nodes, e, this.cmp)
  33654. }
  33655. ,
  33656. e.prototype.heapify = function() {
  33657. return o(this.nodes, this.cmp)
  33658. }
  33659. ,
  33660. e.prototype.updateItem = function(e) {
  33661. return f(this.nodes, e, this.cmp)
  33662. }
  33663. ,
  33664. e.prototype.clear = function() {
  33665. return this.nodes = []
  33666. }
  33667. ,
  33668. e.prototype.empty = function() {
  33669. return 0 === this.nodes.length
  33670. }
  33671. ,
  33672. e.prototype.size = function() {
  33673. return this.nodes.length
  33674. }
  33675. ,
  33676. e.prototype.clone = function() {
  33677. var t;
  33678. return t = new e,
  33679. t.nodes = this.nodes.slice(0),
  33680. t
  33681. }
  33682. ,
  33683. e.prototype.toArray = function() {
  33684. return this.nodes.slice(0)
  33685. }
  33686. ,
  33687. e.prototype.insert = e.prototype.push,
  33688. e.prototype.top = e.prototype.peek,
  33689. e.prototype.front = e.prototype.peek,
  33690. e.prototype.has = e.prototype.contains,
  33691. e.prototype.copy = e.prototype.clone,
  33692. e
  33693. }(),
  33694. function(e, n) {
  33695. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  33696. }(this, function() {
  33697. return e
  33698. })
  33699. }
  33700. ).call(this)
  33701. }
  33702. , {}],
  33703. 213: [function(e, t, i) {
  33704. !function(e) {
  33705. function i() {}
  33706. function n(e, t) {
  33707. return function() {
  33708. e.apply(t, arguments)
  33709. }
  33710. }
  33711. function r(e) {
  33712. if ("object" != typeof this)
  33713. throw new TypeError("Promises must be constructed via new");
  33714. if ("function" != typeof e)
  33715. throw new TypeError("not a function");
  33716. this._state = 0,
  33717. this._handled = !1,
  33718. this._value = void 0,
  33719. this._deferreds = [],
  33720. h(e, this)
  33721. }
  33722. function o(e, t) {
  33723. for (; 3 === e._state; )
  33724. e = e._value;
  33725. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  33726. void r._immediateFn(function() {
  33727. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  33728. if (null === i)
  33729. return void (1 === e._state ? a : s)(t.promise, e._value);
  33730. var n;
  33731. try {
  33732. n = i(e._value)
  33733. } catch (e) {
  33734. return void s(t.promise, e)
  33735. }
  33736. a(t.promise, n)
  33737. }))
  33738. }
  33739. function a(e, t) {
  33740. try {
  33741. if (t === e)
  33742. throw new TypeError("A promise cannot be resolved with itself.");
  33743. if (t && ("object" == typeof t || "function" == typeof t)) {
  33744. var i = t.then;
  33745. if (t instanceof r)
  33746. return e._state = 3,
  33747. e._value = t,
  33748. void l(e);
  33749. if ("function" == typeof i)
  33750. return void h(n(i, t), e)
  33751. }
  33752. e._state = 1,
  33753. e._value = t,
  33754. l(e)
  33755. } catch (t) {
  33756. s(e, t)
  33757. }
  33758. }
  33759. function s(e, t) {
  33760. e._state = 2,
  33761. e._value = t,
  33762. l(e)
  33763. }
  33764. function l(e) {
  33765. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  33766. e._handled || r._unhandledRejectionFn(e._value)
  33767. });
  33768. for (var t = 0, i = e._deferreds.length; t < i; t++)
  33769. o(e, e._deferreds[t]);
  33770. e._deferreds = null
  33771. }
  33772. function c(e, t, i) {
  33773. this.onFulfilled = "function" == typeof e ? e : null,
  33774. this.onRejected = "function" == typeof t ? t : null,
  33775. this.promise = i
  33776. }
  33777. function h(e, t) {
  33778. var i = !1;
  33779. try {
  33780. e(function(e) {
  33781. i || (i = !0,
  33782. a(t, e))
  33783. }, function(e) {
  33784. i || (i = !0,
  33785. s(t, e))
  33786. })
  33787. } catch (e) {
  33788. if (i)
  33789. return;
  33790. i = !0,
  33791. s(t, e)
  33792. }
  33793. }
  33794. var u = setTimeout;
  33795. r.prototype.catch = function(e) {
  33796. return this.then(null, e)
  33797. }
  33798. ,
  33799. r.prototype.then = function(e, t) {
  33800. var n = new this.constructor(i);
  33801. return o(this, new c(e,t,n)),
  33802. n
  33803. }
  33804. ,
  33805. r.all = function(e) {
  33806. var t = Array.prototype.slice.call(e);
  33807. return new r(function(e, i) {
  33808. function n(o, a) {
  33809. try {
  33810. if (a && ("object" == typeof a || "function" == typeof a)) {
  33811. var s = a.then;
  33812. if ("function" == typeof s)
  33813. return void s.call(a, function(e) {
  33814. n(o, e)
  33815. }, i)
  33816. }
  33817. t[o] = a,
  33818. 0 === --r && e(t)
  33819. } catch (e) {
  33820. i(e)
  33821. }
  33822. }
  33823. if (0 === t.length)
  33824. return e([]);
  33825. for (var r = t.length, o = 0; o < t.length; o++)
  33826. n(o, t[o])
  33827. }
  33828. )
  33829. }
  33830. ,
  33831. r.resolve = function(e) {
  33832. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  33833. t(e)
  33834. }
  33835. )
  33836. }
  33837. ,
  33838. r.reject = function(e) {
  33839. return new r(function(t, i) {
  33840. i(e)
  33841. }
  33842. )
  33843. }
  33844. ,
  33845. r.race = function(e) {
  33846. return new r(function(t, i) {
  33847. for (var n = 0, r = e.length; n < r; n++)
  33848. e[n].then(t, i)
  33849. }
  33850. )
  33851. }
  33852. ,
  33853. r._immediateFn = "function" == typeof setImmediate && function(e) {
  33854. setImmediate(e)
  33855. }
  33856. || function(e) {
  33857. u(e, 0)
  33858. }
  33859. ,
  33860. r._unhandledRejectionFn = function(e) {
  33861. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  33862. }
  33863. ,
  33864. r._setImmediateFn = function(e) {
  33865. r._immediateFn = e
  33866. }
  33867. ,
  33868. r._setUnhandledRejectionFn = function(e) {
  33869. r._unhandledRejectionFn = e
  33870. }
  33871. ,
  33872. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  33873. }(this)
  33874. }
  33875. , {}],
  33876. 214: [function(e, t, i) {
  33877. (function(i) {
  33878. !function(i, n) {
  33879. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  33880. }(this, function(t, n) {
  33881. "use strict";
  33882. var r = {};
  33883. return r.ByteBuffer = t,
  33884. r.Long = t.Long || null,
  33885. r.VERSION = "5.0.1",
  33886. r.WIRE_TYPES = {},
  33887. r.WIRE_TYPES.VARINT = 0,
  33888. r.WIRE_TYPES.BITS64 = 1,
  33889. r.WIRE_TYPES.LDELIM = 2,
  33890. r.WIRE_TYPES.STARTGROUP = 3,
  33891. r.WIRE_TYPES.ENDGROUP = 4,
  33892. r.WIRE_TYPES.BITS32 = 5,
  33893. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  33894. r.TYPES = {
  33895. int32: {
  33896. name: "int32",
  33897. wireType: r.WIRE_TYPES.VARINT,
  33898. defaultValue: 0
  33899. },
  33900. uint32: {
  33901. name: "uint32",
  33902. wireType: r.WIRE_TYPES.VARINT,
  33903. defaultValue: 0
  33904. },
  33905. sint32: {
  33906. name: "sint32",
  33907. wireType: r.WIRE_TYPES.VARINT,
  33908. defaultValue: 0
  33909. },
  33910. int64: {
  33911. name: "int64",
  33912. wireType: r.WIRE_TYPES.VARINT,
  33913. defaultValue: r.Long ? r.Long.ZERO : void 0
  33914. },
  33915. uint64: {
  33916. name: "uint64",
  33917. wireType: r.WIRE_TYPES.VARINT,
  33918. defaultValue: r.Long ? r.Long.UZERO : void 0
  33919. },
  33920. sint64: {
  33921. name: "sint64",
  33922. wireType: r.WIRE_TYPES.VARINT,
  33923. defaultValue: r.Long ? r.Long.ZERO : void 0
  33924. },
  33925. bool: {
  33926. name: "bool",
  33927. wireType: r.WIRE_TYPES.VARINT,
  33928. defaultValue: !1
  33929. },
  33930. double: {
  33931. name: "double",
  33932. wireType: r.WIRE_TYPES.BITS64,
  33933. defaultValue: 0
  33934. },
  33935. string: {
  33936. name: "string",
  33937. wireType: r.WIRE_TYPES.LDELIM,
  33938. defaultValue: ""
  33939. },
  33940. bytes: {
  33941. name: "bytes",
  33942. wireType: r.WIRE_TYPES.LDELIM,
  33943. defaultValue: null
  33944. },
  33945. fixed32: {
  33946. name: "fixed32",
  33947. wireType: r.WIRE_TYPES.BITS32,
  33948. defaultValue: 0
  33949. },
  33950. sfixed32: {
  33951. name: "sfixed32",
  33952. wireType: r.WIRE_TYPES.BITS32,
  33953. defaultValue: 0
  33954. },
  33955. fixed64: {
  33956. name: "fixed64",
  33957. wireType: r.WIRE_TYPES.BITS64,
  33958. defaultValue: r.Long ? r.Long.UZERO : void 0
  33959. },
  33960. sfixed64: {
  33961. name: "sfixed64",
  33962. wireType: r.WIRE_TYPES.BITS64,
  33963. defaultValue: r.Long ? r.Long.ZERO : void 0
  33964. },
  33965. float: {
  33966. name: "float",
  33967. wireType: r.WIRE_TYPES.BITS32,
  33968. defaultValue: 0
  33969. },
  33970. enum: {
  33971. name: "enum",
  33972. wireType: r.WIRE_TYPES.VARINT,
  33973. defaultValue: 0
  33974. },
  33975. message: {
  33976. name: "message",
  33977. wireType: r.WIRE_TYPES.LDELIM,
  33978. defaultValue: null
  33979. },
  33980. group: {
  33981. name: "group",
  33982. wireType: r.WIRE_TYPES.STARTGROUP,
  33983. defaultValue: null
  33984. }
  33985. },
  33986. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  33987. r.ID_MIN = 1,
  33988. r.ID_MAX = 536870911,
  33989. r.convertFieldsToCamelCase = !1,
  33990. r.populateAccessors = !0,
  33991. r.populateDefaults = !0,
  33992. r.Util = function() {
  33993. var t = {};
  33994. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  33995. t.XHR = function() {
  33996. for (var e = [function() {
  33997. return new XMLHttpRequest
  33998. }
  33999. , function() {
  34000. return new ActiveXObject("Msxml2.XMLHTTP")
  34001. }
  34002. , function() {
  34003. return new ActiveXObject("Msxml3.XMLHTTP")
  34004. }
  34005. , function() {
  34006. return new ActiveXObject("Microsoft.XMLHTTP")
  34007. }
  34008. ], t = null, i = 0; i < e.length; i++) {
  34009. try {
  34010. t = e[i]()
  34011. } catch (e) {
  34012. continue
  34013. }
  34014. break
  34015. }
  34016. if (!t)
  34017. throw Error("XMLHttpRequest is not supported");
  34018. return t
  34019. }
  34020. ,
  34021. t.fetch = function(i, n) {
  34022. if (n && "function" != typeof n && (n = null),
  34023. t.IS_NODE) {
  34024. var r = e("fs");
  34025. if (n)
  34026. r.readFile(i, function(e, t) {
  34027. n(e ? null : "" + t)
  34028. });
  34029. else
  34030. try {
  34031. return r.readFileSync(i)
  34032. } catch (e) {
  34033. return null
  34034. }
  34035. } else {
  34036. var o = t.XHR();
  34037. if (o.open("GET", i, !!n),
  34038. o.setRequestHeader("Accept", "text/plain"),
  34039. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34040. !n)
  34041. return o.send(null),
  34042. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34043. if (o.onreadystatechange = function() {
  34044. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34045. }
  34046. ,
  34047. 4 == o.readyState)
  34048. return;
  34049. o.send(null)
  34050. }
  34051. }
  34052. ,
  34053. t.toCamelCase = function(e) {
  34054. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34055. return t.toUpperCase()
  34056. })
  34057. }
  34058. ,
  34059. t
  34060. }(),
  34061. r.Lang = {
  34062. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34063. RULE: /^(?:required|optional|repeated|map)$/,
  34064. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34065. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34066. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34067. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34068. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34069. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34070. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34071. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34072. NUMBER_OCT: /^0[0-7]+$/,
  34073. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34074. BOOL: /^(?:true|false)$/i,
  34075. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34076. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34077. WHITESPACE: /\s/,
  34078. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34079. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34080. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34081. },
  34082. r.DotProto = function(e, t) {
  34083. function i(e, i) {
  34084. var n = -1
  34085. , r = 1;
  34086. if ("-" == e.charAt(0) && (r = -1,
  34087. e = e.substring(1)),
  34088. t.NUMBER_DEC.test(e))
  34089. n = parseInt(e);
  34090. else if (t.NUMBER_HEX.test(e))
  34091. n = parseInt(e.substring(2), 16);
  34092. else {
  34093. if (!t.NUMBER_OCT.test(e))
  34094. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34095. n = parseInt(e.substring(1), 8)
  34096. }
  34097. if (n = r * n | 0,
  34098. !i && n < 0)
  34099. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34100. return n
  34101. }
  34102. function n(e) {
  34103. var i = 1;
  34104. if ("-" == e.charAt(0) && (i = -1,
  34105. e = e.substring(1)),
  34106. t.NUMBER_DEC.test(e))
  34107. return i * parseInt(e, 10);
  34108. if (t.NUMBER_HEX.test(e))
  34109. return i * parseInt(e.substring(2), 16);
  34110. if (t.NUMBER_OCT.test(e))
  34111. return i * parseInt(e.substring(1), 8);
  34112. if ("inf" === e)
  34113. return i * (1 / 0);
  34114. if ("nan" === e)
  34115. return NaN;
  34116. if (t.NUMBER_FLT.test(e))
  34117. return i * parseFloat(e);
  34118. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34119. }
  34120. function r(e, t, i) {
  34121. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34122. e[t].push(i))
  34123. }
  34124. var o = {}
  34125. , a = function(e) {
  34126. this.source = e + "",
  34127. this.index = 0,
  34128. this.line = 1,
  34129. this.stack = [],
  34130. this._stringOpen = null
  34131. }
  34132. , s = a.prototype;
  34133. s._readString = function() {
  34134. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34135. e.lastIndex = this.index - 1;
  34136. var i = e.exec(this.source);
  34137. if (!i)
  34138. throw Error("unterminated string");
  34139. return this.index = e.lastIndex,
  34140. this.stack.push(this._stringOpen),
  34141. this._stringOpen = null,
  34142. i[1]
  34143. }
  34144. ,
  34145. s.next = function() {
  34146. if (this.stack.length > 0)
  34147. return this.stack.shift();
  34148. if (this.index >= this.source.length)
  34149. return null;
  34150. if (null !== this._stringOpen)
  34151. return this._readString();
  34152. var e, i, n;
  34153. do {
  34154. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34155. if ("\n" === n && ++this.line,
  34156. ++this.index === this.source.length)
  34157. return null;
  34158. if ("/" === this.source.charAt(this.index))
  34159. if (++this.index,
  34160. "/" === this.source.charAt(this.index)) {
  34161. for (; "\n" !== this.source.charAt(++this.index); )
  34162. if (this.index == this.source.length)
  34163. return null;
  34164. ++this.index,
  34165. ++this.line,
  34166. e = !0
  34167. } else {
  34168. if ("*" !== (n = this.source.charAt(this.index)))
  34169. return "/";
  34170. do {
  34171. if ("\n" === n && ++this.line,
  34172. ++this.index === this.source.length)
  34173. return null;
  34174. i = n,
  34175. n = this.source.charAt(this.index)
  34176. } while ("*" !== i || "/" !== n);++this.index,
  34177. e = !0
  34178. }
  34179. } while (e);if (this.index === this.source.length)
  34180. return null;
  34181. var r = this.index;
  34182. t.DELIM.lastIndex = 0;
  34183. var o = t.DELIM.test(this.source.charAt(r++));
  34184. if (!o)
  34185. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34186. ++r;
  34187. var a = this.source.substring(this.index, this.index = r);
  34188. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34189. a
  34190. }
  34191. ,
  34192. s.peek = function() {
  34193. if (0 === this.stack.length) {
  34194. var e = this.next();
  34195. if (null === e)
  34196. return null;
  34197. this.stack.push(e)
  34198. }
  34199. return this.stack[0]
  34200. }
  34201. ,
  34202. s.skip = function(e) {
  34203. var t = this.next();
  34204. if (t !== e)
  34205. throw Error("illegal '" + t + "', '" + e + "' expected")
  34206. }
  34207. ,
  34208. s.omit = function(e) {
  34209. return this.peek() === e && (this.next(),
  34210. !0)
  34211. }
  34212. ,
  34213. s.toString = function() {
  34214. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34215. }
  34216. ,
  34217. o.Tokenizer = a;
  34218. var l = function(e) {
  34219. this.tn = new a(e),
  34220. this.proto3 = !1
  34221. }
  34222. , c = l.prototype;
  34223. return c.parse = function() {
  34224. var e, i, n = {
  34225. name: "[ROOT]",
  34226. package: null,
  34227. messages: [],
  34228. enums: [],
  34229. imports: [],
  34230. options: {},
  34231. services: []
  34232. }, r = !0;
  34233. try {
  34234. for (; e = this.tn.next(); )
  34235. switch (e) {
  34236. case "package":
  34237. if (!r || null !== n.package)
  34238. throw Error("unexpected 'package'");
  34239. if (e = this.tn.next(),
  34240. !t.TYPEREF.test(e))
  34241. throw Error("illegal package name: " + e);
  34242. this.tn.skip(";"),
  34243. n.package = e;
  34244. break;
  34245. case "import":
  34246. if (!r)
  34247. throw Error("unexpected 'import'");
  34248. e = this.tn.peek(),
  34249. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34250. e = this._readString(),
  34251. this.tn.skip(";"),
  34252. i || n.imports.push(e);
  34253. break;
  34254. case "syntax":
  34255. if (!r)
  34256. throw Error("unexpected 'syntax'");
  34257. this.tn.skip("="),
  34258. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34259. this.tn.skip(";");
  34260. break;
  34261. case "message":
  34262. this._parseMessage(n, null),
  34263. r = !1;
  34264. break;
  34265. case "enum":
  34266. this._parseEnum(n),
  34267. r = !1;
  34268. break;
  34269. case "option":
  34270. this._parseOption(n);
  34271. break;
  34272. case "service":
  34273. this._parseService(n);
  34274. break;
  34275. case "extend":
  34276. this._parseExtend(n);
  34277. break;
  34278. default:
  34279. throw Error("unexpected '" + e + "'")
  34280. }
  34281. } catch (e) {
  34282. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34283. e
  34284. }
  34285. return delete n.name,
  34286. n
  34287. }
  34288. ,
  34289. l.parse = function(e) {
  34290. return new l(e).parse()
  34291. }
  34292. ,
  34293. c._readString = function() {
  34294. var e, t, i = "";
  34295. do {
  34296. if (t = this.tn.next(),
  34297. "'" !== t && '"' !== t)
  34298. throw Error("illegal string delimiter: " + t);
  34299. i += this.tn.next(),
  34300. this.tn.skip(t),
  34301. e = this.tn.peek()
  34302. } while ('"' === e || '"' === e);return i
  34303. }
  34304. ,
  34305. c._readValue = function(e) {
  34306. var i = this.tn.peek();
  34307. if ('"' === i || "'" === i)
  34308. return this._readString();
  34309. if (this.tn.next(),
  34310. t.NUMBER.test(i))
  34311. return n(i);
  34312. if (t.BOOL.test(i))
  34313. return "true" === i.toLowerCase();
  34314. if (e && t.TYPEREF.test(i))
  34315. return i;
  34316. throw Error("illegal value: " + i)
  34317. }
  34318. ,
  34319. c._parseOption = function(e, i) {
  34320. var n = this.tn.next()
  34321. , r = !1;
  34322. if ("(" === n && (r = !0,
  34323. n = this.tn.next()),
  34324. !t.TYPEREF.test(n))
  34325. throw Error("illegal option name: " + n);
  34326. var o = n;
  34327. r && (this.tn.skip(")"),
  34328. o = "(" + o + ")",
  34329. n = this.tn.peek(),
  34330. t.FQTYPEREF.test(n) && (o += n,
  34331. this.tn.next())),
  34332. this.tn.skip("="),
  34333. this._parseOptionValue(e, o),
  34334. i || this.tn.skip(";")
  34335. }
  34336. ,
  34337. c._parseOptionValue = function(e, i) {
  34338. var n = this.tn.peek();
  34339. if ("{" !== n)
  34340. r(e.options, i, this._readValue(!0));
  34341. else
  34342. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34343. if (!t.NAME.test(n))
  34344. throw Error("illegal option name: " + i + "." + n);
  34345. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34346. }
  34347. }
  34348. ,
  34349. c._parseService = function(e) {
  34350. var i = this.tn.next();
  34351. if (!t.NAME.test(i))
  34352. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34353. var n = i
  34354. , r = {
  34355. name: n,
  34356. rpc: {},
  34357. options: {}
  34358. };
  34359. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34360. if ("option" === i)
  34361. this._parseOption(r);
  34362. else {
  34363. if ("rpc" !== i)
  34364. throw Error("illegal service token: " + i);
  34365. this._parseServiceRPC(r)
  34366. }
  34367. this.tn.omit(";"),
  34368. e.services.push(r)
  34369. }
  34370. ,
  34371. c._parseServiceRPC = function(e) {
  34372. var i = "rpc"
  34373. , n = this.tn.next();
  34374. if (!t.NAME.test(n))
  34375. throw Error("illegal rpc service method name: " + n);
  34376. var r = n
  34377. , o = {
  34378. request: null,
  34379. response: null,
  34380. request_stream: !1,
  34381. response_stream: !1,
  34382. options: {}
  34383. };
  34384. if (this.tn.skip("("),
  34385. n = this.tn.next(),
  34386. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34387. n = this.tn.next()),
  34388. !t.TYPEREF.test(n))
  34389. throw Error("illegal rpc service request type: " + n);
  34390. if (o.request = n,
  34391. this.tn.skip(")"),
  34392. n = this.tn.next(),
  34393. "returns" !== n.toLowerCase())
  34394. throw Error("illegal rpc service request type delimiter: " + n);
  34395. if (this.tn.skip("("),
  34396. n = this.tn.next(),
  34397. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34398. n = this.tn.next()),
  34399. o.response = n,
  34400. this.tn.skip(")"),
  34401. n = this.tn.peek(),
  34402. "{" === n) {
  34403. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34404. if ("option" !== n)
  34405. throw Error("illegal rpc service token: " + n);
  34406. this._parseOption(o)
  34407. }
  34408. this.tn.omit(";")
  34409. } else
  34410. this.tn.skip(";");
  34411. "undefined" == typeof e[i] && (e[i] = {}),
  34412. e[i][r] = o
  34413. }
  34414. ,
  34415. c._parseMessage = function(e, n) {
  34416. var r = !!n
  34417. , o = this.tn.next()
  34418. , a = {
  34419. name: "",
  34420. fields: [],
  34421. enums: [],
  34422. messages: [],
  34423. options: {},
  34424. services: [],
  34425. oneofs: {}
  34426. };
  34427. if (!t.NAME.test(o))
  34428. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34429. for (a.name = o,
  34430. r && (this.tn.skip("="),
  34431. n.id = i(this.tn.next()),
  34432. a.isGroup = !0),
  34433. o = this.tn.peek(),
  34434. "[" === o && n && this._parseFieldOptions(n),
  34435. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34436. if (t.RULE.test(o))
  34437. this._parseMessageField(a, o);
  34438. else if ("oneof" === o)
  34439. this._parseMessageOneOf(a);
  34440. else if ("enum" === o)
  34441. this._parseEnum(a);
  34442. else if ("message" === o)
  34443. this._parseMessage(a);
  34444. else if ("option" === o)
  34445. this._parseOption(a);
  34446. else if ("service" === o)
  34447. this._parseService(a);
  34448. else if ("extensions" === o)
  34449. a.extensions = this._parseExtensionRanges();
  34450. else if ("reserved" === o)
  34451. this._parseIgnored();
  34452. else if ("extend" === o)
  34453. this._parseExtend(a);
  34454. else {
  34455. if (!t.TYPEREF.test(o))
  34456. throw Error("illegal message token: " + o);
  34457. if (!this.proto3)
  34458. throw Error("illegal field rule: " + o);
  34459. this._parseMessageField(a, "optional", o)
  34460. }
  34461. return this.tn.omit(";"),
  34462. e.messages.push(a),
  34463. a
  34464. }
  34465. ,
  34466. c._parseIgnored = function() {
  34467. for (; ";" !== this.tn.peek(); )
  34468. this.tn.next();
  34469. this.tn.skip(";")
  34470. }
  34471. ,
  34472. c._parseMessageField = function(e, n, r) {
  34473. if (!t.RULE.test(n))
  34474. throw Error("illegal message field rule: " + n);
  34475. var o, a = {
  34476. rule: n,
  34477. type: "",
  34478. name: "",
  34479. options: {},
  34480. id: 0
  34481. };
  34482. if ("map" === n) {
  34483. if (r)
  34484. throw Error("illegal type: " + r);
  34485. if (this.tn.skip("<"),
  34486. o = this.tn.next(),
  34487. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34488. throw Error("illegal message field type: " + o);
  34489. if (a.keytype = o,
  34490. this.tn.skip(","),
  34491. o = this.tn.next(),
  34492. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34493. throw Error("illegal message field: " + o);
  34494. if (a.type = o,
  34495. this.tn.skip(">"),
  34496. o = this.tn.next(),
  34497. !t.NAME.test(o))
  34498. throw Error("illegal message field name: " + o);
  34499. a.name = o,
  34500. this.tn.skip("="),
  34501. a.id = i(this.tn.next()),
  34502. o = this.tn.peek(),
  34503. "[" === o && this._parseFieldOptions(a),
  34504. this.tn.skip(";")
  34505. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  34506. "group" === r) {
  34507. var s = this._parseMessage(e, a);
  34508. if (!/^[A-Z]/.test(s.name))
  34509. throw Error("illegal group name: " + s.name);
  34510. a.type = s.name,
  34511. a.name = s.name.toLowerCase(),
  34512. this.tn.omit(";")
  34513. } else {
  34514. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  34515. throw Error("illegal message field type: " + r);
  34516. if (a.type = r,
  34517. o = this.tn.next(),
  34518. !t.NAME.test(o))
  34519. throw Error("illegal message field name: " + o);
  34520. a.name = o,
  34521. this.tn.skip("="),
  34522. a.id = i(this.tn.next()),
  34523. o = this.tn.peek(),
  34524. "[" === o && this._parseFieldOptions(a),
  34525. this.tn.skip(";")
  34526. }
  34527. return e.fields.push(a),
  34528. a
  34529. }
  34530. ,
  34531. c._parseMessageOneOf = function(e) {
  34532. var i = this.tn.next();
  34533. if (!t.NAME.test(i))
  34534. throw Error("illegal oneof name: " + i);
  34535. var n, r = i, o = [];
  34536. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34537. n = this._parseMessageField(e, "optional", i),
  34538. n.oneof = r,
  34539. o.push(n.id);
  34540. this.tn.omit(";"),
  34541. e.oneofs[r] = o
  34542. }
  34543. ,
  34544. c._parseFieldOptions = function(e) {
  34545. this.tn.skip("[");
  34546. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  34547. i || this.tn.skip(","),
  34548. this._parseOption(e, !0),
  34549. i = !1;
  34550. this.tn.next()
  34551. }
  34552. ,
  34553. c._parseEnum = function(e) {
  34554. var n = {
  34555. name: "",
  34556. values: [],
  34557. options: {}
  34558. }
  34559. , r = this.tn.next();
  34560. if (!t.NAME.test(r))
  34561. throw Error("illegal name: " + r);
  34562. for (n.name = r,
  34563. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  34564. if ("option" === r)
  34565. this._parseOption(n);
  34566. else {
  34567. if (!t.NAME.test(r))
  34568. throw Error("illegal name: " + r);
  34569. this.tn.skip("=");
  34570. var o = {
  34571. name: r,
  34572. id: i(this.tn.next(), !0)
  34573. };
  34574. r = this.tn.peek(),
  34575. "[" === r && this._parseFieldOptions({
  34576. options: {}
  34577. }),
  34578. this.tn.skip(";"),
  34579. n.values.push(o)
  34580. }
  34581. this.tn.omit(";"),
  34582. e.enums.push(n)
  34583. }
  34584. ,
  34585. c._parseExtensionRanges = function() {
  34586. var t, i, r, o = [];
  34587. do {
  34588. for (i = []; ; ) {
  34589. switch (t = this.tn.next()) {
  34590. case "min":
  34591. r = e.ID_MIN;
  34592. break;
  34593. case "max":
  34594. r = e.ID_MAX;
  34595. break;
  34596. default:
  34597. r = n(t)
  34598. }
  34599. if (i.push(r),
  34600. 2 === i.length)
  34601. break;
  34602. if ("to" !== this.tn.peek()) {
  34603. i.push(r);
  34604. break
  34605. }
  34606. this.tn.next()
  34607. }
  34608. o.push(i)
  34609. } while (this.tn.omit(","));return this.tn.skip(";"),
  34610. o
  34611. }
  34612. ,
  34613. c._parseExtend = function(e) {
  34614. var i = this.tn.next();
  34615. if (!t.TYPEREF.test(i))
  34616. throw Error("illegal extend reference: " + i);
  34617. var n = {
  34618. ref: i,
  34619. fields: []
  34620. };
  34621. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34622. if (t.RULE.test(i))
  34623. this._parseMessageField(n, i);
  34624. else {
  34625. if (!t.TYPEREF.test(i))
  34626. throw Error("illegal extend token: " + i);
  34627. if (!this.proto3)
  34628. throw Error("illegal field rule: " + i);
  34629. this._parseMessageField(n, "optional", i)
  34630. }
  34631. return this.tn.omit(";"),
  34632. e.messages.push(n),
  34633. n
  34634. }
  34635. ,
  34636. c.toString = function() {
  34637. return "Parser at line " + this.tn.line
  34638. }
  34639. ,
  34640. o.Parser = l,
  34641. o
  34642. }(r, r.Lang),
  34643. r.Reflect = function(e) {
  34644. function i(i) {
  34645. if ("string" == typeof i && (i = e.TYPES[i]),
  34646. "undefined" == typeof i.defaultValue)
  34647. throw Error("default value for type " + i.name + " is not supported");
  34648. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34649. }
  34650. function n(t, i) {
  34651. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34652. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  34653. if ("string" == typeof t)
  34654. return e.Long.fromString(t, i || !1, 10);
  34655. if ("number" == typeof t)
  34656. return e.Long.fromNumber(t, i || !1);
  34657. throw Error("not convertible to Long")
  34658. }
  34659. function r(t, i) {
  34660. var n = i.readVarint32()
  34661. , o = 7 & n
  34662. , a = n >>> 3;
  34663. switch (o) {
  34664. case e.WIRE_TYPES.VARINT:
  34665. do
  34666. n = i.readUint8();
  34667. while (128 === (128 & n));break;
  34668. case e.WIRE_TYPES.BITS64:
  34669. i.offset += 8;
  34670. break;
  34671. case e.WIRE_TYPES.LDELIM:
  34672. n = i.readVarint32(),
  34673. i.offset += n;
  34674. break;
  34675. case e.WIRE_TYPES.STARTGROUP:
  34676. r(a, i);
  34677. break;
  34678. case e.WIRE_TYPES.ENDGROUP:
  34679. if (a === t)
  34680. return !1;
  34681. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  34682. case e.WIRE_TYPES.BITS32:
  34683. i.offset += 4;
  34684. break;
  34685. default:
  34686. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  34687. }
  34688. return !0
  34689. }
  34690. var o = {}
  34691. , a = function(e, t, i) {
  34692. this.builder = e,
  34693. this.parent = t,
  34694. this.name = i,
  34695. this.className
  34696. }
  34697. , s = a.prototype;
  34698. s.fqn = function() {
  34699. for (var e = this.name, t = this; ; ) {
  34700. if (t = t.parent,
  34701. null == t)
  34702. break;
  34703. e = t.name + "." + e
  34704. }
  34705. return e
  34706. }
  34707. ,
  34708. s.toString = function(e) {
  34709. return (e ? this.className + " " : "") + this.fqn()
  34710. }
  34711. ,
  34712. s.build = function() {
  34713. throw Error(this.toString(!0) + " cannot be built directly")
  34714. }
  34715. ,
  34716. o.T = a;
  34717. var l = function(e, t, i, n, r) {
  34718. a.call(this, e, t, i),
  34719. this.className = "Namespace",
  34720. this.children = [],
  34721. this.options = n || {},
  34722. this.syntax = r || "proto2"
  34723. }
  34724. , c = l.prototype = Object.create(a.prototype);
  34725. c.getChildren = function(e) {
  34726. if (e = e || null,
  34727. null == e)
  34728. return this.children.slice();
  34729. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  34730. this.children[i]instanceof e && t.push(this.children[i]);
  34731. return t
  34732. }
  34733. ,
  34734. c.addChild = function(e) {
  34735. var t;
  34736. if (t = this.getChild(e.name))
  34737. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  34738. t.name = t.originalName;
  34739. else {
  34740. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34741. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  34742. e.name = e.originalName
  34743. }
  34744. this.children.push(e)
  34745. }
  34746. ,
  34747. c.getChild = function(e) {
  34748. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  34749. if (this.children[i][t] === e)
  34750. return this.children[i];
  34751. return null
  34752. }
  34753. ,
  34754. c.resolve = function(e, t) {
  34755. var i = "string" == typeof e ? e.split(".") : e
  34756. , n = this
  34757. , r = 0;
  34758. if ("" === i[r]) {
  34759. for (; null !== n.parent; )
  34760. n = n.parent;
  34761. r++
  34762. }
  34763. var a;
  34764. do {
  34765. do {
  34766. if (!(n instanceof o.Namespace)) {
  34767. n = null;
  34768. break
  34769. }
  34770. if (a = n.getChild(i[r]),
  34771. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  34772. n = null;
  34773. break
  34774. }
  34775. n = a,
  34776. r++
  34777. } while (r < i.length);if (null != n)
  34778. break;
  34779. if (null !== this.parent)
  34780. return this.parent.resolve(e, t)
  34781. } while (null != n);return n
  34782. }
  34783. ,
  34784. c.qn = function(e) {
  34785. var t = []
  34786. , i = e;
  34787. do
  34788. t.unshift(i.name),
  34789. i = i.parent;
  34790. while (null !== i);for (var n = 1; n <= t.length; n++) {
  34791. var r = t.slice(t.length - n);
  34792. if (e === this.resolve(r, e instanceof o.Namespace))
  34793. return r.join(".")
  34794. }
  34795. return e.fqn()
  34796. }
  34797. ,
  34798. c.build = function() {
  34799. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  34800. e = i[n],
  34801. e instanceof l && (t[e.name] = e.build());
  34802. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34803. value: this.buildOpt()
  34804. }),
  34805. t
  34806. }
  34807. ,
  34808. c.buildOpt = function() {
  34809. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34810. var r = t[i]
  34811. , o = this.options[t[i]];
  34812. e[r] = o
  34813. }
  34814. return e
  34815. }
  34816. ,
  34817. c.getOption = function(e) {
  34818. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  34819. }
  34820. ,
  34821. o.Namespace = l;
  34822. var h = function(t, i, n, r) {
  34823. if (this.type = t,
  34824. this.resolvedType = i,
  34825. this.isMapKey = n,
  34826. this.syntax = r,
  34827. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  34828. throw Error("Invalid map key type: " + t.name)
  34829. }
  34830. , u = h.prototype;
  34831. h.defaultFieldValue = i,
  34832. u.verifyValue = function(i) {
  34833. function r(e, t) {
  34834. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  34835. }
  34836. var o = this;
  34837. switch (this.type) {
  34838. case e.TYPES.int32:
  34839. case e.TYPES.sint32:
  34840. case e.TYPES.sfixed32:
  34841. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34842. i > 4294967295 ? 0 | i : i;
  34843. case e.TYPES.uint32:
  34844. case e.TYPES.fixed32:
  34845. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34846. i < 0 ? i >>> 0 : i;
  34847. case e.TYPES.int64:
  34848. case e.TYPES.sint64:
  34849. case e.TYPES.sfixed64:
  34850. if (e.Long)
  34851. try {
  34852. return n(i, !1)
  34853. } catch (e) {
  34854. r(typeof i, e.message)
  34855. }
  34856. else
  34857. r(typeof i, "requires Long.js");
  34858. case e.TYPES.uint64:
  34859. case e.TYPES.fixed64:
  34860. if (e.Long)
  34861. try {
  34862. return n(i, !0)
  34863. } catch (e) {
  34864. r(typeof i, e.message)
  34865. }
  34866. else
  34867. r(typeof i, "requires Long.js");
  34868. case e.TYPES.bool:
  34869. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  34870. i;
  34871. case e.TYPES.float:
  34872. case e.TYPES.double:
  34873. return "number" != typeof i && r(typeof i, "not a number"),
  34874. i;
  34875. case e.TYPES.string:
  34876. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  34877. "" + i;
  34878. case e.TYPES.bytes:
  34879. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  34880. case e.TYPES.enum:
  34881. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  34882. for (l = 0; l < a.length; l++) {
  34883. if (a[l].name == i)
  34884. return a[l].id;
  34885. if (a[l].id == i)
  34886. return a[l].id
  34887. }
  34888. if ("proto3" === this.syntax)
  34889. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34890. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  34891. i;
  34892. r(i, "not a valid enum value");
  34893. case e.TYPES.group:
  34894. case e.TYPES.message:
  34895. if (i && "object" == typeof i || r(typeof i, "object expected"),
  34896. i instanceof this.resolvedType.clazz)
  34897. return i;
  34898. if (i instanceof e.Builder.Message) {
  34899. var s = {};
  34900. for (var l in i)
  34901. i.hasOwnProperty(l) && (s[l] = i[l]);
  34902. i = s
  34903. }
  34904. return new this.resolvedType.clazz(i)
  34905. }
  34906. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  34907. }
  34908. ,
  34909. u.calculateLength = function(i, n) {
  34910. if (null === n)
  34911. return 0;
  34912. var r;
  34913. switch (this.type) {
  34914. case e.TYPES.int32:
  34915. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  34916. case e.TYPES.uint32:
  34917. return t.calculateVarint32(n);
  34918. case e.TYPES.sint32:
  34919. return t.calculateVarint32(t.zigZagEncode32(n));
  34920. case e.TYPES.fixed32:
  34921. case e.TYPES.sfixed32:
  34922. case e.TYPES.float:
  34923. return 4;
  34924. case e.TYPES.int64:
  34925. case e.TYPES.uint64:
  34926. return t.calculateVarint64(n);
  34927. case e.TYPES.sint64:
  34928. return t.calculateVarint64(t.zigZagEncode64(n));
  34929. case e.TYPES.fixed64:
  34930. case e.TYPES.sfixed64:
  34931. return 8;
  34932. case e.TYPES.bool:
  34933. return 1;
  34934. case e.TYPES.enum:
  34935. return t.calculateVarint32(n);
  34936. case e.TYPES.double:
  34937. return 8;
  34938. case e.TYPES.string:
  34939. return r = t.calculateUTF8Bytes(n),
  34940. t.calculateVarint32(r) + r;
  34941. case e.TYPES.bytes:
  34942. if (n.remaining() < 0)
  34943. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34944. return t.calculateVarint32(n.remaining()) + n.remaining();
  34945. case e.TYPES.message:
  34946. return r = this.resolvedType.calculate(n),
  34947. t.calculateVarint32(r) + r;
  34948. case e.TYPES.group:
  34949. return r = this.resolvedType.calculate(n),
  34950. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  34951. }
  34952. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34953. }
  34954. ,
  34955. u.encodeValue = function(i, n, r) {
  34956. if (null === n)
  34957. return r;
  34958. switch (this.type) {
  34959. case e.TYPES.int32:
  34960. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  34961. break;
  34962. case e.TYPES.uint32:
  34963. r.writeVarint32(n);
  34964. break;
  34965. case e.TYPES.sint32:
  34966. r.writeVarint32ZigZag(n);
  34967. break;
  34968. case e.TYPES.fixed32:
  34969. r.writeUint32(n);
  34970. break;
  34971. case e.TYPES.sfixed32:
  34972. r.writeInt32(n);
  34973. break;
  34974. case e.TYPES.int64:
  34975. case e.TYPES.uint64:
  34976. r.writeVarint64(n);
  34977. break;
  34978. case e.TYPES.sint64:
  34979. r.writeVarint64ZigZag(n);
  34980. break;
  34981. case e.TYPES.fixed64:
  34982. r.writeUint64(n);
  34983. break;
  34984. case e.TYPES.sfixed64:
  34985. r.writeInt64(n);
  34986. break;
  34987. case e.TYPES.bool:
  34988. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  34989. break;
  34990. case e.TYPES.enum:
  34991. r.writeVarint32(n);
  34992. break;
  34993. case e.TYPES.float:
  34994. r.writeFloat32(n);
  34995. break;
  34996. case e.TYPES.double:
  34997. r.writeFloat64(n);
  34998. break;
  34999. case e.TYPES.string:
  35000. r.writeVString(n);
  35001. break;
  35002. case e.TYPES.bytes:
  35003. if (n.remaining() < 0)
  35004. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35005. var o = n.offset;
  35006. r.writeVarint32(n.remaining()),
  35007. r.append(n),
  35008. n.offset = o;
  35009. break;
  35010. case e.TYPES.message:
  35011. var a = (new t).LE();
  35012. this.resolvedType.encode(n, a),
  35013. r.writeVarint32(a.offset),
  35014. r.append(a.flip());
  35015. break;
  35016. case e.TYPES.group:
  35017. this.resolvedType.encode(n, r),
  35018. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35019. break;
  35020. default:
  35021. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35022. }
  35023. return r
  35024. }
  35025. ,
  35026. u.decode = function(t, i, n) {
  35027. if (i != this.type.wireType)
  35028. throw Error("Unexpected wire type for element");
  35029. var r, o;
  35030. switch (this.type) {
  35031. case e.TYPES.int32:
  35032. return 0 | t.readVarint32();
  35033. case e.TYPES.uint32:
  35034. return t.readVarint32() >>> 0;
  35035. case e.TYPES.sint32:
  35036. return 0 | t.readVarint32ZigZag();
  35037. case e.TYPES.fixed32:
  35038. return t.readUint32() >>> 0;
  35039. case e.TYPES.sfixed32:
  35040. return 0 | t.readInt32();
  35041. case e.TYPES.int64:
  35042. return t.readVarint64();
  35043. case e.TYPES.uint64:
  35044. return t.readVarint64().toUnsigned();
  35045. case e.TYPES.sint64:
  35046. return t.readVarint64ZigZag();
  35047. case e.TYPES.fixed64:
  35048. return t.readUint64();
  35049. case e.TYPES.sfixed64:
  35050. return t.readInt64();
  35051. case e.TYPES.bool:
  35052. return !!t.readVarint32();
  35053. case e.TYPES.enum:
  35054. return t.readVarint32();
  35055. case e.TYPES.float:
  35056. return t.readFloat();
  35057. case e.TYPES.double:
  35058. return t.readDouble();
  35059. case e.TYPES.string:
  35060. return t.readVString();
  35061. case e.TYPES.bytes:
  35062. if (o = t.readVarint32(),
  35063. t.remaining() < o)
  35064. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35065. return r = t.clone(),
  35066. r.limit = r.offset + o,
  35067. t.offset += o,
  35068. r;
  35069. case e.TYPES.message:
  35070. return o = t.readVarint32(),
  35071. this.resolvedType.decode(t, o);
  35072. case e.TYPES.group:
  35073. return this.resolvedType.decode(t, -1, n)
  35074. }
  35075. throw Error("[INTERNAL] Illegal decode type")
  35076. }
  35077. ,
  35078. u.valueFromString = function(i) {
  35079. if (!this.isMapKey)
  35080. throw Error("valueFromString() called on non-map-key element");
  35081. switch (this.type) {
  35082. case e.TYPES.int32:
  35083. case e.TYPES.sint32:
  35084. case e.TYPES.sfixed32:
  35085. case e.TYPES.uint32:
  35086. case e.TYPES.fixed32:
  35087. return this.verifyValue(parseInt(i));
  35088. case e.TYPES.int64:
  35089. case e.TYPES.sint64:
  35090. case e.TYPES.sfixed64:
  35091. case e.TYPES.uint64:
  35092. case e.TYPES.fixed64:
  35093. return this.verifyValue(i);
  35094. case e.TYPES.bool:
  35095. return "true" === i;
  35096. case e.TYPES.string:
  35097. return this.verifyValue(i);
  35098. case e.TYPES.bytes:
  35099. return t.fromBinary(i)
  35100. }
  35101. }
  35102. ,
  35103. u.valueToString = function(t) {
  35104. if (!this.isMapKey)
  35105. throw Error("valueToString() called on non-map-key element");
  35106. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35107. }
  35108. ,
  35109. o.Element = h;
  35110. var d = function(e, t, i, n, r, o) {
  35111. l.call(this, e, t, i, n, o),
  35112. this.className = "Message",
  35113. this.extensions = void 0,
  35114. this.clazz = null,
  35115. this.isGroup = !!r,
  35116. this._fields = null,
  35117. this._fieldsById = null,
  35118. this._fieldsByName = null
  35119. }
  35120. , p = d.prototype = Object.create(l.prototype);
  35121. p.build = function(i) {
  35122. if (this.clazz && !i)
  35123. return this.clazz;
  35124. var n = function(e, i) {
  35125. function n(i, r, o, a) {
  35126. if (null === i || "object" != typeof i) {
  35127. if (a && a instanceof e.Reflect.Enum) {
  35128. var s = e.Reflect.Enum.getName(a.object, i);
  35129. if (null !== s)
  35130. return s
  35131. }
  35132. return i
  35133. }
  35134. if (t.isByteBuffer(i))
  35135. return r ? i.toBase64() : i.toBuffer();
  35136. if (e.Long.isLong(i))
  35137. return o ? i.toString() : e.Long.fromValue(i);
  35138. var l;
  35139. if (Array.isArray(i))
  35140. return l = [],
  35141. i.forEach(function(e, t) {
  35142. l[t] = n(e, r, o, a)
  35143. }),
  35144. l;
  35145. if (l = {},
  35146. i instanceof e.Map) {
  35147. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35148. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35149. return l
  35150. }
  35151. var u = i.$type
  35152. , d = void 0;
  35153. for (var p in i)
  35154. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35155. return l
  35156. }
  35157. var r = i.getChildren(e.Reflect.Message.Field)
  35158. , o = i.getChildren(e.Reflect.Message.OneOf)
  35159. , a = function(n, s) {
  35160. e.Builder.Message.call(this);
  35161. for (var l = 0, c = o.length; l < c; ++l)
  35162. this[o[l].name] = null;
  35163. for (l = 0,
  35164. c = r.length; l < c; ++l) {
  35165. var h = r[l];
  35166. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35167. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35168. }
  35169. if (arguments.length > 0) {
  35170. var u;
  35171. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  35172. for (l = 0,
  35173. c = arguments.length; l < c; ++l)
  35174. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35175. else
  35176. this.$set(n)
  35177. }
  35178. }
  35179. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35180. s.add = function(t, n, r) {
  35181. var o = i._fieldsByName[t];
  35182. if (!r) {
  35183. if (!o)
  35184. throw Error(this + "#" + t + " is undefined");
  35185. if (!(o instanceof e.Reflect.Message.Field))
  35186. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35187. if (!o.repeated)
  35188. throw Error(this + "#" + t + " is not a repeated field");
  35189. n = o.verifyValue(n, !0)
  35190. }
  35191. return null === this[t] && (this[t] = []),
  35192. this[t].push(n),
  35193. this
  35194. }
  35195. ,
  35196. s.$add = s.add,
  35197. s.set = function(t, n, r) {
  35198. if (t && "object" == typeof t) {
  35199. r = n;
  35200. for (var o in t)
  35201. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35202. return this
  35203. }
  35204. var a = i._fieldsByName[t];
  35205. if (r)
  35206. this[t] = n;
  35207. else {
  35208. if (!a)
  35209. throw Error(this + "#" + t + " is not a field: undefined");
  35210. if (!(a instanceof e.Reflect.Message.Field))
  35211. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35212. this[a.name] = n = a.verifyValue(n)
  35213. }
  35214. if (a && a.oneof) {
  35215. var s = this[a.oneof.name];
  35216. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35217. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35218. }
  35219. return this
  35220. }
  35221. ,
  35222. s.$set = s.set,
  35223. s.get = function(t, n) {
  35224. if (n)
  35225. return this[t];
  35226. var r = i._fieldsByName[t];
  35227. if (!(r && r instanceof e.Reflect.Message.Field))
  35228. throw Error(this + "#" + t + " is not a field: undefined");
  35229. if (!(r instanceof e.Reflect.Message.Field))
  35230. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35231. return this[r.name]
  35232. }
  35233. ,
  35234. s.$get = s.get;
  35235. for (var l = 0; l < r.length; l++) {
  35236. var c = r[l];
  35237. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35238. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35239. return e.toUpperCase().replace("_", "")
  35240. });
  35241. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35242. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35243. return "_" + e
  35244. })
  35245. , r = function(t, i) {
  35246. return this[e.name] = i ? t : e.verifyValue(t),
  35247. this
  35248. }
  35249. , o = function() {
  35250. return this[e.name]
  35251. };
  35252. null === i.getChild("set" + t) && (s["set" + t] = r),
  35253. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35254. null === i.getChild("get" + t) && (s["get" + t] = o),
  35255. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35256. }(c)
  35257. }
  35258. s.encode = function(e, n) {
  35259. "boolean" == typeof e && (n = e,
  35260. e = void 0);
  35261. var r = !1;
  35262. e || (e = new t,
  35263. r = !0);
  35264. var o = e.littleEndian;
  35265. try {
  35266. return i.encode(this, e.LE(), n),
  35267. (r ? e.flip() : e).LE(o)
  35268. } catch (t) {
  35269. throw e.LE(o),
  35270. t
  35271. }
  35272. }
  35273. ,
  35274. a.encode = function(e, t, i) {
  35275. return new a(e).encode(t, i)
  35276. }
  35277. ,
  35278. s.calculate = function() {
  35279. return i.calculate(this)
  35280. }
  35281. ,
  35282. s.encodeDelimited = function(e, n) {
  35283. var r = !1;
  35284. e || (e = new t,
  35285. r = !0);
  35286. var o = (new t).LE();
  35287. return i.encode(this, o, n).flip(),
  35288. e.writeVarint32(o.remaining()),
  35289. e.append(o),
  35290. r ? e.flip() : e
  35291. }
  35292. ,
  35293. s.encodeAB = function() {
  35294. try {
  35295. return this.encode().toArrayBuffer()
  35296. } catch (e) {
  35297. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35298. e
  35299. }
  35300. }
  35301. ,
  35302. s.toArrayBuffer = s.encodeAB,
  35303. s.encodeNB = function() {
  35304. try {
  35305. return this.encode().toBuffer()
  35306. } catch (e) {
  35307. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35308. e
  35309. }
  35310. }
  35311. ,
  35312. s.toBuffer = s.encodeNB,
  35313. s.encode64 = function() {
  35314. try {
  35315. return this.encode().toBase64()
  35316. } catch (e) {
  35317. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35318. e
  35319. }
  35320. }
  35321. ,
  35322. s.toBase64 = s.encode64,
  35323. s.encodeHex = function() {
  35324. try {
  35325. return this.encode().toHex()
  35326. } catch (e) {
  35327. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35328. e
  35329. }
  35330. }
  35331. ,
  35332. s.toHex = s.encodeHex,
  35333. s.toRaw = function(e, t) {
  35334. return n(this, !!e, !!t, this.$type)
  35335. }
  35336. ,
  35337. s.encodeJSON = function() {
  35338. return JSON.stringify(n(this, !0, !0, this.$type))
  35339. }
  35340. ,
  35341. a.decode = function(e, n, r) {
  35342. "string" == typeof n && (r = n,
  35343. n = -1),
  35344. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35345. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35346. var o = e.littleEndian;
  35347. try {
  35348. var a = i.decode(e.LE());
  35349. return e.LE(o),
  35350. a
  35351. } catch (t) {
  35352. throw e.LE(o),
  35353. t
  35354. }
  35355. }
  35356. ,
  35357. a.decodeDelimited = function(e, n) {
  35358. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35359. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35360. e.remaining() < 1)
  35361. return null;
  35362. var r = e.offset
  35363. , o = e.readVarint32();
  35364. if (e.remaining() < o)
  35365. return e.offset = r,
  35366. null;
  35367. try {
  35368. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35369. return e.offset += o,
  35370. a
  35371. } catch (t) {
  35372. throw e.offset += o,
  35373. t
  35374. }
  35375. }
  35376. ,
  35377. a.decode64 = function(e) {
  35378. return a.decode(e, "base64")
  35379. }
  35380. ,
  35381. a.decodeHex = function(e) {
  35382. return a.decode(e, "hex")
  35383. }
  35384. ,
  35385. a.decodeJSON = function(e) {
  35386. return new a(JSON.parse(e))
  35387. }
  35388. ,
  35389. s.toString = function() {
  35390. return i.toString()
  35391. }
  35392. ;
  35393. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35394. value: i.buildOpt()
  35395. }),
  35396. Object.defineProperty(s, "$options", {
  35397. value: a.$options
  35398. }),
  35399. Object.defineProperty(a, "$type", {
  35400. value: i
  35401. }),
  35402. Object.defineProperty(s, "$type", {
  35403. value: i
  35404. })),
  35405. a
  35406. }(e, this);
  35407. this._fields = [],
  35408. this._fieldsById = {},
  35409. this._fieldsByName = {};
  35410. for (var r, o = 0, a = this.children.length; o < a; o++)
  35411. if (r = this.children[o],
  35412. r instanceof A || r instanceof d || r instanceof E) {
  35413. if (n.hasOwnProperty(r.name))
  35414. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35415. n[r.name] = r.build()
  35416. } else if (r instanceof d.Field)
  35417. r.build(),
  35418. this._fields.push(r),
  35419. this._fieldsById[r.id] = r,
  35420. this._fieldsByName[r.name] = r;
  35421. else if (!(r instanceof d.OneOf || r instanceof I))
  35422. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35423. return this.clazz = n
  35424. }
  35425. ,
  35426. p.encode = function(e, t, i) {
  35427. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35428. n = this._fields[a],
  35429. r = e[n.name],
  35430. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35431. if (null !== o) {
  35432. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35433. throw l.encoded = t,
  35434. l
  35435. }
  35436. return t
  35437. }
  35438. ,
  35439. p.calculate = function(e) {
  35440. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35441. if (t = this._fields[r],
  35442. i = e[t.name],
  35443. t.required && null === i)
  35444. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35445. n += t.calculate(i, e)
  35446. }
  35447. return n
  35448. }
  35449. ,
  35450. p.decode = function(t, i, n) {
  35451. i = "number" == typeof i ? i : -1;
  35452. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  35453. if (o = t.readVarint32(),
  35454. a = 7 & o,
  35455. s = o >>> 3,
  35456. a === e.WIRE_TYPES.ENDGROUP) {
  35457. if (s !== n)
  35458. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  35459. break
  35460. }
  35461. if (l = this._fieldsById[s]) {
  35462. if (l.repeated && !l.options.packed)
  35463. h[l.name].push(l.decode(a, t));
  35464. else if (l.map) {
  35465. var u = l.decode(a, t);
  35466. h[l.name].set(u[0], u[1])
  35467. } else if (h[l.name] = l.decode(a, t),
  35468. l.oneof) {
  35469. var d = h[l.oneof.name];
  35470. null !== d && d !== l.name && (h[d] = null),
  35471. h[l.oneof.name] = l.name
  35472. }
  35473. } else
  35474. switch (a) {
  35475. case e.WIRE_TYPES.VARINT:
  35476. t.readVarint32();
  35477. break;
  35478. case e.WIRE_TYPES.BITS32:
  35479. t.offset += 4;
  35480. break;
  35481. case e.WIRE_TYPES.BITS64:
  35482. t.offset += 8;
  35483. break;
  35484. case e.WIRE_TYPES.LDELIM:
  35485. var p = t.readVarint32();
  35486. t.offset += p;
  35487. break;
  35488. case e.WIRE_TYPES.STARTGROUP:
  35489. for (; r(s, t); )
  35490. ;
  35491. break;
  35492. default:
  35493. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  35494. }
  35495. }
  35496. for (var f = 0, g = this._fields.length; f < g; ++f)
  35497. if (l = this._fields[f],
  35498. null === h[l.name])
  35499. if ("proto3" === this.syntax)
  35500. h[l.name] = l.defaultValue;
  35501. else {
  35502. if (l.required) {
  35503. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  35504. throw m.decoded = h,
  35505. m
  35506. }
  35507. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  35508. }
  35509. return h
  35510. }
  35511. ,
  35512. o.Message = d;
  35513. var f = function(t, i, n, r, o, s, l, c, h, u) {
  35514. a.call(this, t, i, s),
  35515. this.className = "Message.Field",
  35516. this.required = "required" === n,
  35517. this.repeated = "repeated" === n,
  35518. this.map = "map" === n,
  35519. this.keyType = r || null,
  35520. this.type = o,
  35521. this.resolvedType = null,
  35522. this.id = l,
  35523. this.options = c || {},
  35524. this.defaultValue = null,
  35525. this.oneof = h || null,
  35526. this.syntax = u || "proto2",
  35527. this.originalName = this.name,
  35528. this.element = null,
  35529. this.keyElement = null,
  35530. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  35531. }
  35532. , g = f.prototype = Object.create(a.prototype);
  35533. g.build = function() {
  35534. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  35535. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  35536. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  35537. }
  35538. ,
  35539. g.verifyValue = function(t, i) {
  35540. function n(e, t) {
  35541. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  35542. }
  35543. i = i || !1;
  35544. var r = this;
  35545. if (null === t)
  35546. return this.required && n(typeof t, "required"),
  35547. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  35548. null;
  35549. var o;
  35550. if (this.repeated && !i) {
  35551. Array.isArray(t) || (t = [t]);
  35552. var a = [];
  35553. for (o = 0; o < t.length; o++)
  35554. a.push(this.element.verifyValue(t[o]));
  35555. return a
  35556. }
  35557. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  35558. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  35559. this.element.verifyValue(t))
  35560. }
  35561. ,
  35562. g.hasWirePresence = function(t, i) {
  35563. if ("proto3" !== this.syntax)
  35564. return null !== t;
  35565. if (this.oneof && i[this.oneof.name] === this.name)
  35566. return !0;
  35567. switch (this.type) {
  35568. case e.TYPES.int32:
  35569. case e.TYPES.sint32:
  35570. case e.TYPES.sfixed32:
  35571. case e.TYPES.uint32:
  35572. case e.TYPES.fixed32:
  35573. return 0 !== t;
  35574. case e.TYPES.int64:
  35575. case e.TYPES.sint64:
  35576. case e.TYPES.sfixed64:
  35577. case e.TYPES.uint64:
  35578. case e.TYPES.fixed64:
  35579. return 0 !== t.low || 0 !== t.high;
  35580. case e.TYPES.bool:
  35581. return t;
  35582. case e.TYPES.float:
  35583. case e.TYPES.double:
  35584. return 0 !== t;
  35585. case e.TYPES.string:
  35586. return t.length > 0;
  35587. case e.TYPES.bytes:
  35588. return t.remaining() > 0;
  35589. case e.TYPES.enum:
  35590. return 0 !== t;
  35591. case e.TYPES.message:
  35592. return null !== t;
  35593. default:
  35594. return !0
  35595. }
  35596. }
  35597. ,
  35598. g.encode = function(i, n, r) {
  35599. if (null === this.type || "object" != typeof this.type)
  35600. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35601. if (null === i || this.repeated && 0 == i.length)
  35602. return n;
  35603. try {
  35604. if (this.repeated) {
  35605. var o;
  35606. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35607. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35608. n.ensureCapacity(n.offset += 1);
  35609. var a = n.offset;
  35610. for (o = 0; o < i.length; o++)
  35611. this.element.encodeValue(this.id, i[o], n);
  35612. var s = n.offset - a
  35613. , l = t.calculateVarint32(s);
  35614. if (l > 1) {
  35615. var c = n.slice(a, n.offset);
  35616. a += l - 1,
  35617. n.offset = a,
  35618. n.append(c)
  35619. }
  35620. n.writeVarint32(s, a - l)
  35621. } else
  35622. for (o = 0; o < i.length; o++)
  35623. n.writeVarint32(this.id << 3 | this.type.wireType),
  35624. this.element.encodeValue(this.id, i[o], n)
  35625. } else
  35626. this.map ? i.forEach(function(i, r, o) {
  35627. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35628. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35629. n.writeVarint32(a),
  35630. n.writeVarint32(8 | this.keyType.wireType),
  35631. this.keyElement.encodeValue(1, r, n),
  35632. n.writeVarint32(16 | this.type.wireType),
  35633. this.element.encodeValue(2, i, n)
  35634. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  35635. this.element.encodeValue(this.id, i, n))
  35636. } catch (e) {
  35637. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35638. }
  35639. return n
  35640. }
  35641. ,
  35642. g.calculate = function(i, n) {
  35643. if (i = this.verifyValue(i),
  35644. null === this.type || "object" != typeof this.type)
  35645. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35646. if (null === i || this.repeated && 0 == i.length)
  35647. return 0;
  35648. var r = 0;
  35649. try {
  35650. if (this.repeated) {
  35651. var o, a;
  35652. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35653. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35654. a = 0,
  35655. o = 0; o < i.length; o++)
  35656. a += this.element.calculateLength(this.id, i[o]);
  35657. r += t.calculateVarint32(a),
  35658. r += a
  35659. } else
  35660. for (o = 0; o < i.length; o++)
  35661. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35662. r += this.element.calculateLength(this.id, i[o])
  35663. } else
  35664. this.map ? i.forEach(function(i, n, o) {
  35665. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35666. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35667. r += t.calculateVarint32(a),
  35668. r += a
  35669. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35670. r += this.element.calculateLength(this.id, i))
  35671. } catch (e) {
  35672. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35673. }
  35674. return r
  35675. }
  35676. ,
  35677. g.decode = function(t, i, n) {
  35678. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  35679. if (!a)
  35680. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  35681. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  35682. o = i.readVarint32(),
  35683. o = i.offset + o;
  35684. for (var s = []; i.offset < o; )
  35685. s.push(this.decode(this.type.wireType, i, !0));
  35686. return s
  35687. }
  35688. if (this.map) {
  35689. var l = h.defaultFieldValue(this.keyType);
  35690. if (r = h.defaultFieldValue(this.type),
  35691. o = i.readVarint32(),
  35692. i.remaining() < o)
  35693. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  35694. var c = i.clone();
  35695. for (c.limit = c.offset + o,
  35696. i.offset += o; c.remaining() > 0; ) {
  35697. var u = c.readVarint32();
  35698. t = 7 & u;
  35699. var d = u >>> 3;
  35700. if (1 === d)
  35701. l = this.keyElement.decode(c, t, d);
  35702. else {
  35703. if (2 !== d)
  35704. throw Error("Unexpected tag in map field key/value submessage");
  35705. r = this.element.decode(c, t, d)
  35706. }
  35707. }
  35708. return [l, r]
  35709. }
  35710. return this.element.decode(i, t, this.id)
  35711. }
  35712. ,
  35713. o.Message.Field = f;
  35714. var m = function(e, t, i, n, r, o, a) {
  35715. f.call(this, e, t, i, null, n, r, o, a),
  35716. this.extension
  35717. };
  35718. m.prototype = Object.create(f.prototype),
  35719. o.Message.ExtensionField = m;
  35720. var v = function(e, t, i) {
  35721. a.call(this, e, t, i),
  35722. this.fields = []
  35723. };
  35724. o.Message.OneOf = v;
  35725. var A = function(e, t, i, n, r) {
  35726. l.call(this, e, t, i, n, r),
  35727. this.className = "Enum",
  35728. this.object = null
  35729. };
  35730. A.getName = function(e, t) {
  35731. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  35732. if (e[i = n[r]] === t)
  35733. return i;
  35734. return null
  35735. }
  35736. ;
  35737. var y = A.prototype = Object.create(l.prototype);
  35738. y.build = function(t) {
  35739. if (this.object && !t)
  35740. return this.object;
  35741. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  35742. i[n[r].name] = n[r].id;
  35743. return Object.defineProperty && Object.defineProperty(i, "$options", {
  35744. value: this.buildOpt(),
  35745. enumerable: !1
  35746. }),
  35747. this.object = i
  35748. }
  35749. ,
  35750. o.Enum = A;
  35751. var C = function(e, t, i, n) {
  35752. a.call(this, e, t, i),
  35753. this.className = "Enum.Value",
  35754. this.id = n
  35755. };
  35756. C.prototype = Object.create(a.prototype),
  35757. o.Enum.Value = C;
  35758. var I = function(e, t, i, n) {
  35759. a.call(this, e, t, i),
  35760. this.field = n
  35761. };
  35762. I.prototype = Object.create(a.prototype),
  35763. o.Extension = I;
  35764. var E = function(e, t, i, n) {
  35765. l.call(this, e, t, i, n),
  35766. this.className = "Service",
  35767. this.clazz = null
  35768. }
  35769. , b = E.prototype = Object.create(l.prototype);
  35770. b.build = function(i) {
  35771. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  35772. for (var n = function(t) {
  35773. e.Builder.Service.call(this),
  35774. this.rpcImpl = t || function(e, t, i) {
  35775. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  35776. }
  35777. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  35778. !function(e) {
  35779. r[e.name] = function(n, r) {
  35780. try {
  35781. try {
  35782. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  35783. } catch (e) {
  35784. if (!(e instanceof TypeError))
  35785. throw e
  35786. }
  35787. if (null === n || "object" != typeof n)
  35788. throw Error("Illegal arguments");
  35789. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  35790. this.rpcImpl(e.fqn(), n, function(t, n) {
  35791. if (t)
  35792. return void r(t);
  35793. null === n && (n = "");
  35794. try {
  35795. n = e.resolvedResponseType.clazz.decode(n)
  35796. } catch (e) {}
  35797. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  35798. })
  35799. } catch (e) {
  35800. setTimeout(r.bind(this, e), 0)
  35801. }
  35802. }
  35803. ,
  35804. n[e.name] = function(t, i, r) {
  35805. new n(t)[e.name](i, r)
  35806. }
  35807. ,
  35808. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  35809. value: e.buildOpt()
  35810. }),
  35811. Object.defineProperty(r[e.name], "$options", {
  35812. value: n[e.name].$options
  35813. }))
  35814. }(o[a]);
  35815. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  35816. value: i.buildOpt()
  35817. }),
  35818. Object.defineProperty(r, "$options", {
  35819. value: n.$options
  35820. }),
  35821. Object.defineProperty(n, "$type", {
  35822. value: i
  35823. }),
  35824. Object.defineProperty(r, "$type", {
  35825. value: i
  35826. })),
  35827. n
  35828. }(e, this)
  35829. }
  35830. ,
  35831. o.Service = E;
  35832. var w = function(e, t, i, n) {
  35833. a.call(this, e, t, i),
  35834. this.className = "Service.Method",
  35835. this.options = n || {}
  35836. }
  35837. , _ = w.prototype = Object.create(a.prototype);
  35838. _.buildOpt = c.buildOpt,
  35839. o.Service.Method = w;
  35840. var T = function(e, t, i, n, r, o, a, s) {
  35841. w.call(this, e, t, i, s),
  35842. this.className = "Service.RPCMethod",
  35843. this.requestName = n,
  35844. this.responseName = r,
  35845. this.requestStream = o,
  35846. this.responseStream = a,
  35847. this.resolvedRequestType = null,
  35848. this.resolvedResponseType = null
  35849. };
  35850. return T.prototype = Object.create(w.prototype),
  35851. o.Service.RPCMethod = T,
  35852. o
  35853. }(r),
  35854. r.Builder = function(t, i, n) {
  35855. function r(e) {
  35856. e.messages && e.messages.forEach(function(t) {
  35857. t.syntax = e.syntax,
  35858. r(t)
  35859. }),
  35860. e.enums && e.enums.forEach(function(t) {
  35861. t.syntax = e.syntax
  35862. })
  35863. }
  35864. var o = function(e) {
  35865. this.ns = new n.Namespace(this,null,""),
  35866. this.ptr = this.ns,
  35867. this.resolved = !1,
  35868. this.result = null,
  35869. this.files = {},
  35870. this.importRoot = null,
  35871. this.options = e || {}
  35872. }
  35873. , a = o.prototype;
  35874. return o.isMessage = function(e) {
  35875. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  35876. }
  35877. ,
  35878. o.isMessageField = function(e) {
  35879. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  35880. }
  35881. ,
  35882. o.isEnum = function(e) {
  35883. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  35884. }
  35885. ,
  35886. o.isService = function(e) {
  35887. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  35888. }
  35889. ,
  35890. o.isExtend = function(e) {
  35891. return "string" == typeof e.ref
  35892. }
  35893. ,
  35894. a.reset = function() {
  35895. return this.ptr = this.ns,
  35896. this
  35897. }
  35898. ,
  35899. a.define = function(e) {
  35900. if ("string" != typeof e || !i.TYPEREF.test(e))
  35901. throw Error("illegal namespace: " + e);
  35902. return e.split(".").forEach(function(e) {
  35903. var t = this.ptr.getChild(e);
  35904. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  35905. this.ptr = t
  35906. }, this),
  35907. this
  35908. }
  35909. ,
  35910. a.create = function(e) {
  35911. if (!e)
  35912. return this;
  35913. if (Array.isArray(e)) {
  35914. if (0 === e.length)
  35915. return this;
  35916. e = e.slice()
  35917. } else
  35918. e = [e];
  35919. for (var i = [e]; i.length > 0; ) {
  35920. if (e = i.pop(),
  35921. !Array.isArray(e))
  35922. throw Error("not a valid namespace: " + JSON.stringify(e));
  35923. for (; e.length > 0; ) {
  35924. var r = e.shift();
  35925. if (o.isMessage(r)) {
  35926. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  35927. , s = {};
  35928. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  35929. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  35930. }, this),
  35931. r.fields && r.fields.forEach(function(e) {
  35932. if (null !== a.getChild(0 | e.id))
  35933. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  35934. if (e.options && "object" != typeof e.options)
  35935. throw Error("illegal field options in " + a.name + "#" + e.name);
  35936. var t = null;
  35937. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  35938. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  35939. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  35940. t && t.fields.push(e),
  35941. a.addChild(e)
  35942. }, this);
  35943. var l = [];
  35944. if (r.enums && r.enums.forEach(function(e) {
  35945. l.push(e)
  35946. }),
  35947. r.messages && r.messages.forEach(function(e) {
  35948. l.push(e)
  35949. }),
  35950. r.services && r.services.forEach(function(e) {
  35951. l.push(e)
  35952. }),
  35953. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  35954. this.ptr.addChild(a),
  35955. l.length > 0) {
  35956. i.push(e),
  35957. e = l,
  35958. l = null,
  35959. this.ptr = a,
  35960. a = null;
  35961. continue
  35962. }
  35963. l = null
  35964. } else if (o.isEnum(r))
  35965. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  35966. r.values.forEach(function(e) {
  35967. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  35968. }, this),
  35969. this.ptr.addChild(a);
  35970. else if (o.isService(r))
  35971. a = new n.Service(this,this.ptr,r.name,r.options),
  35972. Object.keys(r.rpc).forEach(function(e) {
  35973. var t = r.rpc[e];
  35974. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  35975. }, this),
  35976. this.ptr.addChild(a);
  35977. else {
  35978. if (!o.isExtend(r))
  35979. throw Error("not a valid definition: " + JSON.stringify(r));
  35980. if (a = this.ptr.resolve(r.ref, !0))
  35981. r.fields.forEach(function(e) {
  35982. if (null !== a.getChild(0 | e.id))
  35983. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  35984. if (a.extensions) {
  35985. var i = !1;
  35986. if (a.extensions.forEach(function(t) {
  35987. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35988. }),
  35989. !i)
  35990. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  35991. }
  35992. var r = e.name;
  35993. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  35994. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  35995. , s = new n.Extension(this,this.ptr,e.name,o);
  35996. o.extension = s,
  35997. this.ptr.addChild(s),
  35998. a.addChild(o)
  35999. }, this);
  36000. else if (!/\.?google\.protobuf\./.test(r.ref))
  36001. throw Error("extended message " + r.ref + " is not defined")
  36002. }
  36003. r = null,
  36004. a = null
  36005. }
  36006. e = null,
  36007. this.ptr = this.ptr.parent
  36008. }
  36009. return this.resolved = !1,
  36010. this.result = null,
  36011. this
  36012. }
  36013. ,
  36014. a.import = function(i, n) {
  36015. var o = "/";
  36016. if ("string" == typeof n) {
  36017. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36018. this.files[n] === !0)
  36019. return this.reset();
  36020. this.files[n] = !0
  36021. } else if ("object" == typeof n) {
  36022. var a = n.root;
  36023. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36024. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36025. var s = a + o + n.file;
  36026. if (this.files[s] === !0)
  36027. return this.reset();
  36028. this.files[s] = !0
  36029. }
  36030. if (i.imports && i.imports.length > 0) {
  36031. var l, c = !1;
  36032. "object" == typeof n ? (this.importRoot = n.root,
  36033. c = !0,
  36034. l = this.importRoot,
  36035. n = n.file,
  36036. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36037. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36038. o = "\\") : l = "." : l = null;
  36039. for (var h = 0; h < i.imports.length; h++)
  36040. if ("string" == typeof i.imports[h]) {
  36041. if (!l)
  36042. throw Error("cannot determine import root");
  36043. var u = i.imports[h];
  36044. if ("google/protobuf/descriptor.proto" === u)
  36045. continue;
  36046. if (u = l + o + u,
  36047. this.files[u] === !0)
  36048. continue;
  36049. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36050. var d = t.Util.fetch(u);
  36051. if (null === d)
  36052. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36053. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36054. } else
  36055. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36056. return t + "_import" + h + "." + i
  36057. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36058. c && (this.importRoot = null)
  36059. }
  36060. i.package && this.define(i.package),
  36061. i.syntax && r(i);
  36062. var p = this.ptr;
  36063. return i.options && Object.keys(i.options).forEach(function(e) {
  36064. p.options[e] = i.options[e]
  36065. }),
  36066. i.messages && (this.create(i.messages),
  36067. this.ptr = p),
  36068. i.enums && (this.create(i.enums),
  36069. this.ptr = p),
  36070. i.services && (this.create(i.services),
  36071. this.ptr = p),
  36072. i.extends && this.create(i.extends),
  36073. this.reset()
  36074. }
  36075. ,
  36076. a.resolveAll = function() {
  36077. var e;
  36078. if (null == this.ptr || "object" == typeof this.ptr.type)
  36079. return this;
  36080. if (this.ptr instanceof n.Namespace)
  36081. this.ptr.children.forEach(function(e) {
  36082. this.ptr = e,
  36083. this.resolveAll()
  36084. }, this);
  36085. else if (this.ptr instanceof n.Message.Field) {
  36086. if (i.TYPE.test(this.ptr.type))
  36087. this.ptr.type = t.TYPES[this.ptr.type];
  36088. else {
  36089. if (!i.TYPEREF.test(this.ptr.type))
  36090. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36091. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36092. !e)
  36093. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36094. if (this.ptr.resolvedType = e,
  36095. e instanceof n.Enum) {
  36096. if (this.ptr.type = t.TYPES.enum,
  36097. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36098. throw Error("proto3 message cannot reference proto2 enum")
  36099. } else {
  36100. if (!(e instanceof n.Message))
  36101. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36102. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36103. }
  36104. }
  36105. if (this.ptr.map) {
  36106. if (!i.TYPE.test(this.ptr.keyType))
  36107. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36108. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36109. }
  36110. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36111. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36112. throw Error("illegal service type in " + this.ptr.toString(!0));
  36113. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36114. !(e && e instanceof t.Reflect.Message))
  36115. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36116. if (this.ptr.resolvedRequestType = e,
  36117. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36118. !(e && e instanceof t.Reflect.Message))
  36119. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36120. this.ptr.resolvedResponseType = e
  36121. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36122. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36123. return this.reset()
  36124. }
  36125. ,
  36126. a.build = function(e) {
  36127. if (this.reset(),
  36128. this.resolved || (this.resolveAll(),
  36129. this.resolved = !0,
  36130. this.result = null),
  36131. null === this.result && (this.result = this.ns.build()),
  36132. !e)
  36133. return this.result;
  36134. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36135. if (!i[t[n]]) {
  36136. i = null;
  36137. break
  36138. }
  36139. i = i[t[n]]
  36140. }
  36141. return i
  36142. }
  36143. ,
  36144. a.lookup = function(e, t) {
  36145. return e ? this.ns.resolve(e, t) : this.ns
  36146. }
  36147. ,
  36148. a.toString = function() {
  36149. return "Builder"
  36150. }
  36151. ,
  36152. o.Message = function() {}
  36153. ,
  36154. o.Enum = function() {}
  36155. ,
  36156. o.Service = function() {}
  36157. ,
  36158. o
  36159. }(r, r.Lang, r.Reflect),
  36160. r.Map = function(e, t) {
  36161. function i(e) {
  36162. var t = 0;
  36163. return {
  36164. next: function() {
  36165. return t < e.length ? {
  36166. done: !1,
  36167. value: e[t++]
  36168. } : {
  36169. done: !0
  36170. }
  36171. }
  36172. }
  36173. }
  36174. var n = function(e, i) {
  36175. if (!e.map)
  36176. throw Error("field is not a map");
  36177. if (this.field = e,
  36178. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36179. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36180. this.map = {},
  36181. Object.defineProperty(this, "size", {
  36182. get: function() {
  36183. return Object.keys(this.map).length
  36184. }
  36185. }),
  36186. i)
  36187. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36188. var o = this.keyElem.valueFromString(n[r])
  36189. , a = this.valueElem.verifyValue(i[n[r]]);
  36190. this.map[this.keyElem.valueToString(o)] = {
  36191. key: o,
  36192. value: a
  36193. }
  36194. }
  36195. }
  36196. , r = n.prototype;
  36197. return r.clear = function() {
  36198. this.map = {}
  36199. }
  36200. ,
  36201. r.delete = function(e) {
  36202. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36203. , i = t in this.map;
  36204. return delete this.map[t],
  36205. i
  36206. }
  36207. ,
  36208. r.entries = function() {
  36209. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36210. t.push([(e = this.map[n[r]]).key, e.value]);
  36211. return i(t)
  36212. }
  36213. ,
  36214. r.keys = function() {
  36215. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36216. e.push(this.map[t[n]].key);
  36217. return i(e)
  36218. }
  36219. ,
  36220. r.values = function() {
  36221. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36222. e.push(this.map[t[n]].value);
  36223. return i(e)
  36224. }
  36225. ,
  36226. r.forEach = function(e, t) {
  36227. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36228. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36229. }
  36230. ,
  36231. r.set = function(e, t) {
  36232. var i = this.keyElem.verifyValue(e)
  36233. , n = this.valueElem.verifyValue(t);
  36234. return this.map[this.keyElem.valueToString(i)] = {
  36235. key: i,
  36236. value: n
  36237. },
  36238. this
  36239. }
  36240. ,
  36241. r.get = function(e) {
  36242. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36243. if (t in this.map)
  36244. return this.map[t].value
  36245. }
  36246. ,
  36247. r.has = function(e) {
  36248. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36249. return t in this.map
  36250. }
  36251. ,
  36252. n
  36253. }(r, r.Reflect),
  36254. r.loadProto = function(e, t, i) {
  36255. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36256. t = void 0),
  36257. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36258. }
  36259. ,
  36260. r.protoFromString = r.loadProto,
  36261. r.loadProtoFile = function(e, t, i) {
  36262. if (t && "object" == typeof t ? (i = t,
  36263. t = null) : t && "function" == typeof t || (t = null),
  36264. t)
  36265. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36266. if (null === n)
  36267. return void t(Error("Failed to fetch file"));
  36268. try {
  36269. t(null, r.loadProto(n, i, e))
  36270. } catch (e) {
  36271. t(e)
  36272. }
  36273. });
  36274. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36275. return null === n ? null : r.loadProto(n, i, e)
  36276. }
  36277. ,
  36278. r.protoFromFile = r.loadProtoFile,
  36279. r.newBuilder = function(e) {
  36280. return e = e || {},
  36281. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36282. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36283. new r.Builder(e)
  36284. }
  36285. ,
  36286. r.loadJson = function(e, t, i) {
  36287. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36288. t = null),
  36289. t && "object" == typeof t || (t = r.newBuilder()),
  36290. "string" == typeof e && (e = JSON.parse(e)),
  36291. t.import(e, i),
  36292. t.resolveAll(),
  36293. t
  36294. }
  36295. ,
  36296. r.loadJsonFile = function(e, t, i) {
  36297. if (t && "object" == typeof t ? (i = t,
  36298. t = null) : t && "function" == typeof t || (t = null),
  36299. t)
  36300. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36301. if (null === n)
  36302. return void t(Error("Failed to fetch file"));
  36303. try {
  36304. t(null, r.loadJson(JSON.parse(n), i, e))
  36305. } catch (e) {
  36306. t(e)
  36307. }
  36308. });
  36309. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36310. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36311. }
  36312. ,
  36313. r
  36314. })
  36315. }
  36316. ).call(this, e("_process"))
  36317. }
  36318. , {
  36319. _process: 203,
  36320. bytebuffer: 215,
  36321. fs: 197,
  36322. path: 197
  36323. }],
  36324. 215: [function(e, t, i) {
  36325. !function(i, n) {
  36326. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36327. var t;
  36328. try {
  36329. t = e("long")
  36330. } catch (e) {}
  36331. return n(t)
  36332. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36333. }(this, function(e) {
  36334. "use strict";
  36335. function t(e) {
  36336. var t = 0;
  36337. return function() {
  36338. return t < e.length ? e.charCodeAt(t++) : null
  36339. }
  36340. }
  36341. function i() {
  36342. var e = []
  36343. , t = [];
  36344. return function() {
  36345. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36346. e.length = 0),
  36347. void Array.prototype.push.apply(e, arguments))
  36348. }
  36349. }
  36350. function n(e, t, i, n, r) {
  36351. 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];
  36352. for (u += d,
  36353. o = p & (1 << -h) - 1,
  36354. p >>= -h,
  36355. h += s; h > 0; o = 256 * o + e[t + u],
  36356. u += d,
  36357. h -= 8)
  36358. ;
  36359. for (a = o & (1 << -h) - 1,
  36360. o >>= -h,
  36361. h += n; h > 0; a = 256 * a + e[t + u],
  36362. u += d,
  36363. h -= 8)
  36364. ;
  36365. if (0 === o)
  36366. o = 1 - c;
  36367. else {
  36368. if (o === l)
  36369. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36370. a += Math.pow(2, n),
  36371. o -= c
  36372. }
  36373. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36374. }
  36375. function r(e, t, i, n, r, o) {
  36376. 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;
  36377. for (t = Math.abs(t),
  36378. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36379. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36380. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36381. l *= 2),
  36382. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36383. t * l >= 2 && (a++,
  36384. l /= 2),
  36385. a + u >= h ? (s = 0,
  36386. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36387. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36388. a = 0)); r >= 8; e[i + p] = 255 & s,
  36389. p += f,
  36390. s /= 256,
  36391. r -= 8)
  36392. ;
  36393. for (a = a << r | s,
  36394. c += r; c > 0; e[i + p] = 255 & a,
  36395. p += f,
  36396. a /= 256,
  36397. c -= 8)
  36398. ;
  36399. e[i + p - f] |= 128 * g
  36400. }
  36401. var o = function(e, t, i) {
  36402. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36403. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36404. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36405. !i) {
  36406. if (e |= 0,
  36407. e < 0)
  36408. throw RangeError("Illegal capacity");
  36409. t = !!t,
  36410. i = !!i
  36411. }
  36412. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36413. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36414. this.offset = 0,
  36415. this.markedOffset = -1,
  36416. this.limit = e,
  36417. this.littleEndian = t,
  36418. this.noAssert = i
  36419. };
  36420. o.VERSION = "5.0.1",
  36421. o.LITTLE_ENDIAN = !0,
  36422. o.BIG_ENDIAN = !1,
  36423. o.DEFAULT_CAPACITY = 16,
  36424. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36425. o.DEFAULT_NOASSERT = !1,
  36426. o.Long = e || null;
  36427. var a = o.prototype;
  36428. a.__isByteBuffer__,
  36429. Object.defineProperty(a, "__isByteBuffer__", {
  36430. value: !0,
  36431. enumerable: !1,
  36432. configurable: !1
  36433. });
  36434. var s = new ArrayBuffer(0)
  36435. , l = String.fromCharCode;
  36436. o.accessor = function() {
  36437. return Uint8Array
  36438. }
  36439. ,
  36440. o.allocate = function(e, t, i) {
  36441. return new o(e,t,i)
  36442. }
  36443. ,
  36444. o.concat = function(e, t, i, n) {
  36445. "boolean" != typeof t && "string" == typeof t || (n = i,
  36446. i = t,
  36447. t = void 0);
  36448. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  36449. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  36450. r = e[s].limit - e[s].offset,
  36451. r > 0 && (a += r);
  36452. if (0 === a)
  36453. return new o(0,i,n);
  36454. var c, h = new o(a,i,n);
  36455. for (s = 0; s < l; )
  36456. c = e[s++],
  36457. r = c.limit - c.offset,
  36458. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  36459. h.offset += r);
  36460. return h.limit = h.offset,
  36461. h.offset = 0,
  36462. h
  36463. }
  36464. ,
  36465. o.isByteBuffer = function(e) {
  36466. return (e && e.__isByteBuffer__) === !0
  36467. }
  36468. ,
  36469. o.type = function() {
  36470. return ArrayBuffer
  36471. }
  36472. ,
  36473. o.wrap = function(e, t, i, n) {
  36474. if ("string" != typeof t && (n = i,
  36475. i = t,
  36476. t = void 0),
  36477. "string" == typeof e)
  36478. switch ("undefined" == typeof t && (t = "utf8"),
  36479. t) {
  36480. case "base64":
  36481. return o.fromBase64(e, i);
  36482. case "hex":
  36483. return o.fromHex(e, i);
  36484. case "binary":
  36485. return o.fromBinary(e, i);
  36486. case "utf8":
  36487. return o.fromUTF8(e, i);
  36488. case "debug":
  36489. return o.fromDebug(e, i);
  36490. default:
  36491. throw Error("Unsupported encoding: " + t)
  36492. }
  36493. if (null === e || "object" != typeof e)
  36494. throw TypeError("Illegal buffer");
  36495. var r;
  36496. if (o.isByteBuffer(e))
  36497. return r = a.clone.call(e),
  36498. r.markedOffset = -1,
  36499. r;
  36500. if (e instanceof Uint8Array)
  36501. r = new o(0,i,n),
  36502. e.length > 0 && (r.buffer = e.buffer,
  36503. r.offset = e.byteOffset,
  36504. r.limit = e.byteOffset + e.byteLength,
  36505. r.view = new Uint8Array(e.buffer));
  36506. else if (e instanceof ArrayBuffer)
  36507. r = new o(0,i,n),
  36508. e.byteLength > 0 && (r.buffer = e,
  36509. r.offset = 0,
  36510. r.limit = e.byteLength,
  36511. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  36512. else {
  36513. if ("[object Array]" !== Object.prototype.toString.call(e))
  36514. throw TypeError("Illegal buffer");
  36515. r = new o(e.length,i,n),
  36516. r.limit = e.length;
  36517. for (var s = 0; s < e.length; ++s)
  36518. r.view[s] = e[s]
  36519. }
  36520. return r
  36521. }
  36522. ,
  36523. a.writeBitSet = function(e, t) {
  36524. var i = "undefined" == typeof t;
  36525. if (i && (t = this.offset),
  36526. !this.noAssert) {
  36527. if (!(e instanceof Array))
  36528. throw TypeError("Illegal BitSet: Not an array");
  36529. if ("number" != typeof t || t % 1 !== 0)
  36530. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36531. if (t >>>= 0,
  36532. t < 0 || t + 0 > this.buffer.byteLength)
  36533. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36534. }
  36535. var n, r = t, o = e.length, a = o >> 3, s = 0;
  36536. for (t += this.writeVarint32(o, t); a--; )
  36537. 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,
  36538. this.writeByte(n, t++);
  36539. if (s < o) {
  36540. var l = 0;
  36541. for (n = 0; s < o; )
  36542. n |= (1 & !!e[s++]) << l++;
  36543. this.writeByte(n, t++)
  36544. }
  36545. return i ? (this.offset = t,
  36546. this) : t - r
  36547. }
  36548. ,
  36549. a.readBitSet = function(e) {
  36550. var t = "undefined" == typeof e;
  36551. t && (e = this.offset);
  36552. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  36553. for (e += n.length; o--; )
  36554. i = this.readByte(e++),
  36555. s[a++] = !!(1 & i),
  36556. s[a++] = !!(2 & i),
  36557. s[a++] = !!(4 & i),
  36558. s[a++] = !!(8 & i),
  36559. s[a++] = !!(16 & i),
  36560. s[a++] = !!(32 & i),
  36561. s[a++] = !!(64 & i),
  36562. s[a++] = !!(128 & i);
  36563. if (a < r) {
  36564. var l = 0;
  36565. for (i = this.readByte(e++); a < r; )
  36566. s[a++] = !!(i >> l++ & 1)
  36567. }
  36568. return t && (this.offset = e),
  36569. s
  36570. }
  36571. ,
  36572. a.readBytes = function(e, t) {
  36573. var i = "undefined" == typeof t;
  36574. if (i && (t = this.offset),
  36575. !this.noAssert) {
  36576. if ("number" != typeof t || t % 1 !== 0)
  36577. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36578. if (t >>>= 0,
  36579. t < 0 || t + e > this.buffer.byteLength)
  36580. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  36581. }
  36582. var n = this.slice(t, t + e);
  36583. return i && (this.offset += e),
  36584. n
  36585. }
  36586. ,
  36587. a.writeBytes = a.append,
  36588. a.writeInt8 = function(e, t) {
  36589. var i = "undefined" == typeof t;
  36590. if (i && (t = this.offset),
  36591. !this.noAssert) {
  36592. if ("number" != typeof e || e % 1 !== 0)
  36593. throw TypeError("Illegal value: " + e + " (not an integer)");
  36594. if (e |= 0,
  36595. "number" != typeof t || t % 1 !== 0)
  36596. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36597. if (t >>>= 0,
  36598. t < 0 || t + 0 > this.buffer.byteLength)
  36599. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36600. }
  36601. t += 1;
  36602. var n = this.buffer.byteLength;
  36603. return t > n && this.resize((n *= 2) > t ? n : t),
  36604. t -= 1,
  36605. this.view[t] = e,
  36606. i && (this.offset += 1),
  36607. this
  36608. }
  36609. ,
  36610. a.writeByte = a.writeInt8,
  36611. a.readInt8 = function(e) {
  36612. var t = "undefined" == typeof e;
  36613. if (t && (e = this.offset),
  36614. !this.noAssert) {
  36615. if ("number" != typeof e || e % 1 !== 0)
  36616. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36617. if (e >>>= 0,
  36618. e < 0 || e + 1 > this.buffer.byteLength)
  36619. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36620. }
  36621. var i = this.view[e];
  36622. return 128 === (128 & i) && (i = -(255 - i + 1)),
  36623. t && (this.offset += 1),
  36624. i
  36625. }
  36626. ,
  36627. a.readByte = a.readInt8,
  36628. a.writeUint8 = function(e, t) {
  36629. var i = "undefined" == typeof t;
  36630. if (i && (t = this.offset),
  36631. !this.noAssert) {
  36632. if ("number" != typeof e || e % 1 !== 0)
  36633. throw TypeError("Illegal value: " + e + " (not an integer)");
  36634. if (e >>>= 0,
  36635. "number" != typeof t || t % 1 !== 0)
  36636. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36637. if (t >>>= 0,
  36638. t < 0 || t + 0 > this.buffer.byteLength)
  36639. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36640. }
  36641. t += 1;
  36642. var n = this.buffer.byteLength;
  36643. return t > n && this.resize((n *= 2) > t ? n : t),
  36644. t -= 1,
  36645. this.view[t] = e,
  36646. i && (this.offset += 1),
  36647. this
  36648. }
  36649. ,
  36650. a.writeUInt8 = a.writeUint8,
  36651. a.readUint8 = function(e) {
  36652. var t = "undefined" == typeof e;
  36653. if (t && (e = this.offset),
  36654. !this.noAssert) {
  36655. if ("number" != typeof e || e % 1 !== 0)
  36656. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36657. if (e >>>= 0,
  36658. e < 0 || e + 1 > this.buffer.byteLength)
  36659. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36660. }
  36661. var i = this.view[e];
  36662. return t && (this.offset += 1),
  36663. i
  36664. }
  36665. ,
  36666. a.readUInt8 = a.readUint8,
  36667. a.writeInt16 = function(e, t) {
  36668. var i = "undefined" == typeof t;
  36669. if (i && (t = this.offset),
  36670. !this.noAssert) {
  36671. if ("number" != typeof e || e % 1 !== 0)
  36672. throw TypeError("Illegal value: " + e + " (not an integer)");
  36673. if (e |= 0,
  36674. "number" != typeof t || t % 1 !== 0)
  36675. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36676. if (t >>>= 0,
  36677. t < 0 || t + 0 > this.buffer.byteLength)
  36678. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36679. }
  36680. t += 2;
  36681. var n = this.buffer.byteLength;
  36682. return t > n && this.resize((n *= 2) > t ? n : t),
  36683. t -= 2,
  36684. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36685. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36686. this.view[t + 1] = 255 & e),
  36687. i && (this.offset += 2),
  36688. this
  36689. }
  36690. ,
  36691. a.writeShort = a.writeInt16,
  36692. a.readInt16 = function(e) {
  36693. var t = "undefined" == typeof e;
  36694. if (t && (e = this.offset),
  36695. !this.noAssert) {
  36696. if ("number" != typeof e || e % 1 !== 0)
  36697. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36698. if (e >>>= 0,
  36699. e < 0 || e + 2 > this.buffer.byteLength)
  36700. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36701. }
  36702. var i = 0;
  36703. return this.littleEndian ? (i = this.view[e],
  36704. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36705. i |= this.view[e + 1]),
  36706. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  36707. t && (this.offset += 2),
  36708. i
  36709. }
  36710. ,
  36711. a.readShort = a.readInt16,
  36712. a.writeUint16 = function(e, t) {
  36713. var i = "undefined" == typeof t;
  36714. if (i && (t = this.offset),
  36715. !this.noAssert) {
  36716. if ("number" != typeof e || e % 1 !== 0)
  36717. throw TypeError("Illegal value: " + e + " (not an integer)");
  36718. if (e >>>= 0,
  36719. "number" != typeof t || t % 1 !== 0)
  36720. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36721. if (t >>>= 0,
  36722. t < 0 || t + 0 > this.buffer.byteLength)
  36723. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36724. }
  36725. t += 2;
  36726. var n = this.buffer.byteLength;
  36727. return t > n && this.resize((n *= 2) > t ? n : t),
  36728. t -= 2,
  36729. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36730. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36731. this.view[t + 1] = 255 & e),
  36732. i && (this.offset += 2),
  36733. this
  36734. }
  36735. ,
  36736. a.writeUInt16 = a.writeUint16,
  36737. a.readUint16 = function(e) {
  36738. var t = "undefined" == typeof e;
  36739. if (t && (e = this.offset),
  36740. !this.noAssert) {
  36741. if ("number" != typeof e || e % 1 !== 0)
  36742. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36743. if (e >>>= 0,
  36744. e < 0 || e + 2 > this.buffer.byteLength)
  36745. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36746. }
  36747. var i = 0;
  36748. return this.littleEndian ? (i = this.view[e],
  36749. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36750. i |= this.view[e + 1]),
  36751. t && (this.offset += 2),
  36752. i
  36753. }
  36754. ,
  36755. a.readUInt16 = a.readUint16,
  36756. a.writeInt32 = function(e, t) {
  36757. var i = "undefined" == typeof t;
  36758. if (i && (t = this.offset),
  36759. !this.noAssert) {
  36760. if ("number" != typeof e || e % 1 !== 0)
  36761. throw TypeError("Illegal value: " + e + " (not an integer)");
  36762. if (e |= 0,
  36763. "number" != typeof t || t % 1 !== 0)
  36764. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36765. if (t >>>= 0,
  36766. t < 0 || t + 0 > this.buffer.byteLength)
  36767. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36768. }
  36769. t += 4;
  36770. var n = this.buffer.byteLength;
  36771. return t > n && this.resize((n *= 2) > t ? n : t),
  36772. t -= 4,
  36773. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36774. this.view[t + 2] = e >>> 16 & 255,
  36775. this.view[t + 1] = e >>> 8 & 255,
  36776. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36777. this.view[t + 1] = e >>> 16 & 255,
  36778. this.view[t + 2] = e >>> 8 & 255,
  36779. this.view[t + 3] = 255 & e),
  36780. i && (this.offset += 4),
  36781. this
  36782. }
  36783. ,
  36784. a.writeInt = a.writeInt32,
  36785. a.readInt32 = function(e) {
  36786. var t = "undefined" == typeof e;
  36787. if (t && (e = this.offset),
  36788. !this.noAssert) {
  36789. if ("number" != typeof e || e % 1 !== 0)
  36790. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36791. if (e >>>= 0,
  36792. e < 0 || e + 4 > this.buffer.byteLength)
  36793. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36794. }
  36795. var i = 0;
  36796. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36797. i |= this.view[e + 1] << 8,
  36798. i |= this.view[e],
  36799. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36800. i |= this.view[e + 2] << 8,
  36801. i |= this.view[e + 3],
  36802. i += this.view[e] << 24 >>> 0),
  36803. i |= 0,
  36804. t && (this.offset += 4),
  36805. i
  36806. }
  36807. ,
  36808. a.readInt = a.readInt32,
  36809. a.writeUint32 = function(e, t) {
  36810. var i = "undefined" == typeof t;
  36811. if (i && (t = this.offset),
  36812. !this.noAssert) {
  36813. if ("number" != typeof e || e % 1 !== 0)
  36814. throw TypeError("Illegal value: " + e + " (not an integer)");
  36815. if (e >>>= 0,
  36816. "number" != typeof t || t % 1 !== 0)
  36817. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36818. if (t >>>= 0,
  36819. t < 0 || t + 0 > this.buffer.byteLength)
  36820. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36821. }
  36822. t += 4;
  36823. var n = this.buffer.byteLength;
  36824. return t > n && this.resize((n *= 2) > t ? n : t),
  36825. t -= 4,
  36826. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36827. this.view[t + 2] = e >>> 16 & 255,
  36828. this.view[t + 1] = e >>> 8 & 255,
  36829. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36830. this.view[t + 1] = e >>> 16 & 255,
  36831. this.view[t + 2] = e >>> 8 & 255,
  36832. this.view[t + 3] = 255 & e),
  36833. i && (this.offset += 4),
  36834. this
  36835. }
  36836. ,
  36837. a.writeUInt32 = a.writeUint32,
  36838. a.readUint32 = function(e) {
  36839. var t = "undefined" == typeof e;
  36840. if (t && (e = this.offset),
  36841. !this.noAssert) {
  36842. if ("number" != typeof e || e % 1 !== 0)
  36843. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36844. if (e >>>= 0,
  36845. e < 0 || e + 4 > this.buffer.byteLength)
  36846. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36847. }
  36848. var i = 0;
  36849. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36850. i |= this.view[e + 1] << 8,
  36851. i |= this.view[e],
  36852. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36853. i |= this.view[e + 2] << 8,
  36854. i |= this.view[e + 3],
  36855. i += this.view[e] << 24 >>> 0),
  36856. t && (this.offset += 4),
  36857. i
  36858. }
  36859. ,
  36860. a.readUInt32 = a.readUint32,
  36861. e && (a.writeInt64 = function(t, i) {
  36862. var n = "undefined" == typeof i;
  36863. if (n && (i = this.offset),
  36864. !this.noAssert) {
  36865. if ("number" == typeof t)
  36866. t = e.fromNumber(t);
  36867. else if ("string" == typeof t)
  36868. t = e.fromString(t);
  36869. else if (!(t && t instanceof e))
  36870. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36871. if ("number" != typeof i || i % 1 !== 0)
  36872. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36873. if (i >>>= 0,
  36874. i < 0 || i + 0 > this.buffer.byteLength)
  36875. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36876. }
  36877. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36878. i += 8;
  36879. var r = this.buffer.byteLength;
  36880. i > r && this.resize((r *= 2) > i ? r : i),
  36881. i -= 8;
  36882. var o = t.low
  36883. , a = t.high;
  36884. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36885. this.view[i + 2] = o >>> 16 & 255,
  36886. this.view[i + 1] = o >>> 8 & 255,
  36887. this.view[i] = 255 & o,
  36888. i += 4,
  36889. this.view[i + 3] = a >>> 24 & 255,
  36890. this.view[i + 2] = a >>> 16 & 255,
  36891. this.view[i + 1] = a >>> 8 & 255,
  36892. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36893. this.view[i + 1] = a >>> 16 & 255,
  36894. this.view[i + 2] = a >>> 8 & 255,
  36895. this.view[i + 3] = 255 & a,
  36896. i += 4,
  36897. this.view[i] = o >>> 24 & 255,
  36898. this.view[i + 1] = o >>> 16 & 255,
  36899. this.view[i + 2] = o >>> 8 & 255,
  36900. this.view[i + 3] = 255 & o),
  36901. n && (this.offset += 8),
  36902. this
  36903. }
  36904. ,
  36905. a.writeLong = a.writeInt64,
  36906. a.readInt64 = function(t) {
  36907. var i = "undefined" == typeof t;
  36908. if (i && (t = this.offset),
  36909. !this.noAssert) {
  36910. if ("number" != typeof t || t % 1 !== 0)
  36911. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36912. if (t >>>= 0,
  36913. t < 0 || t + 8 > this.buffer.byteLength)
  36914. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36915. }
  36916. var n = 0
  36917. , r = 0;
  36918. this.littleEndian ? (n = this.view[t + 2] << 16,
  36919. n |= this.view[t + 1] << 8,
  36920. n |= this.view[t],
  36921. n += this.view[t + 3] << 24 >>> 0,
  36922. t += 4,
  36923. r = this.view[t + 2] << 16,
  36924. r |= this.view[t + 1] << 8,
  36925. r |= this.view[t],
  36926. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36927. r |= this.view[t + 2] << 8,
  36928. r |= this.view[t + 3],
  36929. r += this.view[t] << 24 >>> 0,
  36930. t += 4,
  36931. n = this.view[t + 1] << 16,
  36932. n |= this.view[t + 2] << 8,
  36933. n |= this.view[t + 3],
  36934. n += this.view[t] << 24 >>> 0);
  36935. var o = new e(n,r,!1);
  36936. return i && (this.offset += 8),
  36937. o
  36938. }
  36939. ,
  36940. a.readLong = a.readInt64,
  36941. a.writeUint64 = function(t, i) {
  36942. var n = "undefined" == typeof i;
  36943. if (n && (i = this.offset),
  36944. !this.noAssert) {
  36945. if ("number" == typeof t)
  36946. t = e.fromNumber(t);
  36947. else if ("string" == typeof t)
  36948. t = e.fromString(t);
  36949. else if (!(t && t instanceof e))
  36950. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36951. if ("number" != typeof i || i % 1 !== 0)
  36952. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36953. if (i >>>= 0,
  36954. i < 0 || i + 0 > this.buffer.byteLength)
  36955. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36956. }
  36957. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36958. i += 8;
  36959. var r = this.buffer.byteLength;
  36960. i > r && this.resize((r *= 2) > i ? r : i),
  36961. i -= 8;
  36962. var o = t.low
  36963. , a = t.high;
  36964. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36965. this.view[i + 2] = o >>> 16 & 255,
  36966. this.view[i + 1] = o >>> 8 & 255,
  36967. this.view[i] = 255 & o,
  36968. i += 4,
  36969. this.view[i + 3] = a >>> 24 & 255,
  36970. this.view[i + 2] = a >>> 16 & 255,
  36971. this.view[i + 1] = a >>> 8 & 255,
  36972. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36973. this.view[i + 1] = a >>> 16 & 255,
  36974. this.view[i + 2] = a >>> 8 & 255,
  36975. this.view[i + 3] = 255 & a,
  36976. i += 4,
  36977. this.view[i] = o >>> 24 & 255,
  36978. this.view[i + 1] = o >>> 16 & 255,
  36979. this.view[i + 2] = o >>> 8 & 255,
  36980. this.view[i + 3] = 255 & o),
  36981. n && (this.offset += 8),
  36982. this
  36983. }
  36984. ,
  36985. a.writeUInt64 = a.writeUint64,
  36986. a.readUint64 = function(t) {
  36987. var i = "undefined" == typeof t;
  36988. if (i && (t = this.offset),
  36989. !this.noAssert) {
  36990. if ("number" != typeof t || t % 1 !== 0)
  36991. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36992. if (t >>>= 0,
  36993. t < 0 || t + 8 > this.buffer.byteLength)
  36994. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36995. }
  36996. var n = 0
  36997. , r = 0;
  36998. this.littleEndian ? (n = this.view[t + 2] << 16,
  36999. n |= this.view[t + 1] << 8,
  37000. n |= this.view[t],
  37001. n += this.view[t + 3] << 24 >>> 0,
  37002. t += 4,
  37003. r = this.view[t + 2] << 16,
  37004. r |= this.view[t + 1] << 8,
  37005. r |= this.view[t],
  37006. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37007. r |= this.view[t + 2] << 8,
  37008. r |= this.view[t + 3],
  37009. r += this.view[t] << 24 >>> 0,
  37010. t += 4,
  37011. n = this.view[t + 1] << 16,
  37012. n |= this.view[t + 2] << 8,
  37013. n |= this.view[t + 3],
  37014. n += this.view[t] << 24 >>> 0);
  37015. var o = new e(n,r,!0);
  37016. return i && (this.offset += 8),
  37017. o
  37018. }
  37019. ,
  37020. a.readUInt64 = a.readUint64),
  37021. a.writeFloat32 = function(e, t) {
  37022. var i = "undefined" == typeof t;
  37023. if (i && (t = this.offset),
  37024. !this.noAssert) {
  37025. if ("number" != typeof e)
  37026. throw TypeError("Illegal value: " + e + " (not a number)");
  37027. if ("number" != typeof t || t % 1 !== 0)
  37028. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37029. if (t >>>= 0,
  37030. t < 0 || t + 0 > this.buffer.byteLength)
  37031. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37032. }
  37033. t += 4;
  37034. var n = this.buffer.byteLength;
  37035. return t > n && this.resize((n *= 2) > t ? n : t),
  37036. t -= 4,
  37037. r(this.view, e, t, this.littleEndian, 23, 4),
  37038. i && (this.offset += 4),
  37039. this
  37040. }
  37041. ,
  37042. a.writeFloat = a.writeFloat32,
  37043. a.readFloat32 = function(e) {
  37044. var t = "undefined" == typeof e;
  37045. if (t && (e = this.offset),
  37046. !this.noAssert) {
  37047. if ("number" != typeof e || e % 1 !== 0)
  37048. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37049. if (e >>>= 0,
  37050. e < 0 || e + 4 > this.buffer.byteLength)
  37051. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37052. }
  37053. var i = n(this.view, e, this.littleEndian, 23, 4);
  37054. return t && (this.offset += 4),
  37055. i
  37056. }
  37057. ,
  37058. a.readFloat = a.readFloat32,
  37059. a.writeFloat64 = function(e, t) {
  37060. var i = "undefined" == typeof t;
  37061. if (i && (t = this.offset),
  37062. !this.noAssert) {
  37063. if ("number" != typeof e)
  37064. throw TypeError("Illegal value: " + e + " (not a number)");
  37065. if ("number" != typeof t || t % 1 !== 0)
  37066. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37067. if (t >>>= 0,
  37068. t < 0 || t + 0 > this.buffer.byteLength)
  37069. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37070. }
  37071. t += 8;
  37072. var n = this.buffer.byteLength;
  37073. return t > n && this.resize((n *= 2) > t ? n : t),
  37074. t -= 8,
  37075. r(this.view, e, t, this.littleEndian, 52, 8),
  37076. i && (this.offset += 8),
  37077. this
  37078. }
  37079. ,
  37080. a.writeDouble = a.writeFloat64,
  37081. a.readFloat64 = function(e) {
  37082. var t = "undefined" == typeof e;
  37083. if (t && (e = this.offset),
  37084. !this.noAssert) {
  37085. if ("number" != typeof e || e % 1 !== 0)
  37086. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37087. if (e >>>= 0,
  37088. e < 0 || e + 8 > this.buffer.byteLength)
  37089. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37090. }
  37091. var i = n(this.view, e, this.littleEndian, 52, 8);
  37092. return t && (this.offset += 8),
  37093. i
  37094. }
  37095. ,
  37096. a.readDouble = a.readFloat64,
  37097. o.MAX_VARINT32_BYTES = 5,
  37098. o.calculateVarint32 = function(e) {
  37099. return e >>>= 0,
  37100. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37101. }
  37102. ,
  37103. o.zigZagEncode32 = function(e) {
  37104. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37105. }
  37106. ,
  37107. o.zigZagDecode32 = function(e) {
  37108. return e >>> 1 ^ -(1 & e) | 0
  37109. }
  37110. ,
  37111. a.writeVarint32 = function(e, t) {
  37112. var i = "undefined" == typeof t;
  37113. if (i && (t = this.offset),
  37114. !this.noAssert) {
  37115. if ("number" != typeof e || e % 1 !== 0)
  37116. throw TypeError("Illegal value: " + e + " (not an integer)");
  37117. if (e |= 0,
  37118. "number" != typeof t || t % 1 !== 0)
  37119. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37120. if (t >>>= 0,
  37121. t < 0 || t + 0 > this.buffer.byteLength)
  37122. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37123. }
  37124. var n, r = o.calculateVarint32(e);
  37125. t += r;
  37126. var a = this.buffer.byteLength;
  37127. for (t > a && this.resize((a *= 2) > t ? a : t),
  37128. t -= r,
  37129. e >>>= 0; e >= 128; )
  37130. n = 127 & e | 128,
  37131. this.view[t++] = n,
  37132. e >>>= 7;
  37133. return this.view[t++] = e,
  37134. i ? (this.offset = t,
  37135. this) : r
  37136. }
  37137. ,
  37138. a.writeVarint32ZigZag = function(e, t) {
  37139. return this.writeVarint32(o.zigZagEncode32(e), t)
  37140. }
  37141. ,
  37142. a.readVarint32 = function(e) {
  37143. var t = "undefined" == typeof e;
  37144. if (t && (e = this.offset),
  37145. !this.noAssert) {
  37146. if ("number" != typeof e || e % 1 !== 0)
  37147. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37148. if (e >>>= 0,
  37149. e < 0 || e + 1 > this.buffer.byteLength)
  37150. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37151. }
  37152. var i, n = 0, r = 0;
  37153. do {
  37154. if (!this.noAssert && e > this.limit) {
  37155. var o = Error("Truncated");
  37156. throw o.truncated = !0,
  37157. o
  37158. }
  37159. i = this.view[e++],
  37160. n < 5 && (r |= (127 & i) << 7 * n),
  37161. ++n
  37162. } while (0 !== (128 & i));return r |= 0,
  37163. t ? (this.offset = e,
  37164. r) : {
  37165. value: r,
  37166. length: n
  37167. }
  37168. }
  37169. ,
  37170. a.readVarint32ZigZag = function(e) {
  37171. var t = this.readVarint32(e);
  37172. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37173. t
  37174. }
  37175. ,
  37176. e && (o.MAX_VARINT64_BYTES = 10,
  37177. o.calculateVarint64 = function(t) {
  37178. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37179. var i = t.toInt() >>> 0
  37180. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37181. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37182. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  37183. }
  37184. ,
  37185. o.zigZagEncode64 = function(t) {
  37186. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37187. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37188. }
  37189. ,
  37190. o.zigZagDecode64 = function(t) {
  37191. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37192. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37193. }
  37194. ,
  37195. a.writeVarint64 = function(t, i) {
  37196. var n = "undefined" == typeof i;
  37197. if (n && (i = this.offset),
  37198. !this.noAssert) {
  37199. if ("number" == typeof t)
  37200. t = e.fromNumber(t);
  37201. else if ("string" == typeof t)
  37202. t = e.fromString(t);
  37203. else if (!(t && t instanceof e))
  37204. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37205. if ("number" != typeof i || i % 1 !== 0)
  37206. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37207. if (i >>>= 0,
  37208. i < 0 || i + 0 > this.buffer.byteLength)
  37209. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37210. }
  37211. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37212. var r = o.calculateVarint64(t)
  37213. , a = t.toInt() >>> 0
  37214. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37215. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37216. i += r;
  37217. var c = this.buffer.byteLength;
  37218. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37219. i -= r,
  37220. r) {
  37221. case 10:
  37222. this.view[i + 9] = l >>> 7 & 1;
  37223. case 9:
  37224. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37225. case 8:
  37226. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37227. case 7:
  37228. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37229. case 6:
  37230. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37231. case 5:
  37232. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37233. case 4:
  37234. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37235. case 3:
  37236. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37237. case 2:
  37238. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37239. case 1:
  37240. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37241. }
  37242. return n ? (this.offset += r,
  37243. this) : r
  37244. }
  37245. ,
  37246. a.writeVarint64ZigZag = function(e, t) {
  37247. return this.writeVarint64(o.zigZagEncode64(e), t)
  37248. }
  37249. ,
  37250. a.readVarint64 = function(t) {
  37251. var i = "undefined" == typeof t;
  37252. if (i && (t = this.offset),
  37253. !this.noAssert) {
  37254. if ("number" != typeof t || t % 1 !== 0)
  37255. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37256. if (t >>>= 0,
  37257. t < 0 || t + 1 > this.buffer.byteLength)
  37258. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37259. }
  37260. var n = t
  37261. , r = 0
  37262. , o = 0
  37263. , a = 0
  37264. , s = 0;
  37265. if (s = this.view[t++],
  37266. r = 127 & s,
  37267. 128 & s && (s = this.view[t++],
  37268. r |= (127 & s) << 7,
  37269. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37270. r |= (127 & s) << 14,
  37271. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37272. r |= (127 & s) << 21,
  37273. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37274. o = 127 & s,
  37275. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37276. o |= (127 & s) << 7,
  37277. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37278. o |= (127 & s) << 14,
  37279. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37280. o |= (127 & s) << 21,
  37281. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37282. a = 127 & s,
  37283. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37284. a |= (127 & s) << 7,
  37285. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37286. throw Error("Buffer overrun");
  37287. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37288. return i ? (this.offset = t,
  37289. l) : {
  37290. value: l,
  37291. length: t - n
  37292. }
  37293. }
  37294. ,
  37295. a.readVarint64ZigZag = function(t) {
  37296. var i = this.readVarint64(t);
  37297. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37298. i
  37299. }
  37300. ),
  37301. a.writeCString = function(e, i) {
  37302. var n = "undefined" == typeof i;
  37303. n && (i = this.offset);
  37304. var r, o = e.length;
  37305. if (!this.noAssert) {
  37306. if ("string" != typeof e)
  37307. throw TypeError("Illegal str: Not a string");
  37308. for (r = 0; r < o; ++r)
  37309. if (0 === e.charCodeAt(r))
  37310. throw RangeError("Illegal str: Contains NULL-characters");
  37311. if ("number" != typeof i || i % 1 !== 0)
  37312. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37313. if (i >>>= 0,
  37314. i < 0 || i + 0 > this.buffer.byteLength)
  37315. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37316. }
  37317. o = h.calculateUTF16asUTF8(t(e))[1],
  37318. i += o + 1;
  37319. var a = this.buffer.byteLength;
  37320. return i > a && this.resize((a *= 2) > i ? a : i),
  37321. i -= o + 1,
  37322. h.encodeUTF16toUTF8(t(e), function(e) {
  37323. this.view[i++] = e
  37324. }
  37325. .bind(this)),
  37326. this.view[i++] = 0,
  37327. n ? (this.offset = i,
  37328. this) : o
  37329. }
  37330. ,
  37331. a.readCString = function(e) {
  37332. var t = "undefined" == typeof e;
  37333. if (t && (e = this.offset),
  37334. !this.noAssert) {
  37335. if ("number" != typeof e || e % 1 !== 0)
  37336. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37337. if (e >>>= 0,
  37338. e < 0 || e + 1 > this.buffer.byteLength)
  37339. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37340. }
  37341. var n, r = e, o = -1;
  37342. return h.decodeUTF8toUTF16(function() {
  37343. if (0 === o)
  37344. return null;
  37345. if (e >= this.limit)
  37346. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37347. return o = this.view[e++],
  37348. 0 === o ? null : o
  37349. }
  37350. .bind(this), n = i(), !0),
  37351. t ? (this.offset = e,
  37352. n()) : {
  37353. string: n(),
  37354. length: e - r
  37355. }
  37356. }
  37357. ,
  37358. a.writeIString = function(e, i) {
  37359. var n = "undefined" == typeof i;
  37360. if (n && (i = this.offset),
  37361. !this.noAssert) {
  37362. if ("string" != typeof e)
  37363. throw TypeError("Illegal str: Not a string");
  37364. if ("number" != typeof i || i % 1 !== 0)
  37365. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37366. if (i >>>= 0,
  37367. i < 0 || i + 0 > this.buffer.byteLength)
  37368. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37369. }
  37370. var r, o = i;
  37371. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37372. i += 4 + r;
  37373. var a = this.buffer.byteLength;
  37374. if (i > a && this.resize((a *= 2) > i ? a : i),
  37375. i -= 4 + r,
  37376. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37377. this.view[i + 2] = r >>> 16 & 255,
  37378. this.view[i + 1] = r >>> 8 & 255,
  37379. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37380. this.view[i + 1] = r >>> 16 & 255,
  37381. this.view[i + 2] = r >>> 8 & 255,
  37382. this.view[i + 3] = 255 & r),
  37383. i += 4,
  37384. h.encodeUTF16toUTF8(t(e), function(e) {
  37385. this.view[i++] = e
  37386. }
  37387. .bind(this)),
  37388. i !== o + 4 + r)
  37389. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37390. return n ? (this.offset = i,
  37391. this) : i - o
  37392. }
  37393. ,
  37394. a.readIString = function(e) {
  37395. var t = "undefined" == typeof e;
  37396. if (t && (e = this.offset),
  37397. !this.noAssert) {
  37398. if ("number" != typeof e || e % 1 !== 0)
  37399. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37400. if (e >>>= 0,
  37401. e < 0 || e + 4 > this.buffer.byteLength)
  37402. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37403. }
  37404. var i = e
  37405. , n = this.readUint32(e)
  37406. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37407. return e += r.length,
  37408. t ? (this.offset = e,
  37409. r.string) : {
  37410. string: r.string,
  37411. length: e - i
  37412. }
  37413. }
  37414. ,
  37415. o.METRICS_CHARS = "c",
  37416. o.METRICS_BYTES = "b",
  37417. a.writeUTF8String = function(e, i) {
  37418. var n = "undefined" == typeof i;
  37419. if (n && (i = this.offset),
  37420. !this.noAssert) {
  37421. if ("number" != typeof i || i % 1 !== 0)
  37422. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37423. if (i >>>= 0,
  37424. i < 0 || i + 0 > this.buffer.byteLength)
  37425. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37426. }
  37427. var r, o = i;
  37428. r = h.calculateUTF16asUTF8(t(e))[1],
  37429. i += r;
  37430. var a = this.buffer.byteLength;
  37431. return i > a && this.resize((a *= 2) > i ? a : i),
  37432. i -= r,
  37433. h.encodeUTF16toUTF8(t(e), function(e) {
  37434. this.view[i++] = e
  37435. }
  37436. .bind(this)),
  37437. n ? (this.offset = i,
  37438. this) : i - o
  37439. }
  37440. ,
  37441. a.writeString = a.writeUTF8String,
  37442. o.calculateUTF8Chars = function(e) {
  37443. return h.calculateUTF16asUTF8(t(e))[0]
  37444. }
  37445. ,
  37446. o.calculateUTF8Bytes = function(e) {
  37447. return h.calculateUTF16asUTF8(t(e))[1]
  37448. }
  37449. ,
  37450. o.calculateString = o.calculateUTF8Bytes,
  37451. a.readUTF8String = function(e, t, n) {
  37452. "number" == typeof t && (n = t,
  37453. t = void 0);
  37454. var r = "undefined" == typeof n;
  37455. if (r && (n = this.offset),
  37456. "undefined" == typeof t && (t = o.METRICS_CHARS),
  37457. !this.noAssert) {
  37458. if ("number" != typeof e || e % 1 !== 0)
  37459. throw TypeError("Illegal length: " + e + " (not an integer)");
  37460. if (e |= 0,
  37461. "number" != typeof n || n % 1 !== 0)
  37462. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37463. if (n >>>= 0,
  37464. n < 0 || n + 0 > this.buffer.byteLength)
  37465. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  37466. }
  37467. var a, s = 0, l = n;
  37468. if (t === o.METRICS_CHARS) {
  37469. if (a = i(),
  37470. h.decodeUTF8(function() {
  37471. return s < e && n < this.limit ? this.view[n++] : null
  37472. }
  37473. .bind(this), function(e) {
  37474. ++s,
  37475. h.UTF8toUTF16(e, a)
  37476. }),
  37477. s !== e)
  37478. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  37479. return r ? (this.offset = n,
  37480. a()) : {
  37481. string: a(),
  37482. length: n - l
  37483. }
  37484. }
  37485. if (t === o.METRICS_BYTES) {
  37486. if (!this.noAssert) {
  37487. if ("number" != typeof n || n % 1 !== 0)
  37488. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37489. if (n >>>= 0,
  37490. n < 0 || n + e > this.buffer.byteLength)
  37491. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  37492. }
  37493. var c = n + e;
  37494. if (h.decodeUTF8toUTF16(function() {
  37495. return n < c ? this.view[n++] : null
  37496. }
  37497. .bind(this), a = i(), this.noAssert),
  37498. n !== c)
  37499. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  37500. return r ? (this.offset = n,
  37501. a()) : {
  37502. string: a(),
  37503. length: n - l
  37504. }
  37505. }
  37506. throw TypeError("Unsupported metrics: " + t)
  37507. }
  37508. ,
  37509. a.readString = a.readUTF8String,
  37510. a.writeVString = function(e, i) {
  37511. var n = "undefined" == typeof i;
  37512. if (n && (i = this.offset),
  37513. !this.noAssert) {
  37514. if ("string" != typeof e)
  37515. throw TypeError("Illegal str: Not a string");
  37516. if ("number" != typeof i || i % 1 !== 0)
  37517. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37518. if (i >>>= 0,
  37519. i < 0 || i + 0 > this.buffer.byteLength)
  37520. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37521. }
  37522. var r, a, s = i;
  37523. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37524. a = o.calculateVarint32(r),
  37525. i += a + r;
  37526. var l = this.buffer.byteLength;
  37527. if (i > l && this.resize((l *= 2) > i ? l : i),
  37528. i -= a + r,
  37529. i += this.writeVarint32(r, i),
  37530. h.encodeUTF16toUTF8(t(e), function(e) {
  37531. this.view[i++] = e
  37532. }
  37533. .bind(this)),
  37534. i !== s + r + a)
  37535. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  37536. return n ? (this.offset = i,
  37537. this) : i - s
  37538. }
  37539. ,
  37540. a.readVString = function(e) {
  37541. var t = "undefined" == typeof e;
  37542. if (t && (e = this.offset),
  37543. !this.noAssert) {
  37544. if ("number" != typeof e || e % 1 !== 0)
  37545. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37546. if (e >>>= 0,
  37547. e < 0 || e + 1 > this.buffer.byteLength)
  37548. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37549. }
  37550. var i = e
  37551. , n = this.readVarint32(e)
  37552. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  37553. return e += r.length,
  37554. t ? (this.offset = e,
  37555. r.string) : {
  37556. string: r.string,
  37557. length: e - i
  37558. }
  37559. }
  37560. ,
  37561. a.append = function(e, t, i) {
  37562. "number" != typeof t && "string" == typeof t || (i = t,
  37563. t = void 0);
  37564. var n = "undefined" == typeof i;
  37565. if (n && (i = this.offset),
  37566. !this.noAssert) {
  37567. if ("number" != typeof i || i % 1 !== 0)
  37568. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37569. if (i >>>= 0,
  37570. i < 0 || i + 0 > this.buffer.byteLength)
  37571. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37572. }
  37573. e instanceof o || (e = o.wrap(e, t));
  37574. var r = e.limit - e.offset;
  37575. if (r <= 0)
  37576. return this;
  37577. i += r;
  37578. var a = this.buffer.byteLength;
  37579. return i > a && this.resize((a *= 2) > i ? a : i),
  37580. i -= r,
  37581. this.view.set(e.view.subarray(e.offset, e.limit), i),
  37582. e.offset += r,
  37583. n && (this.offset += r),
  37584. this
  37585. }
  37586. ,
  37587. a.appendTo = function(e, t) {
  37588. return e.append(this, t),
  37589. this
  37590. }
  37591. ,
  37592. a.assert = function(e) {
  37593. return this.noAssert = !e,
  37594. this
  37595. }
  37596. ,
  37597. a.capacity = function() {
  37598. return this.buffer.byteLength
  37599. }
  37600. ,
  37601. a.clear = function() {
  37602. return this.offset = 0,
  37603. this.limit = this.buffer.byteLength,
  37604. this.markedOffset = -1,
  37605. this
  37606. }
  37607. ,
  37608. a.clone = function(e) {
  37609. var t = new o(0,this.littleEndian,this.noAssert);
  37610. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  37611. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  37612. t.view = this.view),
  37613. t.offset = this.offset,
  37614. t.markedOffset = this.markedOffset,
  37615. t.limit = this.limit,
  37616. t
  37617. }
  37618. ,
  37619. a.compact = function(e, t) {
  37620. if ("undefined" == typeof e && (e = this.offset),
  37621. "undefined" == typeof t && (t = this.limit),
  37622. !this.noAssert) {
  37623. if ("number" != typeof e || e % 1 !== 0)
  37624. throw TypeError("Illegal begin: Not an integer");
  37625. if (e >>>= 0,
  37626. "number" != typeof t || t % 1 !== 0)
  37627. throw TypeError("Illegal end: Not an integer");
  37628. if (t >>>= 0,
  37629. e < 0 || e > t || t > this.buffer.byteLength)
  37630. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37631. }
  37632. if (0 === e && t === this.buffer.byteLength)
  37633. return this;
  37634. var i = t - e;
  37635. if (0 === i)
  37636. return this.buffer = s,
  37637. this.view = null,
  37638. this.markedOffset >= 0 && (this.markedOffset -= e),
  37639. this.offset = 0,
  37640. this.limit = 0,
  37641. this;
  37642. var n = new ArrayBuffer(i)
  37643. , r = new Uint8Array(n);
  37644. return r.set(this.view.subarray(e, t)),
  37645. this.buffer = n,
  37646. this.view = r,
  37647. this.markedOffset >= 0 && (this.markedOffset -= e),
  37648. this.offset = 0,
  37649. this.limit = i,
  37650. this
  37651. }
  37652. ,
  37653. a.copy = function(e, t) {
  37654. if ("undefined" == typeof e && (e = this.offset),
  37655. "undefined" == typeof t && (t = this.limit),
  37656. !this.noAssert) {
  37657. if ("number" != typeof e || e % 1 !== 0)
  37658. throw TypeError("Illegal begin: Not an integer");
  37659. if (e >>>= 0,
  37660. "number" != typeof t || t % 1 !== 0)
  37661. throw TypeError("Illegal end: Not an integer");
  37662. if (t >>>= 0,
  37663. e < 0 || e > t || t > this.buffer.byteLength)
  37664. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37665. }
  37666. if (e === t)
  37667. return new o(0,this.littleEndian,this.noAssert);
  37668. var i = t - e
  37669. , n = new o(i,this.littleEndian,this.noAssert);
  37670. return n.offset = 0,
  37671. n.limit = i,
  37672. n.markedOffset >= 0 && (n.markedOffset -= e),
  37673. this.copyTo(n, 0, e, t),
  37674. n
  37675. }
  37676. ,
  37677. a.copyTo = function(e, t, i, n) {
  37678. var r, a;
  37679. if (!this.noAssert && !o.isByteBuffer(e))
  37680. throw TypeError("Illegal target: Not a ByteBuffer");
  37681. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  37682. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  37683. n = "undefined" == typeof n ? this.limit : 0 | n,
  37684. t < 0 || t > e.buffer.byteLength)
  37685. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  37686. if (i < 0 || n > this.buffer.byteLength)
  37687. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  37688. var s = n - i;
  37689. return 0 === s ? e : (e.ensureCapacity(t + s),
  37690. e.view.set(this.view.subarray(i, n), t),
  37691. r && (this.offset += s),
  37692. a && (e.offset += s),
  37693. this)
  37694. }
  37695. ,
  37696. a.ensureCapacity = function(e) {
  37697. var t = this.buffer.byteLength;
  37698. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  37699. }
  37700. ,
  37701. a.fill = function(e, t, i) {
  37702. var n = "undefined" == typeof t;
  37703. if (n && (t = this.offset),
  37704. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  37705. "undefined" == typeof t && (t = this.offset),
  37706. "undefined" == typeof i && (i = this.limit),
  37707. !this.noAssert) {
  37708. if ("number" != typeof e || e % 1 !== 0)
  37709. throw TypeError("Illegal value: " + e + " (not an integer)");
  37710. if (e |= 0,
  37711. "number" != typeof t || t % 1 !== 0)
  37712. throw TypeError("Illegal begin: Not an integer");
  37713. if (t >>>= 0,
  37714. "number" != typeof i || i % 1 !== 0)
  37715. throw TypeError("Illegal end: Not an integer");
  37716. if (i >>>= 0,
  37717. t < 0 || t > i || i > this.buffer.byteLength)
  37718. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37719. }
  37720. if (t >= i)
  37721. return this;
  37722. for (; t < i; )
  37723. this.view[t++] = e;
  37724. return n && (this.offset = t),
  37725. this
  37726. }
  37727. ,
  37728. a.flip = function() {
  37729. return this.limit = this.offset,
  37730. this.offset = 0,
  37731. this
  37732. }
  37733. ,
  37734. a.mark = function(e) {
  37735. if (e = "undefined" == typeof e ? this.offset : e,
  37736. !this.noAssert) {
  37737. if ("number" != typeof e || e % 1 !== 0)
  37738. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37739. if (e >>>= 0,
  37740. e < 0 || e + 0 > this.buffer.byteLength)
  37741. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  37742. }
  37743. return this.markedOffset = e,
  37744. this
  37745. }
  37746. ,
  37747. a.order = function(e) {
  37748. if (!this.noAssert && "boolean" != typeof e)
  37749. throw TypeError("Illegal littleEndian: Not a boolean");
  37750. return this.littleEndian = !!e,
  37751. this
  37752. }
  37753. ,
  37754. a.LE = function(e) {
  37755. return this.littleEndian = "undefined" == typeof e || !!e,
  37756. this
  37757. }
  37758. ,
  37759. a.BE = function(e) {
  37760. return this.littleEndian = "undefined" != typeof e && !e,
  37761. this
  37762. }
  37763. ,
  37764. a.prepend = function(e, t, i) {
  37765. "number" != typeof t && "string" == typeof t || (i = t,
  37766. t = void 0);
  37767. var n = "undefined" == typeof i;
  37768. if (n && (i = this.offset),
  37769. !this.noAssert) {
  37770. if ("number" != typeof i || i % 1 !== 0)
  37771. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37772. if (i >>>= 0,
  37773. i < 0 || i + 0 > this.buffer.byteLength)
  37774. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37775. }
  37776. e instanceof o || (e = o.wrap(e, t));
  37777. var r = e.limit - e.offset;
  37778. if (r <= 0)
  37779. return this;
  37780. var a = r - i;
  37781. if (a > 0) {
  37782. var s = new ArrayBuffer(this.buffer.byteLength + a)
  37783. , l = new Uint8Array(s);
  37784. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  37785. this.buffer = s,
  37786. this.view = l,
  37787. this.offset += a,
  37788. this.markedOffset >= 0 && (this.markedOffset += a),
  37789. this.limit += a,
  37790. i += a
  37791. } else {
  37792. new Uint8Array(this.buffer)
  37793. }
  37794. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  37795. e.offset = e.limit,
  37796. n && (this.offset -= r),
  37797. this
  37798. }
  37799. ,
  37800. a.prependTo = function(e, t) {
  37801. return e.prepend(this, t),
  37802. this
  37803. }
  37804. ,
  37805. a.printDebug = function(e) {
  37806. "function" != typeof e && (e = console.log.bind(console)),
  37807. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  37808. }
  37809. ,
  37810. a.remaining = function() {
  37811. return this.limit - this.offset
  37812. }
  37813. ,
  37814. a.reset = function() {
  37815. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  37816. this.markedOffset = -1) : this.offset = 0,
  37817. this
  37818. }
  37819. ,
  37820. a.resize = function(e) {
  37821. if (!this.noAssert) {
  37822. if ("number" != typeof e || e % 1 !== 0)
  37823. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  37824. if (e |= 0,
  37825. e < 0)
  37826. throw RangeError("Illegal capacity: 0 <= " + e)
  37827. }
  37828. if (this.buffer.byteLength < e) {
  37829. var t = new ArrayBuffer(e)
  37830. , i = new Uint8Array(t);
  37831. i.set(this.view),
  37832. this.buffer = t,
  37833. this.view = i
  37834. }
  37835. return this
  37836. }
  37837. ,
  37838. a.reverse = function(e, t) {
  37839. if ("undefined" == typeof e && (e = this.offset),
  37840. "undefined" == typeof t && (t = this.limit),
  37841. !this.noAssert) {
  37842. if ("number" != typeof e || e % 1 !== 0)
  37843. throw TypeError("Illegal begin: Not an integer");
  37844. if (e >>>= 0,
  37845. "number" != typeof t || t % 1 !== 0)
  37846. throw TypeError("Illegal end: Not an integer");
  37847. if (t >>>= 0,
  37848. e < 0 || e > t || t > this.buffer.byteLength)
  37849. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37850. }
  37851. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  37852. this)
  37853. }
  37854. ,
  37855. a.skip = function(e) {
  37856. if (!this.noAssert) {
  37857. if ("number" != typeof e || e % 1 !== 0)
  37858. throw TypeError("Illegal length: " + e + " (not an integer)");
  37859. e |= 0
  37860. }
  37861. var t = this.offset + e;
  37862. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  37863. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  37864. return this.offset = t,
  37865. this
  37866. }
  37867. ,
  37868. a.slice = function(e, t) {
  37869. if ("undefined" == typeof e && (e = this.offset),
  37870. "undefined" == typeof t && (t = this.limit),
  37871. !this.noAssert) {
  37872. if ("number" != typeof e || e % 1 !== 0)
  37873. throw TypeError("Illegal begin: Not an integer");
  37874. if (e >>>= 0,
  37875. "number" != typeof t || t % 1 !== 0)
  37876. throw TypeError("Illegal end: Not an integer");
  37877. if (t >>>= 0,
  37878. e < 0 || e > t || t > this.buffer.byteLength)
  37879. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37880. }
  37881. var i = this.clone();
  37882. return i.offset = e,
  37883. i.limit = t,
  37884. i
  37885. }
  37886. ,
  37887. a.toBuffer = function(e) {
  37888. var t = this.offset
  37889. , i = this.limit;
  37890. if (!this.noAssert) {
  37891. if ("number" != typeof t || t % 1 !== 0)
  37892. throw TypeError("Illegal offset: Not an integer");
  37893. if (t >>>= 0,
  37894. "number" != typeof i || i % 1 !== 0)
  37895. throw TypeError("Illegal limit: Not an integer");
  37896. if (i >>>= 0,
  37897. t < 0 || t > i || i > this.buffer.byteLength)
  37898. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37899. }
  37900. if (!e && 0 === t && i === this.buffer.byteLength)
  37901. return this.buffer;
  37902. if (t === i)
  37903. return s;
  37904. var n = new ArrayBuffer(i - t);
  37905. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  37906. n
  37907. }
  37908. ,
  37909. a.toArrayBuffer = a.toBuffer,
  37910. a.toString = function(e, t, i) {
  37911. if ("undefined" == typeof e)
  37912. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  37913. switch ("number" == typeof e && (e = "utf8",
  37914. t = e,
  37915. i = t),
  37916. e) {
  37917. case "utf8":
  37918. return this.toUTF8(t, i);
  37919. case "base64":
  37920. return this.toBase64(t, i);
  37921. case "hex":
  37922. return this.toHex(t, i);
  37923. case "binary":
  37924. return this.toBinary(t, i);
  37925. case "debug":
  37926. return this.toDebug();
  37927. case "columns":
  37928. return this.toColumns();
  37929. default:
  37930. throw Error("Unsupported encoding: " + e)
  37931. }
  37932. }
  37933. ;
  37934. var c = function() {
  37935. for (var e = {}, t = [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], i = [], n = 0, r = t.length; n < r; ++n)
  37936. i[t[n]] = n;
  37937. return e.encode = function(e, i) {
  37938. for (var n, r; null !== (n = e()); )
  37939. i(t[n >> 2 & 63]),
  37940. r = (3 & n) << 4,
  37941. null !== (n = e()) ? (r |= n >> 4 & 15,
  37942. i(t[63 & (r | n >> 4 & 15)]),
  37943. r = (15 & n) << 2,
  37944. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  37945. i(t[63 & n])) : (i(t[63 & r]),
  37946. i(61))) : (i(t[63 & r]),
  37947. i(61),
  37948. i(61))
  37949. }
  37950. ,
  37951. e.decode = function(e, t) {
  37952. function n(e) {
  37953. throw Error("Illegal character code: " + e)
  37954. }
  37955. for (var r, o, a; null !== (r = e()); )
  37956. if (o = i[r],
  37957. "undefined" == typeof o && n(r),
  37958. null !== (r = e()) && (a = i[r],
  37959. "undefined" == typeof a && n(r),
  37960. t(o << 2 >>> 0 | (48 & a) >> 4),
  37961. null !== (r = e()))) {
  37962. if (o = i[r],
  37963. "undefined" == typeof o) {
  37964. if (61 === r)
  37965. break;
  37966. n(r)
  37967. }
  37968. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  37969. null !== (r = e())) {
  37970. if (a = i[r],
  37971. "undefined" == typeof a) {
  37972. if (61 === r)
  37973. break;
  37974. n(r)
  37975. }
  37976. t((3 & o) << 6 >>> 0 | a)
  37977. }
  37978. }
  37979. }
  37980. ,
  37981. e.test = function(e) {
  37982. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  37983. }
  37984. ,
  37985. e
  37986. }();
  37987. a.toBase64 = function(e, t) {
  37988. if ("undefined" == typeof e && (e = this.offset),
  37989. "undefined" == typeof t && (t = this.limit),
  37990. e |= 0,
  37991. t |= 0,
  37992. e < 0 || t > this.capacity || e > t)
  37993. throw RangeError("begin, end");
  37994. var n;
  37995. return c.encode(function() {
  37996. return e < t ? this.view[e++] : null
  37997. }
  37998. .bind(this), n = i()),
  37999. n()
  38000. }
  38001. ,
  38002. o.fromBase64 = function(e, i) {
  38003. if ("string" != typeof e)
  38004. throw TypeError("str");
  38005. var n = new o(e.length / 4 * 3,i)
  38006. , r = 0;
  38007. return c.decode(t(e), function(e) {
  38008. n.view[r++] = e
  38009. }),
  38010. n.limit = r,
  38011. n
  38012. }
  38013. ,
  38014. o.btoa = function(e) {
  38015. return o.fromBinary(e).toBase64()
  38016. }
  38017. ,
  38018. o.atob = function(e) {
  38019. return o.fromBase64(e).toBinary()
  38020. }
  38021. ,
  38022. a.toBinary = function(e, t) {
  38023. if ("undefined" == typeof e && (e = this.offset),
  38024. "undefined" == typeof t && (t = this.limit),
  38025. e |= 0,
  38026. t |= 0,
  38027. e < 0 || t > this.capacity() || e > t)
  38028. throw RangeError("begin, end");
  38029. if (e === t)
  38030. return "";
  38031. for (var i = [], n = []; e < t; )
  38032. i.push(this.view[e++]),
  38033. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38034. i = []);
  38035. return n.join("") + String.fromCharCode.apply(String, i)
  38036. }
  38037. ,
  38038. o.fromBinary = function(e, t) {
  38039. if ("string" != typeof e)
  38040. throw TypeError("str");
  38041. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38042. if (i = e.charCodeAt(n),
  38043. i > 255)
  38044. throw RangeError("illegal char code: " + i);
  38045. a.view[n++] = i
  38046. }
  38047. return a.limit = r,
  38048. a
  38049. }
  38050. ,
  38051. a.toDebug = function(e) {
  38052. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38053. if (i !== -1 && (t = this.view[i],
  38054. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38055. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38056. ++i,
  38057. e && i > 0 && i % 16 === 0 && i !== n) {
  38058. for (; r.length < 51; )
  38059. r += " ";
  38060. a += r + o + "\n",
  38061. r = o = ""
  38062. }
  38063. 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 ? " " : ""
  38064. }
  38065. if (e && " " !== r) {
  38066. for (; r.length < 51; )
  38067. r += " ";
  38068. a += r + o + "\n"
  38069. }
  38070. return e ? a : r
  38071. }
  38072. ,
  38073. o.fromDebug = function(e, t, i) {
  38074. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  38075. switch (n = e.charAt(l++)) {
  38076. case "!":
  38077. if (!i) {
  38078. if (u || d || p) {
  38079. f = !0;
  38080. break
  38081. }
  38082. u = d = p = !0
  38083. }
  38084. s.offset = s.markedOffset = s.limit = c,
  38085. h = !1;
  38086. break;
  38087. case "|":
  38088. if (!i) {
  38089. if (u || p) {
  38090. f = !0;
  38091. break
  38092. }
  38093. u = p = !0
  38094. }
  38095. s.offset = s.limit = c,
  38096. h = !1;
  38097. break;
  38098. case "[":
  38099. if (!i) {
  38100. if (u || d) {
  38101. f = !0;
  38102. break
  38103. }
  38104. u = d = !0
  38105. }
  38106. s.offset = s.markedOffset = c,
  38107. h = !1;
  38108. break;
  38109. case "<":
  38110. if (!i) {
  38111. if (u) {
  38112. f = !0;
  38113. break
  38114. }
  38115. u = !0
  38116. }
  38117. s.offset = c,
  38118. h = !1;
  38119. break;
  38120. case "]":
  38121. if (!i) {
  38122. if (p || d) {
  38123. f = !0;
  38124. break
  38125. }
  38126. p = d = !0
  38127. }
  38128. s.limit = s.markedOffset = c,
  38129. h = !1;
  38130. break;
  38131. case ">":
  38132. if (!i) {
  38133. if (p) {
  38134. f = !0;
  38135. break
  38136. }
  38137. p = !0
  38138. }
  38139. s.limit = c,
  38140. h = !1;
  38141. break;
  38142. case "'":
  38143. if (!i) {
  38144. if (d) {
  38145. f = !0;
  38146. break
  38147. }
  38148. d = !0
  38149. }
  38150. s.markedOffset = c,
  38151. h = !1;
  38152. break;
  38153. case " ":
  38154. h = !1;
  38155. break;
  38156. default:
  38157. if (!i && h) {
  38158. f = !0;
  38159. break
  38160. }
  38161. if (r = parseInt(n + e.charAt(l++), 16),
  38162. !i && (isNaN(r) || r < 0 || r > 255))
  38163. throw TypeError("Illegal str: Not a debug encoded string");
  38164. s.view[c++] = r,
  38165. h = !0
  38166. }
  38167. if (f)
  38168. throw TypeError("Illegal str: Invalid symbol at " + l)
  38169. }
  38170. if (!i) {
  38171. if (!u || !p)
  38172. throw TypeError("Illegal str: Missing offset or limit");
  38173. if (c < s.buffer.byteLength)
  38174. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38175. }
  38176. return s
  38177. }
  38178. ,
  38179. a.toHex = function(e, t) {
  38180. if (e = "undefined" == typeof e ? this.offset : e,
  38181. t = "undefined" == typeof t ? this.limit : t,
  38182. !this.noAssert) {
  38183. if ("number" != typeof e || e % 1 !== 0)
  38184. throw TypeError("Illegal begin: Not an integer");
  38185. if (e >>>= 0,
  38186. "number" != typeof t || t % 1 !== 0)
  38187. throw TypeError("Illegal end: Not an integer");
  38188. if (t >>>= 0,
  38189. e < 0 || e > t || t > this.buffer.byteLength)
  38190. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38191. }
  38192. for (var i, n = new Array(t - e); e < t; )
  38193. i = this.view[e++],
  38194. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38195. return n.join("")
  38196. }
  38197. ,
  38198. o.fromHex = function(e, t, i) {
  38199. if (!i) {
  38200. if ("string" != typeof e)
  38201. throw TypeError("Illegal str: Not a string");
  38202. if (e.length % 2 !== 0)
  38203. throw TypeError("Illegal str: Length not a multiple of 2")
  38204. }
  38205. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38206. if (n = parseInt(e.substring(s, s + 2), 16),
  38207. !i && (!isFinite(n) || n < 0 || n > 255))
  38208. throw TypeError("Illegal str: Contains non-hex characters");
  38209. a.view[l++] = n
  38210. }
  38211. return a.limit = l,
  38212. a
  38213. }
  38214. ;
  38215. var h = function() {
  38216. var e = {};
  38217. return e.MAX_CODEPOINT = 1114111,
  38218. e.encodeUTF8 = function(e, t) {
  38219. var i = null;
  38220. for ("number" == typeof e && (i = e,
  38221. e = function() {
  38222. return null
  38223. }
  38224. ); null !== i || null !== (i = e()); )
  38225. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38226. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38227. t(i >> 6 & 63 | 128),
  38228. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38229. t(i >> 12 & 63 | 128),
  38230. t(i >> 6 & 63 | 128),
  38231. t(63 & i | 128)),
  38232. i = null
  38233. }
  38234. ,
  38235. e.decodeUTF8 = function(e, t) {
  38236. for (var i, n, r, o, a = function(e) {
  38237. e = e.slice(0, e.indexOf(null));
  38238. var t = Error(e.toString());
  38239. throw t.name = "TruncatedError",
  38240. t.bytes = e,
  38241. t
  38242. }; null !== (i = e()); )
  38243. if (0 === (128 & i))
  38244. t(i);
  38245. else if (192 === (224 & i))
  38246. null === (n = e()) && a([i, n]),
  38247. t((31 & i) << 6 | 63 & n);
  38248. else if (224 === (240 & i))
  38249. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38250. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38251. else {
  38252. if (240 !== (248 & i))
  38253. throw RangeError("Illegal starting byte: " + i);
  38254. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38255. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38256. }
  38257. }
  38258. ,
  38259. e.UTF16toUTF8 = function(e, t) {
  38260. for (var i, n = null; ; ) {
  38261. if (null === (i = null !== n ? n : e()))
  38262. break;
  38263. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38264. n = null) : t(i)
  38265. }
  38266. null !== n && t(n)
  38267. }
  38268. ,
  38269. e.UTF8toUTF16 = function(e, t) {
  38270. var i = null;
  38271. for ("number" == typeof e && (i = e,
  38272. e = function() {
  38273. return null
  38274. }
  38275. ); null !== i || null !== (i = e()); )
  38276. i <= 65535 ? t(i) : (i -= 65536,
  38277. t((i >> 10) + 55296),
  38278. t(i % 1024 + 56320)),
  38279. i = null
  38280. }
  38281. ,
  38282. e.encodeUTF16toUTF8 = function(t, i) {
  38283. e.UTF16toUTF8(t, function(t) {
  38284. e.encodeUTF8(t, i)
  38285. })
  38286. }
  38287. ,
  38288. e.decodeUTF8toUTF16 = function(t, i) {
  38289. e.decodeUTF8(t, function(t) {
  38290. e.UTF8toUTF16(t, i)
  38291. })
  38292. }
  38293. ,
  38294. e.calculateCodePoint = function(e) {
  38295. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38296. }
  38297. ,
  38298. e.calculateUTF8 = function(e) {
  38299. for (var t, i = 0; null !== (t = e()); )
  38300. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38301. return i
  38302. }
  38303. ,
  38304. e.calculateUTF16asUTF8 = function(t) {
  38305. var i = 0
  38306. , n = 0;
  38307. return e.UTF16toUTF8(t, function(e) {
  38308. ++i,
  38309. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38310. }),
  38311. [i, n]
  38312. }
  38313. ,
  38314. e
  38315. }();
  38316. return a.toUTF8 = function(e, t) {
  38317. if ("undefined" == typeof e && (e = this.offset),
  38318. "undefined" == typeof t && (t = this.limit),
  38319. !this.noAssert) {
  38320. if ("number" != typeof e || e % 1 !== 0)
  38321. throw TypeError("Illegal begin: Not an integer");
  38322. if (e >>>= 0,
  38323. "number" != typeof t || t % 1 !== 0)
  38324. throw TypeError("Illegal end: Not an integer");
  38325. if (t >>>= 0,
  38326. e < 0 || e > t || t > this.buffer.byteLength)
  38327. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38328. }
  38329. var n;
  38330. try {
  38331. h.decodeUTF8toUTF16(function() {
  38332. return e < t ? this.view[e++] : null
  38333. }
  38334. .bind(this), n = i())
  38335. } catch (i) {
  38336. if (e !== t)
  38337. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38338. }
  38339. return n()
  38340. }
  38341. ,
  38342. o.fromUTF8 = function(e, i, n) {
  38343. if (!n && "string" != typeof e)
  38344. throw TypeError("Illegal str: Not a string");
  38345. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38346. , a = 0;
  38347. return h.encodeUTF16toUTF8(t(e), function(e) {
  38348. r.view[a++] = e
  38349. }),
  38350. r.limit = a,
  38351. r
  38352. }
  38353. ,
  38354. o
  38355. })
  38356. }
  38357. , {
  38358. long: 216
  38359. }],
  38360. 216: [function(e, t, i) {
  38361. !function(i, n) {
  38362. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  38363. }(this, function() {
  38364. "use strict";
  38365. function e(e, t, i) {
  38366. this.low = 0 | e,
  38367. this.high = 0 | t,
  38368. this.unsigned = !!i
  38369. }
  38370. function t(e) {
  38371. return (e && e.__isLong__) === !0
  38372. }
  38373. function i(e, t) {
  38374. var i, n, o;
  38375. return t ? (e >>>= 0,
  38376. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38377. o && (l[e] = i),
  38378. i)) : (e |= 0,
  38379. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38380. o && (s[e] = i),
  38381. i))
  38382. }
  38383. function n(e, t) {
  38384. if (isNaN(e) || !isFinite(e))
  38385. return t ? m : g;
  38386. if (t) {
  38387. if (e < 0)
  38388. return m;
  38389. if (e >= d)
  38390. return I
  38391. } else {
  38392. if (e <= -p)
  38393. return E;
  38394. if (e + 1 >= p)
  38395. return C
  38396. }
  38397. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38398. }
  38399. function r(t, i, n) {
  38400. return new e(t,i,n)
  38401. }
  38402. function o(e, t, i) {
  38403. if (0 === e.length)
  38404. throw Error("empty string");
  38405. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38406. return g;
  38407. if ("number" == typeof t ? (i = t,
  38408. t = !1) : t = !!t,
  38409. i = i || 10,
  38410. i < 2 || 36 < i)
  38411. throw RangeError("radix");
  38412. var r;
  38413. if ((r = e.indexOf("-")) > 0)
  38414. throw Error("interior hyphen");
  38415. if (0 === r)
  38416. return o(e.substring(1), t, i).neg();
  38417. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38418. var h = Math.min(8, e.length - l)
  38419. , u = parseInt(e.substring(l, l + h), i);
  38420. if (h < 8) {
  38421. var d = n(c(i, h));
  38422. s = s.mul(d).add(n(u))
  38423. } else
  38424. s = s.mul(a),
  38425. s = s.add(n(u))
  38426. }
  38427. return s.unsigned = t,
  38428. s
  38429. }
  38430. function a(t) {
  38431. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38432. }
  38433. e.prototype.__isLong__,
  38434. Object.defineProperty(e.prototype, "__isLong__", {
  38435. value: !0,
  38436. enumerable: !1,
  38437. configurable: !1
  38438. }),
  38439. e.isLong = t;
  38440. var s = {}
  38441. , l = {};
  38442. e.fromInt = i,
  38443. e.fromNumber = n,
  38444. e.fromBits = r;
  38445. var c = Math.pow;
  38446. e.fromString = o,
  38447. e.fromValue = a;
  38448. var h = 1 << 24
  38449. , u = 4294967296
  38450. , d = 0x10000000000000000
  38451. , p = d / 2
  38452. , f = i(h)
  38453. , g = i(0);
  38454. e.ZERO = g;
  38455. var m = i(0, !0);
  38456. e.UZERO = m;
  38457. var v = i(1);
  38458. e.ONE = v;
  38459. var A = i(1, !0);
  38460. e.UONE = A;
  38461. var y = i(-1);
  38462. e.NEG_ONE = y;
  38463. var C = r(-1, 2147483647, !1);
  38464. e.MAX_VALUE = C;
  38465. var I = r(-1, -1, !0);
  38466. e.MAX_UNSIGNED_VALUE = I;
  38467. var E = r(0, -2147483648, !1);
  38468. e.MIN_VALUE = E;
  38469. var b = e.prototype;
  38470. return b.toInt = function() {
  38471. return this.unsigned ? this.low >>> 0 : this.low
  38472. }
  38473. ,
  38474. b.toNumber = function() {
  38475. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  38476. }
  38477. ,
  38478. b.toString = function(e) {
  38479. if (e = e || 10,
  38480. e < 2 || 36 < e)
  38481. throw RangeError("radix");
  38482. if (this.isZero())
  38483. return "0";
  38484. if (this.isNegative()) {
  38485. if (this.eq(E)) {
  38486. var t = n(e)
  38487. , i = this.div(t)
  38488. , r = i.mul(t).sub(this);
  38489. return i.toString(e) + r.toInt().toString(e)
  38490. }
  38491. return "-" + this.neg().toString(e)
  38492. }
  38493. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  38494. var l = a.div(o)
  38495. , h = a.sub(l.mul(o)).toInt() >>> 0
  38496. , u = h.toString(e);
  38497. if (a = l,
  38498. a.isZero())
  38499. return u + s;
  38500. for (; u.length < 6; )
  38501. u = "0" + u;
  38502. s = "" + u + s
  38503. }
  38504. }
  38505. ,
  38506. b.getHighBits = function() {
  38507. return this.high
  38508. }
  38509. ,
  38510. b.getHighBitsUnsigned = function() {
  38511. return this.high >>> 0
  38512. }
  38513. ,
  38514. b.getLowBits = function() {
  38515. return this.low
  38516. }
  38517. ,
  38518. b.getLowBitsUnsigned = function() {
  38519. return this.low >>> 0
  38520. }
  38521. ,
  38522. b.getNumBitsAbs = function() {
  38523. if (this.isNegative())
  38524. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  38525. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  38526. ;
  38527. return 0 != this.high ? t + 33 : t + 1
  38528. }
  38529. ,
  38530. b.isZero = function() {
  38531. return 0 === this.high && 0 === this.low
  38532. }
  38533. ,
  38534. b.isNegative = function() {
  38535. return !this.unsigned && this.high < 0
  38536. }
  38537. ,
  38538. b.isPositive = function() {
  38539. return this.unsigned || this.high >= 0
  38540. }
  38541. ,
  38542. b.isOdd = function() {
  38543. return 1 === (1 & this.low)
  38544. }
  38545. ,
  38546. b.isEven = function() {
  38547. return 0 === (1 & this.low)
  38548. }
  38549. ,
  38550. b.equals = function(e) {
  38551. return t(e) || (e = a(e)),
  38552. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  38553. }
  38554. ,
  38555. b.eq = b.equals,
  38556. b.notEquals = function(e) {
  38557. return !this.eq(e)
  38558. }
  38559. ,
  38560. b.neq = b.notEquals,
  38561. b.lessThan = function(e) {
  38562. return this.comp(e) < 0
  38563. }
  38564. ,
  38565. b.lt = b.lessThan,
  38566. b.lessThanOrEqual = function(e) {
  38567. return this.comp(e) <= 0
  38568. }
  38569. ,
  38570. b.lte = b.lessThanOrEqual,
  38571. b.greaterThan = function(e) {
  38572. return this.comp(e) > 0
  38573. }
  38574. ,
  38575. b.gt = b.greaterThan,
  38576. b.greaterThanOrEqual = function(e) {
  38577. return this.comp(e) >= 0
  38578. }
  38579. ,
  38580. b.gte = b.greaterThanOrEqual,
  38581. b.compare = function(e) {
  38582. if (t(e) || (e = a(e)),
  38583. this.eq(e))
  38584. return 0;
  38585. var i = this.isNegative()
  38586. , n = e.isNegative();
  38587. return i && !n ? -1 : !i && n ? 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
  38588. }
  38589. ,
  38590. b.comp = b.compare,
  38591. b.negate = function() {
  38592. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  38593. }
  38594. ,
  38595. b.neg = b.negate,
  38596. b.add = function(e) {
  38597. t(e) || (e = a(e));
  38598. var i = this.high >>> 16
  38599. , n = 65535 & this.high
  38600. , o = this.low >>> 16
  38601. , s = 65535 & this.low
  38602. , l = e.high >>> 16
  38603. , c = 65535 & e.high
  38604. , h = e.low >>> 16
  38605. , u = 65535 & e.low
  38606. , d = 0
  38607. , p = 0
  38608. , f = 0
  38609. , g = 0;
  38610. return g += s + u,
  38611. f += g >>> 16,
  38612. g &= 65535,
  38613. f += o + h,
  38614. p += f >>> 16,
  38615. f &= 65535,
  38616. p += n + c,
  38617. d += p >>> 16,
  38618. p &= 65535,
  38619. d += i + l,
  38620. d &= 65535,
  38621. r(f << 16 | g, d << 16 | p, this.unsigned)
  38622. }
  38623. ,
  38624. b.subtract = function(e) {
  38625. return t(e) || (e = a(e)),
  38626. this.add(e.neg())
  38627. }
  38628. ,
  38629. b.sub = b.subtract,
  38630. b.multiply = function(e) {
  38631. if (this.isZero())
  38632. return g;
  38633. if (t(e) || (e = a(e)),
  38634. e.isZero())
  38635. return g;
  38636. if (this.eq(E))
  38637. return e.isOdd() ? E : g;
  38638. if (e.eq(E))
  38639. return this.isOdd() ? E : g;
  38640. if (this.isNegative())
  38641. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  38642. if (e.isNegative())
  38643. return this.mul(e.neg()).neg();
  38644. if (this.lt(f) && e.lt(f))
  38645. return n(this.toNumber() * e.toNumber(), this.unsigned);
  38646. var i = this.high >>> 16
  38647. , o = 65535 & this.high
  38648. , s = this.low >>> 16
  38649. , l = 65535 & this.low
  38650. , c = e.high >>> 16
  38651. , h = 65535 & e.high
  38652. , u = e.low >>> 16
  38653. , d = 65535 & e.low
  38654. , p = 0
  38655. , m = 0
  38656. , v = 0
  38657. , A = 0;
  38658. return A += l * d,
  38659. v += A >>> 16,
  38660. A &= 65535,
  38661. v += s * d,
  38662. m += v >>> 16,
  38663. v &= 65535,
  38664. v += l * u,
  38665. m += v >>> 16,
  38666. v &= 65535,
  38667. m += o * d,
  38668. p += m >>> 16,
  38669. m &= 65535,
  38670. m += s * u,
  38671. p += m >>> 16,
  38672. m &= 65535,
  38673. m += l * h,
  38674. p += m >>> 16,
  38675. m &= 65535,
  38676. p += i * d + o * u + s * h + l * c,
  38677. p &= 65535,
  38678. r(v << 16 | A, p << 16 | m, this.unsigned)
  38679. }
  38680. ,
  38681. b.mul = b.multiply,
  38682. b.divide = function(e) {
  38683. if (t(e) || (e = a(e)),
  38684. e.isZero())
  38685. throw Error("division by zero");
  38686. if (this.isZero())
  38687. return this.unsigned ? m : g;
  38688. var i, r, o;
  38689. if (this.unsigned) {
  38690. if (e.unsigned || (e = e.toUnsigned()),
  38691. e.gt(this))
  38692. return m;
  38693. if (e.gt(this.shru(1)))
  38694. return A;
  38695. o = m
  38696. } else {
  38697. if (this.eq(E)) {
  38698. if (e.eq(v) || e.eq(y))
  38699. return E;
  38700. if (e.eq(E))
  38701. return v;
  38702. var s = this.shr(1);
  38703. return i = s.div(e).shl(1),
  38704. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  38705. o = i.add(r.div(e)))
  38706. }
  38707. if (e.eq(E))
  38708. return this.unsigned ? m : g;
  38709. if (this.isNegative())
  38710. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  38711. if (e.isNegative())
  38712. return this.div(e.neg()).neg();
  38713. o = g
  38714. }
  38715. for (r = this; r.gte(e); ) {
  38716. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  38717. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  38718. i -= h,
  38719. u = n(i, this.unsigned),
  38720. d = u.mul(e);
  38721. u.isZero() && (u = v),
  38722. o = o.add(u),
  38723. r = r.sub(d)
  38724. }
  38725. return o
  38726. }
  38727. ,
  38728. b.div = b.divide,
  38729. b.modulo = function(e) {
  38730. return t(e) || (e = a(e)),
  38731. this.sub(this.div(e).mul(e))
  38732. }
  38733. ,
  38734. b.mod = b.modulo,
  38735. b.not = function() {
  38736. return r(~this.low, ~this.high, this.unsigned)
  38737. }
  38738. ,
  38739. b.and = function(e) {
  38740. return t(e) || (e = a(e)),
  38741. r(this.low & e.low, this.high & e.high, this.unsigned)
  38742. }
  38743. ,
  38744. b.or = function(e) {
  38745. return t(e) || (e = a(e)),
  38746. r(this.low | e.low, this.high | e.high, this.unsigned)
  38747. }
  38748. ,
  38749. b.xor = function(e) {
  38750. return t(e) || (e = a(e)),
  38751. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  38752. }
  38753. ,
  38754. b.shiftLeft = function(e) {
  38755. return t(e) && (e = e.toInt()),
  38756. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  38757. }
  38758. ,
  38759. b.shl = b.shiftLeft,
  38760. b.shiftRight = function(e) {
  38761. return t(e) && (e = e.toInt()),
  38762. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  38763. }
  38764. ,
  38765. b.shr = b.shiftRight,
  38766. b.shiftRightUnsigned = function(e) {
  38767. if (t(e) && (e = e.toInt()),
  38768. e &= 63,
  38769. 0 === e)
  38770. return this;
  38771. var i = this.high;
  38772. if (e < 32) {
  38773. var n = this.low;
  38774. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  38775. }
  38776. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  38777. }
  38778. ,
  38779. b.shru = b.shiftRightUnsigned,
  38780. b.toSigned = function() {
  38781. return this.unsigned ? r(this.low, this.high, !1) : this
  38782. }
  38783. ,
  38784. b.toUnsigned = function() {
  38785. return this.unsigned ? this : r(this.low, this.high, !0)
  38786. }
  38787. ,
  38788. b.toBytes = function(e) {
  38789. return e ? this.toBytesLE() : this.toBytesBE()
  38790. }
  38791. ,
  38792. b.toBytesLE = function() {
  38793. var e = this.high
  38794. , t = this.low;
  38795. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  38796. }
  38797. ,
  38798. b.toBytesBE = function() {
  38799. var e = this.high
  38800. , t = this.low;
  38801. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  38802. }
  38803. ,
  38804. e
  38805. })
  38806. }
  38807. , {}],
  38808. 217: [function(e, t, i) {
  38809. var n = {
  38810. REVISION: "75"
  38811. };
  38812. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  38813. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  38814. void 0 === Math.sign && (Math.sign = function(e) {
  38815. return e < 0 ? -1 : e > 0 ? 1 : +e
  38816. }
  38817. ),
  38818. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  38819. get: function() {
  38820. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  38821. }
  38822. }),
  38823. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  38824. writable: !0,
  38825. configurable: !0,
  38826. value: function(e) {
  38827. "use strict";
  38828. if (void 0 === e || null === e)
  38829. throw new TypeError("Cannot convert first argument to object");
  38830. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  38831. var r = arguments[i];
  38832. if (void 0 !== r && null !== r) {
  38833. r = Object(r);
  38834. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  38835. var l = o[a]
  38836. , c = Object.getOwnPropertyDescriptor(r, l);
  38837. void 0 !== c && c.enumerable && (t[l] = r[l])
  38838. }
  38839. }
  38840. }
  38841. return t
  38842. }
  38843. }),
  38844. n.MOUSE = {
  38845. LEFT: 0,
  38846. MIDDLE: 1,
  38847. RIGHT: 2
  38848. },
  38849. n.CullFaceNone = 0,
  38850. n.CullFaceBack = 1,
  38851. n.CullFaceFront = 2,
  38852. n.CullFaceFrontBack = 3,
  38853. n.FrontFaceDirectionCW = 0,
  38854. n.FrontFaceDirectionCCW = 1,
  38855. n.BasicShadowMap = 0,
  38856. n.PCFShadowMap = 1,
  38857. n.PCFSoftShadowMap = 2,
  38858. n.FrontSide = 0,
  38859. n.BackSide = 1,
  38860. n.DoubleSide = 2,
  38861. n.FlatShading = 1,
  38862. n.SmoothShading = 2,
  38863. n.NoColors = 0,
  38864. n.FaceColors = 1,
  38865. n.VertexColors = 2,
  38866. n.NoBlending = 0,
  38867. n.NormalBlending = 1,
  38868. n.AdditiveBlending = 2,
  38869. n.SubtractiveBlending = 3,
  38870. n.MultiplyBlending = 4,
  38871. n.CustomBlending = 5,
  38872. n.AddEquation = 100,
  38873. n.SubtractEquation = 101,
  38874. n.ReverseSubtractEquation = 102,
  38875. n.MinEquation = 103,
  38876. n.MaxEquation = 104,
  38877. n.ZeroFactor = 200,
  38878. n.OneFactor = 201,
  38879. n.SrcColorFactor = 202,
  38880. n.OneMinusSrcColorFactor = 203,
  38881. n.SrcAlphaFactor = 204,
  38882. n.OneMinusSrcAlphaFactor = 205,
  38883. n.DstAlphaFactor = 206,
  38884. n.OneMinusDstAlphaFactor = 207,
  38885. n.DstColorFactor = 208,
  38886. n.OneMinusDstColorFactor = 209,
  38887. n.SrcAlphaSaturateFactor = 210,
  38888. n.NeverDepth = 0,
  38889. n.AlwaysDepth = 1,
  38890. n.LessDepth = 2,
  38891. n.LessEqualDepth = 3,
  38892. n.EqualDepth = 4,
  38893. n.GreaterEqualDepth = 5,
  38894. n.GreaterDepth = 6,
  38895. n.NotEqualDepth = 7,
  38896. n.MultiplyOperation = 0,
  38897. n.MixOperation = 1,
  38898. n.AddOperation = 2,
  38899. n.NoToneMapping = 0,
  38900. n.LinearToneMapping = 1,
  38901. n.ReinhardToneMapping = 2,
  38902. n.Uncharted2ToneMapping = 3,
  38903. n.CineonToneMapping = 4,
  38904. n.UVMapping = 300,
  38905. n.CubeReflectionMapping = 301,
  38906. n.CubeRefractionMapping = 302,
  38907. n.EquirectangularReflectionMapping = 303,
  38908. n.EquirectangularRefractionMapping = 304,
  38909. n.SphericalReflectionMapping = 305,
  38910. n.CubeUVReflectionMapping = 306,
  38911. n.CubeUVRefractionMapping = 307,
  38912. n.RepeatWrapping = 1e3,
  38913. n.ClampToEdgeWrapping = 1001,
  38914. n.MirroredRepeatWrapping = 1002,
  38915. n.NearestFilter = 1003,
  38916. n.NearestMipMapNearestFilter = 1004,
  38917. n.NearestMipMapLinearFilter = 1005,
  38918. n.LinearFilter = 1006,
  38919. n.LinearMipMapNearestFilter = 1007,
  38920. n.LinearMipMapLinearFilter = 1008,
  38921. n.UnsignedByteType = 1009,
  38922. n.ByteType = 1010,
  38923. n.ShortType = 1011,
  38924. n.UnsignedShortType = 1012,
  38925. n.IntType = 1013,
  38926. n.UnsignedIntType = 1014,
  38927. n.FloatType = 1015,
  38928. n.HalfFloatType = 1025,
  38929. n.UnsignedShort4444Type = 1016,
  38930. n.UnsignedShort5551Type = 1017,
  38931. n.UnsignedShort565Type = 1018,
  38932. n.AlphaFormat = 1019,
  38933. n.RGBFormat = 1020,
  38934. n.RGBAFormat = 1021,
  38935. n.LuminanceFormat = 1022,
  38936. n.LuminanceAlphaFormat = 1023,
  38937. n.RGBEFormat = n.RGBAFormat,
  38938. n.RGB_S3TC_DXT1_Format = 2001,
  38939. n.RGBA_S3TC_DXT1_Format = 2002,
  38940. n.RGBA_S3TC_DXT3_Format = 2003,
  38941. n.RGBA_S3TC_DXT5_Format = 2004,
  38942. n.RGB_PVRTC_4BPPV1_Format = 2100,
  38943. n.RGB_PVRTC_2BPPV1_Format = 2101,
  38944. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  38945. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  38946. n.RGB_ETC1_Format = 2151,
  38947. n.LoopOnce = 2200,
  38948. n.LoopRepeat = 2201,
  38949. n.LoopPingPong = 2202,
  38950. n.InterpolateDiscrete = 2300,
  38951. n.InterpolateLinear = 2301,
  38952. n.InterpolateSmooth = 2302,
  38953. n.ZeroCurvatureEnding = 2400,
  38954. n.ZeroSlopeEnding = 2401,
  38955. n.WrapAroundEnding = 2402,
  38956. n.TrianglesDrawMode = 0,
  38957. n.TriangleStripDrawMode = 1,
  38958. n.TriangleFanDrawMode = 2,
  38959. n.LinearEncoding = 3e3,
  38960. n.sRGBEncoding = 3001,
  38961. n.GammaEncoding = 3007,
  38962. n.RGBEEncoding = 3002,
  38963. n.LogLuvEncoding = 3003,
  38964. n.RGBM7Encoding = 3004,
  38965. n.RGBM16Encoding = 3005,
  38966. n.RGBDEncoding = 3006,
  38967. n.Color = function(e) {
  38968. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  38969. }
  38970. ,
  38971. n.Color.prototype = {
  38972. constructor: n.Color,
  38973. r: 1,
  38974. g: 1,
  38975. b: 1,
  38976. set: function(e) {
  38977. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  38978. this
  38979. },
  38980. setScalar: function(e) {
  38981. this.r = e,
  38982. this.g = e,
  38983. this.b = e
  38984. },
  38985. setHex: function(e) {
  38986. return e = Math.floor(e),
  38987. this.r = (e >> 16 & 255) / 255,
  38988. this.g = (e >> 8 & 255) / 255,
  38989. this.b = (255 & e) / 255,
  38990. this
  38991. },
  38992. setRGB: function(e, t, i) {
  38993. return this.r = e,
  38994. this.g = t,
  38995. this.b = i,
  38996. this
  38997. },
  38998. setHSL: function() {
  38999. function e(e, t, i) {
  39000. return i < 0 && (i += 1),
  39001. i > 1 && (i -= 1),
  39002. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39003. }
  39004. return function(t, i, r) {
  39005. if (t = n.Math.euclideanModulo(t, 1),
  39006. i = n.Math.clamp(i, 0, 1),
  39007. r = n.Math.clamp(r, 0, 1),
  39008. 0 === i)
  39009. this.r = this.g = this.b = r;
  39010. else {
  39011. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39012. , a = 2 * r - o;
  39013. this.r = e(a, o, t + 1 / 3),
  39014. this.g = e(a, o, t),
  39015. this.b = e(a, o, t - 1 / 3)
  39016. }
  39017. return this
  39018. }
  39019. }(),
  39020. setStyle: function(e) {
  39021. function t(t) {
  39022. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39023. }
  39024. var i;
  39025. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39026. var r, o = i[1], a = i[2];
  39027. switch (o) {
  39028. case "rgb":
  39029. case "rgba":
  39030. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39031. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39032. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39033. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39034. t(r[5]),
  39035. this;
  39036. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39037. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39038. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39039. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39040. t(r[5]),
  39041. this;
  39042. break;
  39043. case "hsl":
  39044. case "hsla":
  39045. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39046. var s = parseFloat(r[1]) / 360
  39047. , l = parseInt(r[2], 10) / 100
  39048. , c = parseInt(r[3], 10) / 100;
  39049. return t(r[5]),
  39050. this.setHSL(s, l, c)
  39051. }
  39052. }
  39053. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39054. var h = i[1]
  39055. , u = h.length;
  39056. if (3 === u)
  39057. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39058. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39059. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39060. this;
  39061. if (6 === u)
  39062. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39063. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39064. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39065. this
  39066. }
  39067. if (e && e.length > 0) {
  39068. var h = n.ColorKeywords[e];
  39069. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39070. }
  39071. return this
  39072. },
  39073. clone: function() {
  39074. return new this.constructor(this.r,this.g,this.b)
  39075. },
  39076. copy: function(e) {
  39077. return this.r = e.r,
  39078. this.g = e.g,
  39079. this.b = e.b,
  39080. this
  39081. },
  39082. copyGammaToLinear: function(e, t) {
  39083. return void 0 === t && (t = 2),
  39084. this.r = Math.pow(e.r, t),
  39085. this.g = Math.pow(e.g, t),
  39086. this.b = Math.pow(e.b, t),
  39087. this
  39088. },
  39089. copyLinearToGamma: function(e, t) {
  39090. void 0 === t && (t = 2);
  39091. var i = t > 0 ? 1 / t : 1;
  39092. return this.r = Math.pow(e.r, i),
  39093. this.g = Math.pow(e.g, i),
  39094. this.b = Math.pow(e.b, i),
  39095. this
  39096. },
  39097. convertGammaToLinear: function() {
  39098. var e = this.r
  39099. , t = this.g
  39100. , i = this.b;
  39101. return this.r = e * e,
  39102. this.g = t * t,
  39103. this.b = i * i,
  39104. this
  39105. },
  39106. convertLinearToGamma: function() {
  39107. return this.r = Math.sqrt(this.r),
  39108. this.g = Math.sqrt(this.g),
  39109. this.b = Math.sqrt(this.b),
  39110. this
  39111. },
  39112. getHex: function() {
  39113. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39114. },
  39115. getHexString: function() {
  39116. return ("000000" + this.getHex().toString(16)).slice(-6)
  39117. },
  39118. getHSL: function(e) {
  39119. var t, i, n = e || {
  39120. h: 0,
  39121. s: 0,
  39122. l: 0
  39123. }, 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;
  39124. if (l === s)
  39125. t = 0,
  39126. i = 0;
  39127. else {
  39128. var h = s - l;
  39129. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39130. s) {
  39131. case r:
  39132. t = (o - a) / h + (o < a ? 6 : 0);
  39133. break;
  39134. case o:
  39135. t = (a - r) / h + 2;
  39136. break;
  39137. case a:
  39138. t = (r - o) / h + 4
  39139. }
  39140. t /= 6
  39141. }
  39142. return n.h = t,
  39143. n.s = i,
  39144. n.l = c,
  39145. n
  39146. },
  39147. getStyle: function() {
  39148. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39149. },
  39150. offsetHSL: function(e, t, i) {
  39151. var n = this.getHSL();
  39152. return n.h += e,
  39153. n.s += t,
  39154. n.l += i,
  39155. this.setHSL(n.h, n.s, n.l),
  39156. this
  39157. },
  39158. add: function(e) {
  39159. return this.r += e.r,
  39160. this.g += e.g,
  39161. this.b += e.b,
  39162. this
  39163. },
  39164. addColors: function(e, t) {
  39165. return this.r = e.r + t.r,
  39166. this.g = e.g + t.g,
  39167. this.b = e.b + t.b,
  39168. this
  39169. },
  39170. addScalar: function(e) {
  39171. return this.r += e,
  39172. this.g += e,
  39173. this.b += e,
  39174. this
  39175. },
  39176. multiply: function(e) {
  39177. return this.r *= e.r,
  39178. this.g *= e.g,
  39179. this.b *= e.b,
  39180. this
  39181. },
  39182. multiplyScalar: function(e) {
  39183. return this.r *= e,
  39184. this.g *= e,
  39185. this.b *= e,
  39186. this
  39187. },
  39188. lerp: function(e, t) {
  39189. return this.r += (e.r - this.r) * t,
  39190. this.g += (e.g - this.g) * t,
  39191. this.b += (e.b - this.b) * t,
  39192. this
  39193. },
  39194. equals: function(e) {
  39195. return e.r === this.r && e.g === this.g && e.b === this.b
  39196. },
  39197. fromArray: function(e, t) {
  39198. return void 0 === t && (t = 0),
  39199. this.r = e[t],
  39200. this.g = e[t + 1],
  39201. this.b = e[t + 2],
  39202. this
  39203. },
  39204. toArray: function(e, t) {
  39205. return void 0 === e && (e = []),
  39206. void 0 === t && (t = 0),
  39207. e[t] = this.r,
  39208. e[t + 1] = this.g,
  39209. e[t + 2] = this.b,
  39210. e
  39211. }
  39212. },
  39213. n.ColorKeywords = {
  39214. aliceblue: 15792383,
  39215. antiquewhite: 16444375,
  39216. aqua: 65535,
  39217. aquamarine: 8388564,
  39218. azure: 15794175,
  39219. beige: 16119260,
  39220. bisque: 16770244,
  39221. black: 0,
  39222. blanchedalmond: 16772045,
  39223. blue: 255,
  39224. blueviolet: 9055202,
  39225. brown: 10824234,
  39226. burlywood: 14596231,
  39227. cadetblue: 6266528,
  39228. chartreuse: 8388352,
  39229. chocolate: 13789470,
  39230. coral: 16744272,
  39231. cornflowerblue: 6591981,
  39232. cornsilk: 16775388,
  39233. crimson: 14423100,
  39234. cyan: 65535,
  39235. darkblue: 139,
  39236. darkcyan: 35723,
  39237. darkgoldenrod: 12092939,
  39238. darkgray: 11119017,
  39239. darkgreen: 25600,
  39240. darkgrey: 11119017,
  39241. darkkhaki: 12433259,
  39242. darkmagenta: 9109643,
  39243. darkolivegreen: 5597999,
  39244. darkorange: 16747520,
  39245. darkorchid: 10040012,
  39246. darkred: 9109504,
  39247. darksalmon: 15308410,
  39248. darkseagreen: 9419919,
  39249. darkslateblue: 4734347,
  39250. darkslategray: 3100495,
  39251. darkslategrey: 3100495,
  39252. darkturquoise: 52945,
  39253. darkviolet: 9699539,
  39254. deeppink: 16716947,
  39255. deepskyblue: 49151,
  39256. dimgray: 6908265,
  39257. dimgrey: 6908265,
  39258. dodgerblue: 2003199,
  39259. firebrick: 11674146,
  39260. floralwhite: 16775920,
  39261. forestgreen: 2263842,
  39262. fuchsia: 16711935,
  39263. gainsboro: 14474460,
  39264. ghostwhite: 16316671,
  39265. gold: 16766720,
  39266. goldenrod: 14329120,
  39267. gray: 8421504,
  39268. green: 32768,
  39269. greenyellow: 11403055,
  39270. grey: 8421504,
  39271. honeydew: 15794160,
  39272. hotpink: 16738740,
  39273. indianred: 13458524,
  39274. indigo: 4915330,
  39275. ivory: 16777200,
  39276. khaki: 15787660,
  39277. lavender: 15132410,
  39278. lavenderblush: 16773365,
  39279. lawngreen: 8190976,
  39280. lemonchiffon: 16775885,
  39281. lightblue: 11393254,
  39282. lightcoral: 15761536,
  39283. lightcyan: 14745599,
  39284. lightgoldenrodyellow: 16448210,
  39285. lightgray: 13882323,
  39286. lightgreen: 9498256,
  39287. lightgrey: 13882323,
  39288. lightpink: 16758465,
  39289. lightsalmon: 16752762,
  39290. lightseagreen: 2142890,
  39291. lightskyblue: 8900346,
  39292. lightslategray: 7833753,
  39293. lightslategrey: 7833753,
  39294. lightsteelblue: 11584734,
  39295. lightyellow: 16777184,
  39296. lime: 65280,
  39297. limegreen: 3329330,
  39298. linen: 16445670,
  39299. magenta: 16711935,
  39300. maroon: 8388608,
  39301. mediumaquamarine: 6737322,
  39302. mediumblue: 205,
  39303. mediumorchid: 12211667,
  39304. mediumpurple: 9662683,
  39305. mediumseagreen: 3978097,
  39306. mediumslateblue: 8087790,
  39307. mediumspringgreen: 64154,
  39308. mediumturquoise: 4772300,
  39309. mediumvioletred: 13047173,
  39310. midnightblue: 1644912,
  39311. mintcream: 16121850,
  39312. mistyrose: 16770273,
  39313. moccasin: 16770229,
  39314. navajowhite: 16768685,
  39315. navy: 128,
  39316. oldlace: 16643558,
  39317. olive: 8421376,
  39318. olivedrab: 7048739,
  39319. orange: 16753920,
  39320. orangered: 16729344,
  39321. orchid: 14315734,
  39322. palegoldenrod: 15657130,
  39323. palegreen: 10025880,
  39324. paleturquoise: 11529966,
  39325. palevioletred: 14381203,
  39326. papayawhip: 16773077,
  39327. peachpuff: 16767673,
  39328. peru: 13468991,
  39329. pink: 16761035,
  39330. plum: 14524637,
  39331. powderblue: 11591910,
  39332. purple: 8388736,
  39333. red: 16711680,
  39334. rosybrown: 12357519,
  39335. royalblue: 4286945,
  39336. saddlebrown: 9127187,
  39337. salmon: 16416882,
  39338. sandybrown: 16032864,
  39339. seagreen: 3050327,
  39340. seashell: 16774638,
  39341. sienna: 10506797,
  39342. silver: 12632256,
  39343. skyblue: 8900331,
  39344. slateblue: 6970061,
  39345. slategray: 7372944,
  39346. slategrey: 7372944,
  39347. snow: 16775930,
  39348. springgreen: 65407,
  39349. steelblue: 4620980,
  39350. tan: 13808780,
  39351. teal: 32896,
  39352. thistle: 14204888,
  39353. tomato: 16737095,
  39354. turquoise: 4251856,
  39355. violet: 15631086,
  39356. wheat: 16113331,
  39357. white: 16777215,
  39358. whitesmoke: 16119285,
  39359. yellow: 16776960,
  39360. yellowgreen: 10145074
  39361. },
  39362. n.Quaternion = function(e, t, i, n) {
  39363. this._x = e || 0,
  39364. this._y = t || 0,
  39365. this._z = i || 0,
  39366. this._w = void 0 !== n ? n : 1
  39367. }
  39368. ,
  39369. n.Quaternion.prototype = {
  39370. constructor: n.Quaternion,
  39371. get x() {
  39372. return this._x
  39373. },
  39374. set x(e) {
  39375. this._x = e,
  39376. this.onChangeCallback()
  39377. },
  39378. get y() {
  39379. return this._y
  39380. },
  39381. set y(e) {
  39382. this._y = e,
  39383. this.onChangeCallback()
  39384. },
  39385. get z() {
  39386. return this._z
  39387. },
  39388. set z(e) {
  39389. this._z = e,
  39390. this.onChangeCallback()
  39391. },
  39392. get w() {
  39393. return this._w
  39394. },
  39395. set w(e) {
  39396. this._w = e,
  39397. this.onChangeCallback()
  39398. },
  39399. set: function(e, t, i, n) {
  39400. return this._x = e,
  39401. this._y = t,
  39402. this._z = i,
  39403. this._w = n,
  39404. this.onChangeCallback(),
  39405. this
  39406. },
  39407. clone: function() {
  39408. return new this.constructor(this._x,this._y,this._z,this._w)
  39409. },
  39410. copy: function(e) {
  39411. return this._x = e.x,
  39412. this._y = e.y,
  39413. this._z = e.z,
  39414. this._w = e.w,
  39415. this.onChangeCallback(),
  39416. this
  39417. },
  39418. setFromEuler: function(e, t) {
  39419. if (e instanceof n.Euler == !1)
  39420. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39421. var i = Math.cos(e._x / 2)
  39422. , r = Math.cos(e._y / 2)
  39423. , o = Math.cos(e._z / 2)
  39424. , a = Math.sin(e._x / 2)
  39425. , s = Math.sin(e._y / 2)
  39426. , l = Math.sin(e._z / 2)
  39427. , c = e.order;
  39428. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39429. this._y = i * s * o - a * r * l,
  39430. this._z = i * r * l + a * s * o,
  39431. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39432. this._y = i * s * o - a * r * l,
  39433. this._z = i * r * l - a * s * o,
  39434. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39435. this._y = i * s * o + a * r * l,
  39436. this._z = i * r * l + a * s * o,
  39437. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39438. this._y = i * s * o + a * r * l,
  39439. this._z = i * r * l - a * s * o,
  39440. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39441. this._y = i * s * o + a * r * l,
  39442. this._z = i * r * l - a * s * o,
  39443. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39444. this._y = i * s * o - a * r * l,
  39445. this._z = i * r * l + a * s * o,
  39446. this._w = i * r * o + a * s * l),
  39447. t !== !1 && this.onChangeCallback(),
  39448. this
  39449. },
  39450. setFromAxisAngle: function(e, t) {
  39451. var i = t / 2
  39452. , n = Math.sin(i);
  39453. return this._x = e.x * n,
  39454. this._y = e.y * n,
  39455. this._z = e.z * n,
  39456. this._w = Math.cos(i),
  39457. this.onChangeCallback(),
  39458. this
  39459. },
  39460. setFromRotationMatrix: function(e) {
  39461. 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;
  39462. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  39463. this._w = .25 / t,
  39464. this._x = (h - l) * t,
  39465. this._y = (o - c) * t,
  39466. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  39467. this._w = (h - l) / t,
  39468. this._x = .25 * t,
  39469. this._y = (r + a) / t,
  39470. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  39471. this._w = (o - c) / t,
  39472. this._x = (r + a) / t,
  39473. this._y = .25 * t,
  39474. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  39475. this._w = (a - r) / t,
  39476. this._x = (o + c) / t,
  39477. this._y = (l + h) / t,
  39478. this._z = .25 * t),
  39479. this.onChangeCallback(),
  39480. this
  39481. },
  39482. setFromUnitVectors: function() {
  39483. var e, t, i = 1e-6;
  39484. return function(r, o) {
  39485. return void 0 === e && (e = new n.Vector3),
  39486. t = r.dot(o) + 1,
  39487. t < i ? (t = 0,
  39488. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  39489. this._x = e.x,
  39490. this._y = e.y,
  39491. this._z = e.z,
  39492. this._w = t,
  39493. this.normalize(),
  39494. this
  39495. }
  39496. }(),
  39497. inverse: function() {
  39498. return this.conjugate().normalize(),
  39499. this
  39500. },
  39501. conjugate: function() {
  39502. return this._x *= -1,
  39503. this._y *= -1,
  39504. this._z *= -1,
  39505. this.onChangeCallback(),
  39506. this
  39507. },
  39508. dot: function(e) {
  39509. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  39510. },
  39511. lengthSq: function() {
  39512. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  39513. },
  39514. length: function() {
  39515. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  39516. },
  39517. normalize: function() {
  39518. var e = this.length();
  39519. return 0 === e ? (this._x = 0,
  39520. this._y = 0,
  39521. this._z = 0,
  39522. this._w = 1) : (e = 1 / e,
  39523. this._x = this._x * e,
  39524. this._y = this._y * e,
  39525. this._z = this._z * e,
  39526. this._w = this._w * e),
  39527. this.onChangeCallback(),
  39528. this
  39529. },
  39530. multiply: function(e, t) {
  39531. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  39532. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  39533. },
  39534. multiplyQuaternions: function(e, t) {
  39535. var i = e._x
  39536. , n = e._y
  39537. , r = e._z
  39538. , o = e._w
  39539. , a = t._x
  39540. , s = t._y
  39541. , l = t._z
  39542. , c = t._w;
  39543. return this._x = i * c + o * a + n * l - r * s,
  39544. this._y = n * c + o * s + r * a - i * l,
  39545. this._z = r * c + o * l + i * s - n * a,
  39546. this._w = o * c - i * a - n * s - r * l,
  39547. this.onChangeCallback(),
  39548. this
  39549. },
  39550. slerp: function(e, t) {
  39551. if (0 === t)
  39552. return this;
  39553. if (1 === t)
  39554. return this.copy(e);
  39555. var i = this._x
  39556. , n = this._y
  39557. , r = this._z
  39558. , o = this._w
  39559. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  39560. if (a < 0 ? (this._w = -e._w,
  39561. this._x = -e._x,
  39562. this._y = -e._y,
  39563. this._z = -e._z,
  39564. a = -a) : this.copy(e),
  39565. a >= 1)
  39566. return this._w = o,
  39567. this._x = i,
  39568. this._y = n,
  39569. this._z = r,
  39570. this;
  39571. var s = Math.sqrt(1 - a * a);
  39572. if (Math.abs(s) < .001)
  39573. return this._w = .5 * (o + this._w),
  39574. this._x = .5 * (i + this._x),
  39575. this._y = .5 * (n + this._y),
  39576. this._z = .5 * (r + this._z),
  39577. this;
  39578. var l = Math.atan2(s, a)
  39579. , c = Math.sin((1 - t) * l) / s
  39580. , h = Math.sin(t * l) / s;
  39581. return this._w = o * c + this._w * h,
  39582. this._x = i * c + this._x * h,
  39583. this._y = n * c + this._y * h,
  39584. this._z = r * c + this._z * h,
  39585. this.onChangeCallback(),
  39586. this
  39587. },
  39588. equals: function(e) {
  39589. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  39590. },
  39591. fromArray: function(e, t) {
  39592. return void 0 === t && (t = 0),
  39593. this._x = e[t],
  39594. this._y = e[t + 1],
  39595. this._z = e[t + 2],
  39596. this._w = e[t + 3],
  39597. this.onChangeCallback(),
  39598. this
  39599. },
  39600. toArray: function(e, t) {
  39601. return void 0 === e && (e = []),
  39602. void 0 === t && (t = 0),
  39603. e[t] = this._x,
  39604. e[t + 1] = this._y,
  39605. e[t + 2] = this._z,
  39606. e[t + 3] = this._w,
  39607. e
  39608. },
  39609. onChange: function(e) {
  39610. return this.onChangeCallback = e,
  39611. this
  39612. },
  39613. onChangeCallback: function() {}
  39614. },
  39615. Object.assign(n.Quaternion, {
  39616. slerp: function(e, t, i, n) {
  39617. return i.copy(e).slerp(t, n)
  39618. },
  39619. slerpFlat: function(e, t, i, n, r, o, a) {
  39620. var s = i[n + 0]
  39621. , l = i[n + 1]
  39622. , c = i[n + 2]
  39623. , h = i[n + 3]
  39624. , u = r[o + 0]
  39625. , d = r[o + 1]
  39626. , p = r[o + 2]
  39627. , f = r[o + 3];
  39628. if (h !== f || s !== u || l !== d || c !== p) {
  39629. var g = 1 - a
  39630. , m = s * u + l * d + c * p + h * f
  39631. , v = m >= 0 ? 1 : -1
  39632. , A = 1 - m * m;
  39633. if (A > Number.EPSILON) {
  39634. var y = Math.sqrt(A)
  39635. , C = Math.atan2(y, m * v);
  39636. g = Math.sin(g * C) / y,
  39637. a = Math.sin(a * C) / y
  39638. }
  39639. var I = a * v;
  39640. if (s = s * g + u * I,
  39641. l = l * g + d * I,
  39642. c = c * g + p * I,
  39643. h = h * g + f * I,
  39644. g === 1 - a) {
  39645. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  39646. s *= E,
  39647. l *= E,
  39648. c *= E,
  39649. h *= E
  39650. }
  39651. }
  39652. e[t] = s,
  39653. e[t + 1] = l,
  39654. e[t + 2] = c,
  39655. e[t + 3] = h
  39656. }
  39657. }),
  39658. n.Vector2 = function(e, t) {
  39659. this.x = e || 0,
  39660. this.y = t || 0
  39661. }
  39662. ,
  39663. n.Vector2.prototype = {
  39664. constructor: n.Vector2,
  39665. get width() {
  39666. return this.x
  39667. },
  39668. set width(e) {
  39669. this.x = e
  39670. },
  39671. get height() {
  39672. return this.y
  39673. },
  39674. set height(e) {
  39675. this.y = e
  39676. },
  39677. set: function(e, t) {
  39678. return this.x = e,
  39679. this.y = t,
  39680. this
  39681. },
  39682. setScalar: function(e) {
  39683. return this.x = e,
  39684. this.y = e,
  39685. this
  39686. },
  39687. setX: function(e) {
  39688. return this.x = e,
  39689. this
  39690. },
  39691. setY: function(e) {
  39692. return this.y = e,
  39693. this
  39694. },
  39695. setComponent: function(e, t) {
  39696. switch (e) {
  39697. case 0:
  39698. this.x = t;
  39699. break;
  39700. case 1:
  39701. this.y = t;
  39702. break;
  39703. default:
  39704. throw new Error("index is out of range: " + e)
  39705. }
  39706. },
  39707. getComponent: function(e) {
  39708. switch (e) {
  39709. case 0:
  39710. return this.x;
  39711. case 1:
  39712. return this.y;
  39713. default:
  39714. throw new Error("index is out of range: " + e)
  39715. }
  39716. },
  39717. clone: function() {
  39718. return new this.constructor(this.x,this.y)
  39719. },
  39720. copy: function(e) {
  39721. return this.x = e.x,
  39722. this.y = e.y,
  39723. this
  39724. },
  39725. add: function(e, t) {
  39726. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39727. this.addVectors(e, t)) : (this.x += e.x,
  39728. this.y += e.y,
  39729. this)
  39730. },
  39731. addScalar: function(e) {
  39732. return this.x += e,
  39733. this.y += e,
  39734. this
  39735. },
  39736. addVectors: function(e, t) {
  39737. return this.x = e.x + t.x,
  39738. this.y = e.y + t.y,
  39739. this
  39740. },
  39741. addScaledVector: function(e, t) {
  39742. return this.x += e.x * t,
  39743. this.y += e.y * t,
  39744. this
  39745. },
  39746. sub: function(e, t) {
  39747. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39748. this.subVectors(e, t)) : (this.x -= e.x,
  39749. this.y -= e.y,
  39750. this)
  39751. },
  39752. subScalar: function(e) {
  39753. return this.x -= e,
  39754. this.y -= e,
  39755. this
  39756. },
  39757. subVectors: function(e, t) {
  39758. return this.x = e.x - t.x,
  39759. this.y = e.y - t.y,
  39760. this
  39761. },
  39762. multiply: function(e) {
  39763. return this.x *= e.x,
  39764. this.y *= e.y,
  39765. this
  39766. },
  39767. multiplyScalar: function(e) {
  39768. return isFinite(e) ? (this.x *= e,
  39769. this.y *= e) : (this.x = 0,
  39770. this.y = 0),
  39771. this
  39772. },
  39773. divide: function(e) {
  39774. return this.x /= e.x,
  39775. this.y /= e.y,
  39776. this
  39777. },
  39778. divideScalar: function(e) {
  39779. return this.multiplyScalar(1 / e)
  39780. },
  39781. min: function(e) {
  39782. return this.x = Math.min(this.x, e.x),
  39783. this.y = Math.min(this.y, e.y),
  39784. this
  39785. },
  39786. max: function(e) {
  39787. return this.x = Math.max(this.x, e.x),
  39788. this.y = Math.max(this.y, e.y),
  39789. this
  39790. },
  39791. clamp: function(e, t) {
  39792. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39793. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39794. this
  39795. },
  39796. clampScalar: function() {
  39797. var e, t;
  39798. return function(i, r) {
  39799. return void 0 === e && (e = new n.Vector2,
  39800. t = new n.Vector2),
  39801. e.set(i, i),
  39802. t.set(r, r),
  39803. this.clamp(e, t)
  39804. }
  39805. }(),
  39806. clampLength: function(e, t) {
  39807. var i = this.length();
  39808. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39809. this
  39810. },
  39811. floor: function() {
  39812. return this.x = Math.floor(this.x),
  39813. this.y = Math.floor(this.y),
  39814. this
  39815. },
  39816. ceil: function() {
  39817. return this.x = Math.ceil(this.x),
  39818. this.y = Math.ceil(this.y),
  39819. this
  39820. },
  39821. round: function() {
  39822. return this.x = Math.round(this.x),
  39823. this.y = Math.round(this.y),
  39824. this
  39825. },
  39826. roundToZero: function() {
  39827. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39828. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39829. this
  39830. },
  39831. negate: function() {
  39832. return this.x = -this.x,
  39833. this.y = -this.y,
  39834. this
  39835. },
  39836. dot: function(e) {
  39837. return this.x * e.x + this.y * e.y
  39838. },
  39839. lengthSq: function() {
  39840. return this.x * this.x + this.y * this.y
  39841. },
  39842. length: function() {
  39843. return Math.sqrt(this.x * this.x + this.y * this.y)
  39844. },
  39845. lengthManhattan: function() {
  39846. return Math.abs(this.x) + Math.abs(this.y)
  39847. },
  39848. normalize: function() {
  39849. return this.divideScalar(this.length())
  39850. },
  39851. angle: function() {
  39852. var e = Math.atan2(this.y, this.x);
  39853. return e < 0 && (e += 2 * Math.PI),
  39854. e
  39855. },
  39856. distanceTo: function(e) {
  39857. return Math.sqrt(this.distanceToSquared(e))
  39858. },
  39859. distanceToSquared: function(e) {
  39860. var t = this.x - e.x
  39861. , i = this.y - e.y;
  39862. return t * t + i * i
  39863. },
  39864. setLength: function(e) {
  39865. return this.multiplyScalar(e / this.length())
  39866. },
  39867. lerp: function(e, t) {
  39868. return this.x += (e.x - this.x) * t,
  39869. this.y += (e.y - this.y) * t,
  39870. this
  39871. },
  39872. lerpVectors: function(e, t, i) {
  39873. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39874. this
  39875. },
  39876. equals: function(e) {
  39877. return e.x === this.x && e.y === this.y
  39878. },
  39879. fromArray: function(e, t) {
  39880. return void 0 === t && (t = 0),
  39881. this.x = e[t],
  39882. this.y = e[t + 1],
  39883. this
  39884. },
  39885. toArray: function(e, t) {
  39886. return void 0 === e && (e = []),
  39887. void 0 === t && (t = 0),
  39888. e[t] = this.x,
  39889. e[t + 1] = this.y,
  39890. e
  39891. },
  39892. fromAttribute: function(e, t, i) {
  39893. return void 0 === i && (i = 0),
  39894. t = t * e.itemSize + i,
  39895. this.x = e.array[t],
  39896. this.y = e.array[t + 1],
  39897. this
  39898. },
  39899. rotateAround: function(e, t) {
  39900. var i = Math.cos(t)
  39901. , n = Math.sin(t)
  39902. , r = this.x - e.x
  39903. , o = this.y - e.y;
  39904. return this.x = r * i - o * n + e.x,
  39905. this.y = r * n + o * i + e.y,
  39906. this
  39907. }
  39908. },
  39909. n.Vector3 = function(e, t, i) {
  39910. this.x = e || 0,
  39911. this.y = t || 0,
  39912. this.z = i || 0
  39913. }
  39914. ,
  39915. n.Vector3.prototype = {
  39916. constructor: n.Vector3,
  39917. set: function(e, t, i) {
  39918. return this.x = e,
  39919. this.y = t,
  39920. this.z = i,
  39921. this
  39922. },
  39923. setScalar: function(e) {
  39924. return this.x = e,
  39925. this.y = e,
  39926. this.z = e,
  39927. this
  39928. },
  39929. setX: function(e) {
  39930. return this.x = e,
  39931. this
  39932. },
  39933. setY: function(e) {
  39934. return this.y = e,
  39935. this
  39936. },
  39937. setZ: function(e) {
  39938. return this.z = e,
  39939. this
  39940. },
  39941. setComponent: function(e, t) {
  39942. switch (e) {
  39943. case 0:
  39944. this.x = t;
  39945. break;
  39946. case 1:
  39947. this.y = t;
  39948. break;
  39949. case 2:
  39950. this.z = t;
  39951. break;
  39952. default:
  39953. throw new Error("index is out of range: " + e)
  39954. }
  39955. },
  39956. getComponent: function(e) {
  39957. switch (e) {
  39958. case 0:
  39959. return this.x;
  39960. case 1:
  39961. return this.y;
  39962. case 2:
  39963. return this.z;
  39964. default:
  39965. throw new Error("index is out of range: " + e)
  39966. }
  39967. },
  39968. clone: function() {
  39969. return new this.constructor(this.x,this.y,this.z)
  39970. },
  39971. copy: function(e) {
  39972. return this.x = e.x,
  39973. this.y = e.y,
  39974. this.z = e.z,
  39975. this
  39976. },
  39977. add: function(e, t) {
  39978. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39979. this.addVectors(e, t)) : (this.x += e.x,
  39980. this.y += e.y,
  39981. this.z += e.z,
  39982. this)
  39983. },
  39984. addScalar: function(e) {
  39985. return this.x += e,
  39986. this.y += e,
  39987. this.z += e,
  39988. this
  39989. },
  39990. addVectors: function(e, t) {
  39991. return this.x = e.x + t.x,
  39992. this.y = e.y + t.y,
  39993. this.z = e.z + t.z,
  39994. this
  39995. },
  39996. addScaledVector: function(e, t) {
  39997. return this.x += e.x * t,
  39998. this.y += e.y * t,
  39999. this.z += e.z * t,
  40000. this
  40001. },
  40002. sub: function(e, t) {
  40003. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40004. this.subVectors(e, t)) : (this.x -= e.x,
  40005. this.y -= e.y,
  40006. this.z -= e.z,
  40007. this)
  40008. },
  40009. subScalar: function(e) {
  40010. return this.x -= e,
  40011. this.y -= e,
  40012. this.z -= e,
  40013. this
  40014. },
  40015. subVectors: function(e, t) {
  40016. return this.x = e.x - t.x,
  40017. this.y = e.y - t.y,
  40018. this.z = e.z - t.z,
  40019. this
  40020. },
  40021. multiply: function(e, t) {
  40022. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40023. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40024. this.y *= e.y,
  40025. this.z *= e.z,
  40026. this)
  40027. },
  40028. multiplyScalar: function(e) {
  40029. return isFinite(e) ? (this.x *= e,
  40030. this.y *= e,
  40031. this.z *= e) : (this.x = 0,
  40032. this.y = 0,
  40033. this.z = 0),
  40034. this
  40035. },
  40036. multiplyVectors: function(e, t) {
  40037. return this.x = e.x * t.x,
  40038. this.y = e.y * t.y,
  40039. this.z = e.z * t.z,
  40040. this
  40041. },
  40042. applyEuler: function() {
  40043. var e;
  40044. return function(t) {
  40045. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40046. void 0 === e && (e = new n.Quaternion),
  40047. this.applyQuaternion(e.setFromEuler(t)),
  40048. this
  40049. }
  40050. }(),
  40051. applyAxisAngle: function() {
  40052. var e;
  40053. return function(t, i) {
  40054. return void 0 === e && (e = new n.Quaternion),
  40055. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40056. this
  40057. }
  40058. }(),
  40059. applyMatrix3: function(e) {
  40060. var t = this.x
  40061. , i = this.y
  40062. , n = this.z
  40063. , r = e.elements;
  40064. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40065. this.y = r[1] * t + r[4] * i + r[7] * n,
  40066. this.z = r[2] * t + r[5] * i + r[8] * n,
  40067. this
  40068. },
  40069. applyMatrix4: function(e) {
  40070. var t = this.x
  40071. , i = this.y
  40072. , n = this.z
  40073. , r = e.elements;
  40074. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40075. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40076. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40077. this
  40078. },
  40079. applyProjection: function(e) {
  40080. var t = this.x
  40081. , i = this.y
  40082. , n = this.z
  40083. , r = e.elements
  40084. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40085. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40086. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40087. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40088. this
  40089. },
  40090. applyQuaternion: function(e) {
  40091. var t = this.x
  40092. , i = this.y
  40093. , n = this.z
  40094. , r = e.x
  40095. , o = e.y
  40096. , a = e.z
  40097. , s = e.w
  40098. , l = s * t + o * n - a * i
  40099. , c = s * i + a * t - r * n
  40100. , h = s * n + r * i - o * t
  40101. , u = -r * t - o * i - a * n;
  40102. return this.x = l * s + u * -r + c * -a - h * -o,
  40103. this.y = c * s + u * -o + h * -r - l * -a,
  40104. this.z = h * s + u * -a + l * -o - c * -r,
  40105. this
  40106. },
  40107. project: function() {
  40108. var e;
  40109. return function(t) {
  40110. return void 0 === e && (e = new n.Matrix4),
  40111. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40112. this.applyProjection(e)
  40113. }
  40114. }(),
  40115. unproject: function() {
  40116. var e;
  40117. return function(t) {
  40118. return void 0 === e && (e = new n.Matrix4),
  40119. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40120. this.applyProjection(e)
  40121. }
  40122. }(),
  40123. transformDirection: function(e) {
  40124. var t = this.x
  40125. , i = this.y
  40126. , n = this.z
  40127. , r = e.elements;
  40128. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40129. this.y = r[1] * t + r[5] * i + r[9] * n,
  40130. this.z = r[2] * t + r[6] * i + r[10] * n,
  40131. this.normalize(),
  40132. this
  40133. },
  40134. divide: function(e) {
  40135. return this.x /= e.x,
  40136. this.y /= e.y,
  40137. this.z /= e.z,
  40138. this
  40139. },
  40140. divideScalar: function(e) {
  40141. return this.multiplyScalar(1 / e)
  40142. },
  40143. min: function(e) {
  40144. return this.x = Math.min(this.x, e.x),
  40145. this.y = Math.min(this.y, e.y),
  40146. this.z = Math.min(this.z, e.z),
  40147. this
  40148. },
  40149. max: function(e) {
  40150. return this.x = Math.max(this.x, e.x),
  40151. this.y = Math.max(this.y, e.y),
  40152. this.z = Math.max(this.z, e.z),
  40153. this
  40154. },
  40155. clamp: function(e, t) {
  40156. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40157. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40158. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40159. this
  40160. },
  40161. clampScalar: function() {
  40162. var e, t;
  40163. return function(i, r) {
  40164. return void 0 === e && (e = new n.Vector3,
  40165. t = new n.Vector3),
  40166. e.set(i, i, i),
  40167. t.set(r, r, r),
  40168. this.clamp(e, t)
  40169. }
  40170. }(),
  40171. clampLength: function(e, t) {
  40172. var i = this.length();
  40173. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40174. this
  40175. },
  40176. floor: function() {
  40177. return this.x = Math.floor(this.x),
  40178. this.y = Math.floor(this.y),
  40179. this.z = Math.floor(this.z),
  40180. this
  40181. },
  40182. ceil: function() {
  40183. return this.x = Math.ceil(this.x),
  40184. this.y = Math.ceil(this.y),
  40185. this.z = Math.ceil(this.z),
  40186. this
  40187. },
  40188. round: function() {
  40189. return this.x = Math.round(this.x),
  40190. this.y = Math.round(this.y),
  40191. this.z = Math.round(this.z),
  40192. this
  40193. },
  40194. roundToZero: function() {
  40195. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40196. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40197. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40198. this
  40199. },
  40200. negate: function() {
  40201. return this.x = -this.x,
  40202. this.y = -this.y,
  40203. this.z = -this.z,
  40204. this
  40205. },
  40206. dot: function(e) {
  40207. return this.x * e.x + this.y * e.y + this.z * e.z
  40208. },
  40209. lengthSq: function() {
  40210. return this.x * this.x + this.y * this.y + this.z * this.z
  40211. },
  40212. length: function() {
  40213. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40214. },
  40215. lengthManhattan: function() {
  40216. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40217. },
  40218. normalize: function() {
  40219. return this.divideScalar(this.length())
  40220. },
  40221. setLength: function(e) {
  40222. return this.multiplyScalar(e / this.length())
  40223. },
  40224. lerp: function(e, t) {
  40225. return this.x += (e.x - this.x) * t,
  40226. this.y += (e.y - this.y) * t,
  40227. this.z += (e.z - this.z) * t,
  40228. this
  40229. },
  40230. lerpVectors: function(e, t, i) {
  40231. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40232. this
  40233. },
  40234. cross: function(e, t) {
  40235. if (void 0 !== t)
  40236. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40237. this.crossVectors(e, t);
  40238. var i = this.x
  40239. , n = this.y
  40240. , r = this.z;
  40241. return this.x = n * e.z - r * e.y,
  40242. this.y = r * e.x - i * e.z,
  40243. this.z = i * e.y - n * e.x,
  40244. this
  40245. },
  40246. crossVectors: function(e, t) {
  40247. var i = e.x
  40248. , n = e.y
  40249. , r = e.z
  40250. , o = t.x
  40251. , a = t.y
  40252. , s = t.z;
  40253. return this.x = n * s - r * a,
  40254. this.y = r * o - i * s,
  40255. this.z = i * a - n * o,
  40256. this
  40257. },
  40258. projectOnVector: function() {
  40259. var e, t;
  40260. return function(i) {
  40261. return void 0 === e && (e = new n.Vector3),
  40262. e.copy(i).normalize(),
  40263. t = this.dot(e),
  40264. this.copy(e).multiplyScalar(t)
  40265. }
  40266. }(),
  40267. projectOnPlane: function() {
  40268. var e;
  40269. return function(t) {
  40270. return void 0 === e && (e = new n.Vector3),
  40271. e.copy(this).projectOnVector(t),
  40272. this.sub(e)
  40273. }
  40274. }(),
  40275. reflect: function() {
  40276. var e;
  40277. return function(t) {
  40278. return void 0 === e && (e = new n.Vector3),
  40279. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40280. }
  40281. }(),
  40282. angleTo: function(e) {
  40283. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40284. return Math.acos(n.Math.clamp(t, -1, 1))
  40285. },
  40286. distanceTo: function(e) {
  40287. return Math.sqrt(this.distanceToSquared(e))
  40288. },
  40289. distanceToSquared: function(e) {
  40290. var t = this.x - e.x
  40291. , i = this.y - e.y
  40292. , n = this.z - e.z;
  40293. return t * t + i * i + n * n
  40294. },
  40295. setFromSpherical: function(e) {
  40296. var t = Math.sin(e.phi) * e.radius;
  40297. return this.x = t * Math.sin(e.theta),
  40298. this.y = Math.cos(e.phi) * e.radius,
  40299. this.z = t * Math.cos(e.theta),
  40300. this
  40301. },
  40302. setFromMatrixPosition: function(e) {
  40303. return this.setFromMatrixColumn(e, 3)
  40304. },
  40305. setFromMatrixScale: function(e) {
  40306. var t = this.setFromMatrixColumn(e, 0).length()
  40307. , i = this.setFromMatrixColumn(e, 1).length()
  40308. , n = this.setFromMatrixColumn(e, 2).length();
  40309. return this.x = t,
  40310. this.y = i,
  40311. this.z = n,
  40312. this
  40313. },
  40314. setFromMatrixColumn: function(e, t) {
  40315. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40316. e = arguments[1],
  40317. t = arguments[0]),
  40318. this.fromArray(e.elements, 4 * t)
  40319. },
  40320. equals: function(e) {
  40321. return e.x === this.x && e.y === this.y && e.z === this.z
  40322. },
  40323. fromArray: function(e, t) {
  40324. return void 0 === t && (t = 0),
  40325. this.x = e[t],
  40326. this.y = e[t + 1],
  40327. this.z = e[t + 2],
  40328. this
  40329. },
  40330. toArray: function(e, t) {
  40331. return void 0 === e && (e = []),
  40332. void 0 === t && (t = 0),
  40333. e[t] = this.x,
  40334. e[t + 1] = this.y,
  40335. e[t + 2] = this.z,
  40336. e
  40337. },
  40338. fromAttribute: function(e, t, i) {
  40339. return void 0 === i && (i = 0),
  40340. t = t * e.itemSize + i,
  40341. this.x = e.array[t],
  40342. this.y = e.array[t + 1],
  40343. this.z = e.array[t + 2],
  40344. this
  40345. }
  40346. },
  40347. n.Vector4 = function(e, t, i, n) {
  40348. this.x = e || 0,
  40349. this.y = t || 0,
  40350. this.z = i || 0,
  40351. this.w = void 0 !== n ? n : 1
  40352. }
  40353. ,
  40354. n.Vector4.prototype = {
  40355. constructor: n.Vector4,
  40356. set: function(e, t, i, n) {
  40357. return this.x = e,
  40358. this.y = t,
  40359. this.z = i,
  40360. this.w = n,
  40361. this
  40362. },
  40363. setScalar: function(e) {
  40364. return this.x = e,
  40365. this.y = e,
  40366. this.z = e,
  40367. this.w = e,
  40368. this
  40369. },
  40370. setX: function(e) {
  40371. return this.x = e,
  40372. this
  40373. },
  40374. setY: function(e) {
  40375. return this.y = e,
  40376. this
  40377. },
  40378. setZ: function(e) {
  40379. return this.z = e,
  40380. this
  40381. },
  40382. setW: function(e) {
  40383. return this.w = e,
  40384. this
  40385. },
  40386. setComponent: function(e, t) {
  40387. switch (e) {
  40388. case 0:
  40389. this.x = t;
  40390. break;
  40391. case 1:
  40392. this.y = t;
  40393. break;
  40394. case 2:
  40395. this.z = t;
  40396. break;
  40397. case 3:
  40398. this.w = t;
  40399. break;
  40400. default:
  40401. throw new Error("index is out of range: " + e)
  40402. }
  40403. },
  40404. getComponent: function(e) {
  40405. switch (e) {
  40406. case 0:
  40407. return this.x;
  40408. case 1:
  40409. return this.y;
  40410. case 2:
  40411. return this.z;
  40412. case 3:
  40413. return this.w;
  40414. default:
  40415. throw new Error("index is out of range: " + e)
  40416. }
  40417. },
  40418. clone: function() {
  40419. return new this.constructor(this.x,this.y,this.z,this.w)
  40420. },
  40421. copy: function(e) {
  40422. return this.x = e.x,
  40423. this.y = e.y,
  40424. this.z = e.z,
  40425. this.w = void 0 !== e.w ? e.w : 1,
  40426. this
  40427. },
  40428. add: function(e, t) {
  40429. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40430. this.addVectors(e, t)) : (this.x += e.x,
  40431. this.y += e.y,
  40432. this.z += e.z,
  40433. this.w += e.w,
  40434. this)
  40435. },
  40436. addScalar: function(e) {
  40437. return this.x += e,
  40438. this.y += e,
  40439. this.z += e,
  40440. this.w += e,
  40441. this
  40442. },
  40443. addVectors: function(e, t) {
  40444. return this.x = e.x + t.x,
  40445. this.y = e.y + t.y,
  40446. this.z = e.z + t.z,
  40447. this.w = e.w + t.w,
  40448. this
  40449. },
  40450. addScaledVector: function(e, t) {
  40451. return this.x += e.x * t,
  40452. this.y += e.y * t,
  40453. this.z += e.z * t,
  40454. this.w += e.w * t,
  40455. this
  40456. },
  40457. sub: function(e, t) {
  40458. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40459. this.subVectors(e, t)) : (this.x -= e.x,
  40460. this.y -= e.y,
  40461. this.z -= e.z,
  40462. this.w -= e.w,
  40463. this)
  40464. },
  40465. subScalar: function(e) {
  40466. return this.x -= e,
  40467. this.y -= e,
  40468. this.z -= e,
  40469. this.w -= e,
  40470. this
  40471. },
  40472. subVectors: function(e, t) {
  40473. return this.x = e.x - t.x,
  40474. this.y = e.y - t.y,
  40475. this.z = e.z - t.z,
  40476. this.w = e.w - t.w,
  40477. this
  40478. },
  40479. multiplyScalar: function(e) {
  40480. return isFinite(e) ? (this.x *= e,
  40481. this.y *= e,
  40482. this.z *= e,
  40483. this.w *= e) : (this.x = 0,
  40484. this.y = 0,
  40485. this.z = 0,
  40486. this.w = 0),
  40487. this
  40488. },
  40489. applyMatrix4: function(e) {
  40490. var t = this.x
  40491. , i = this.y
  40492. , n = this.z
  40493. , r = this.w
  40494. , o = e.elements;
  40495. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  40496. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  40497. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  40498. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  40499. this
  40500. },
  40501. divideScalar: function(e) {
  40502. return this.multiplyScalar(1 / e)
  40503. },
  40504. setAxisAngleFromQuaternion: function(e) {
  40505. this.w = 2 * Math.acos(e.w);
  40506. var t = Math.sqrt(1 - e.w * e.w);
  40507. return t < 1e-4 ? (this.x = 1,
  40508. this.y = 0,
  40509. this.z = 0) : (this.x = e.x / t,
  40510. this.y = e.y / t,
  40511. this.z = e.z / t),
  40512. this
  40513. },
  40514. setAxisAngleFromRotationMatrix: function(e) {
  40515. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  40516. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  40517. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  40518. return this.set(1, 0, 0, 0),
  40519. this;
  40520. t = Math.PI;
  40521. var v = (l + 1) / 2
  40522. , A = (d + 1) / 2
  40523. , y = (m + 1) / 2
  40524. , C = (c + u) / 4
  40525. , I = (h + f) / 4
  40526. , E = (p + g) / 4;
  40527. return v > A && v > y ? v < o ? (i = 0,
  40528. n = .707106781,
  40529. r = .707106781) : (i = Math.sqrt(v),
  40530. n = C / i,
  40531. r = I / i) : A > y ? A < o ? (i = .707106781,
  40532. n = 0,
  40533. r = .707106781) : (n = Math.sqrt(A),
  40534. i = C / n,
  40535. r = E / n) : y < o ? (i = .707106781,
  40536. n = .707106781,
  40537. r = 0) : (r = Math.sqrt(y),
  40538. i = I / r,
  40539. n = E / r),
  40540. this.set(i, n, r, t),
  40541. this
  40542. }
  40543. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  40544. return Math.abs(b) < .001 && (b = 1),
  40545. this.x = (g - p) / b,
  40546. this.y = (h - f) / b,
  40547. this.z = (u - c) / b,
  40548. this.w = Math.acos((l + d + m - 1) / 2),
  40549. this
  40550. },
  40551. min: function(e) {
  40552. return this.x = Math.min(this.x, e.x),
  40553. this.y = Math.min(this.y, e.y),
  40554. this.z = Math.min(this.z, e.z),
  40555. this.w = Math.min(this.w, e.w),
  40556. this
  40557. },
  40558. max: function(e) {
  40559. return this.x = Math.max(this.x, e.x),
  40560. this.y = Math.max(this.y, e.y),
  40561. this.z = Math.max(this.z, e.z),
  40562. this.w = Math.max(this.w, e.w),
  40563. this
  40564. },
  40565. clamp: function(e, t) {
  40566. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40567. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40568. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40569. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  40570. this
  40571. },
  40572. clampScalar: function() {
  40573. var e, t;
  40574. return function(i, r) {
  40575. return void 0 === e && (e = new n.Vector4,
  40576. t = new n.Vector4),
  40577. e.set(i, i, i, i),
  40578. t.set(r, r, r, r),
  40579. this.clamp(e, t)
  40580. }
  40581. }(),
  40582. floor: function() {
  40583. return this.x = Math.floor(this.x),
  40584. this.y = Math.floor(this.y),
  40585. this.z = Math.floor(this.z),
  40586. this.w = Math.floor(this.w),
  40587. this
  40588. },
  40589. ceil: function() {
  40590. return this.x = Math.ceil(this.x),
  40591. this.y = Math.ceil(this.y),
  40592. this.z = Math.ceil(this.z),
  40593. this.w = Math.ceil(this.w),
  40594. this
  40595. },
  40596. round: function() {
  40597. return this.x = Math.round(this.x),
  40598. this.y = Math.round(this.y),
  40599. this.z = Math.round(this.z),
  40600. this.w = Math.round(this.w),
  40601. this
  40602. },
  40603. roundToZero: function() {
  40604. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40605. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40606. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40607. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  40608. this
  40609. },
  40610. negate: function() {
  40611. return this.x = -this.x,
  40612. this.y = -this.y,
  40613. this.z = -this.z,
  40614. this.w = -this.w,
  40615. this
  40616. },
  40617. dot: function(e) {
  40618. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  40619. },
  40620. lengthSq: function() {
  40621. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  40622. },
  40623. length: function() {
  40624. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  40625. },
  40626. lengthManhattan: function() {
  40627. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  40628. },
  40629. normalize: function() {
  40630. return this.divideScalar(this.length())
  40631. },
  40632. setLength: function(e) {
  40633. return this.multiplyScalar(e / this.length())
  40634. },
  40635. lerp: function(e, t) {
  40636. return this.x += (e.x - this.x) * t,
  40637. this.y += (e.y - this.y) * t,
  40638. this.z += (e.z - this.z) * t,
  40639. this.w += (e.w - this.w) * t,
  40640. this
  40641. },
  40642. lerpVectors: function(e, t, i) {
  40643. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40644. this
  40645. },
  40646. equals: function(e) {
  40647. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  40648. },
  40649. fromArray: function(e, t) {
  40650. return void 0 === t && (t = 0),
  40651. this.x = e[t],
  40652. this.y = e[t + 1],
  40653. this.z = e[t + 2],
  40654. this.w = e[t + 3],
  40655. this
  40656. },
  40657. toArray: function(e, t) {
  40658. return void 0 === e && (e = []),
  40659. void 0 === t && (t = 0),
  40660. e[t] = this.x,
  40661. e[t + 1] = this.y,
  40662. e[t + 2] = this.z,
  40663. e[t + 3] = this.w,
  40664. e
  40665. },
  40666. fromAttribute: function(e, t, i) {
  40667. return void 0 === i && (i = 0),
  40668. t = t * e.itemSize + i,
  40669. this.x = e.array[t],
  40670. this.y = e.array[t + 1],
  40671. this.z = e.array[t + 2],
  40672. this.w = e.array[t + 3],
  40673. this
  40674. }
  40675. },
  40676. n.Euler = function(e, t, i, r) {
  40677. this._x = e || 0,
  40678. this._y = t || 0,
  40679. this._z = i || 0,
  40680. this._order = r || n.Euler.DefaultOrder
  40681. }
  40682. ,
  40683. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  40684. n.Euler.DefaultOrder = "XYZ",
  40685. n.Euler.prototype = {
  40686. constructor: n.Euler,
  40687. get x() {
  40688. return this._x
  40689. },
  40690. set x(e) {
  40691. this._x = e,
  40692. this.onChangeCallback()
  40693. },
  40694. get y() {
  40695. return this._y
  40696. },
  40697. set y(e) {
  40698. this._y = e,
  40699. this.onChangeCallback()
  40700. },
  40701. get z() {
  40702. return this._z
  40703. },
  40704. set z(e) {
  40705. this._z = e,
  40706. this.onChangeCallback()
  40707. },
  40708. get order() {
  40709. return this._order
  40710. },
  40711. set order(e) {
  40712. this._order = e,
  40713. this.onChangeCallback()
  40714. },
  40715. set: function(e, t, i, n) {
  40716. return this._x = e,
  40717. this._y = t,
  40718. this._z = i,
  40719. this._order = n || this._order,
  40720. this.onChangeCallback(),
  40721. this
  40722. },
  40723. clone: function() {
  40724. return new this.constructor(this._x,this._y,this._z,this._order)
  40725. },
  40726. copy: function(e) {
  40727. return this._x = e._x,
  40728. this._y = e._y,
  40729. this._z = e._z,
  40730. this._order = e._order,
  40731. this.onChangeCallback(),
  40732. this
  40733. },
  40734. setFromRotationMatrix: function(e, t, i) {
  40735. var r = n.Math.clamp
  40736. , o = e.elements
  40737. , a = o[0]
  40738. , s = o[4]
  40739. , l = o[8]
  40740. , c = o[1]
  40741. , h = o[5]
  40742. , u = o[9]
  40743. , d = o[2]
  40744. , p = o[6]
  40745. , f = o[10];
  40746. return t = t || this._order,
  40747. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  40748. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  40749. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  40750. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  40751. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  40752. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  40753. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  40754. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  40755. this._z = Math.atan2(-s, h)) : (this._y = 0,
  40756. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  40757. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  40758. this._z = Math.atan2(c, a)) : (this._x = 0,
  40759. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  40760. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  40761. this._y = Math.atan2(-d, a)) : (this._x = 0,
  40762. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  40763. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  40764. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  40765. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  40766. this._order = t,
  40767. i !== !1 && this.onChangeCallback(),
  40768. this
  40769. },
  40770. setFromQuaternion: function() {
  40771. var e;
  40772. return function(t, i, r) {
  40773. return void 0 === e && (e = new n.Matrix4),
  40774. e.makeRotationFromQuaternion(t),
  40775. this.setFromRotationMatrix(e, i, r),
  40776. this
  40777. }
  40778. }(),
  40779. setFromVector3: function(e, t) {
  40780. return this.set(e.x, e.y, e.z, t || this._order)
  40781. },
  40782. reorder: function() {
  40783. var e = new n.Quaternion;
  40784. return function(t) {
  40785. e.setFromEuler(this),
  40786. this.setFromQuaternion(e, t)
  40787. }
  40788. }(),
  40789. equals: function(e) {
  40790. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  40791. },
  40792. fromArray: function(e) {
  40793. return this._x = e[0],
  40794. this._y = e[1],
  40795. this._z = e[2],
  40796. void 0 !== e[3] && (this._order = e[3]),
  40797. this.onChangeCallback(),
  40798. this
  40799. },
  40800. toArray: function(e, t) {
  40801. return void 0 === e && (e = []),
  40802. void 0 === t && (t = 0),
  40803. e[t] = this._x,
  40804. e[t + 1] = this._y,
  40805. e[t + 2] = this._z,
  40806. e[t + 3] = this._order,
  40807. e
  40808. },
  40809. toVector3: function(e) {
  40810. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  40811. },
  40812. onChange: function(e) {
  40813. return this.onChangeCallback = e,
  40814. this
  40815. },
  40816. onChangeCallback: function() {}
  40817. },
  40818. n.Line3 = function(e, t) {
  40819. this.start = void 0 !== e ? e : new n.Vector3,
  40820. this.end = void 0 !== t ? t : new n.Vector3
  40821. }
  40822. ,
  40823. n.Line3.prototype = {
  40824. constructor: n.Line3,
  40825. set: function(e, t) {
  40826. return this.start.copy(e),
  40827. this.end.copy(t),
  40828. this
  40829. },
  40830. clone: function() {
  40831. return (new this.constructor).copy(this)
  40832. },
  40833. copy: function(e) {
  40834. return this.start.copy(e.start),
  40835. this.end.copy(e.end),
  40836. this
  40837. },
  40838. center: function(e) {
  40839. var t = e || new n.Vector3;
  40840. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  40841. },
  40842. delta: function(e) {
  40843. var t = e || new n.Vector3;
  40844. return t.subVectors(this.end, this.start)
  40845. },
  40846. distanceSq: function() {
  40847. return this.start.distanceToSquared(this.end)
  40848. },
  40849. distance: function() {
  40850. return this.start.distanceTo(this.end)
  40851. },
  40852. at: function(e, t) {
  40853. var i = t || new n.Vector3;
  40854. return this.delta(i).multiplyScalar(e).add(this.start)
  40855. },
  40856. closestPointToPointParameter: function() {
  40857. var e = new n.Vector3
  40858. , t = new n.Vector3;
  40859. return function(i, r) {
  40860. e.subVectors(i, this.start),
  40861. t.subVectors(this.end, this.start);
  40862. var o = t.dot(t)
  40863. , a = t.dot(e)
  40864. , s = a / o;
  40865. return r && (s = n.Math.clamp(s, 0, 1)),
  40866. s
  40867. }
  40868. }(),
  40869. closestPointToPoint: function(e, t, i) {
  40870. var r = this.closestPointToPointParameter(e, t)
  40871. , o = i || new n.Vector3;
  40872. return this.delta(o).multiplyScalar(r).add(this.start)
  40873. },
  40874. applyMatrix4: function(e) {
  40875. return this.start.applyMatrix4(e),
  40876. this.end.applyMatrix4(e),
  40877. this
  40878. },
  40879. equals: function(e) {
  40880. return e.start.equals(this.start) && e.end.equals(this.end)
  40881. }
  40882. },
  40883. n.Box2 = function(e, t) {
  40884. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  40885. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  40886. }
  40887. ,
  40888. n.Box2.prototype = {
  40889. constructor: n.Box2,
  40890. set: function(e, t) {
  40891. return this.min.copy(e),
  40892. this.max.copy(t),
  40893. this
  40894. },
  40895. setFromPoints: function(e) {
  40896. this.makeEmpty();
  40897. for (var t = 0, i = e.length; t < i; t++)
  40898. this.expandByPoint(e[t]);
  40899. return this
  40900. },
  40901. setFromCenterAndSize: function() {
  40902. var e = new n.Vector2;
  40903. return function(t, i) {
  40904. var n = e.copy(i).multiplyScalar(.5);
  40905. return this.min.copy(t).sub(n),
  40906. this.max.copy(t).add(n),
  40907. this
  40908. }
  40909. }(),
  40910. clone: function() {
  40911. return (new this.constructor).copy(this)
  40912. },
  40913. copy: function(e) {
  40914. return this.min.copy(e.min),
  40915. this.max.copy(e.max),
  40916. this
  40917. },
  40918. makeEmpty: function() {
  40919. return this.min.x = this.min.y = +(1 / 0),
  40920. this.max.x = this.max.y = -(1 / 0),
  40921. this
  40922. },
  40923. isEmpty: function() {
  40924. return this.max.x < this.min.x || this.max.y < this.min.y
  40925. },
  40926. center: function(e) {
  40927. var t = e || new n.Vector2;
  40928. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40929. },
  40930. size: function(e) {
  40931. var t = e || new n.Vector2;
  40932. return t.subVectors(this.max, this.min)
  40933. },
  40934. expandByPoint: function(e) {
  40935. return this.min.min(e),
  40936. this.max.max(e),
  40937. this
  40938. },
  40939. expandByVector: function(e) {
  40940. return this.min.sub(e),
  40941. this.max.add(e),
  40942. this
  40943. },
  40944. expandByScalar: function(e) {
  40945. return this.min.addScalar(-e),
  40946. this.max.addScalar(e),
  40947. this
  40948. },
  40949. containsPoint: function(e) {
  40950. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  40951. },
  40952. containsBox: function(e) {
  40953. 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
  40954. },
  40955. getParameter: function(e, t) {
  40956. var i = t || new n.Vector2;
  40957. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  40958. },
  40959. intersectsBox: function(e) {
  40960. 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)
  40961. },
  40962. clampPoint: function(e, t) {
  40963. var i = t || new n.Vector2;
  40964. return i.copy(e).clamp(this.min, this.max)
  40965. },
  40966. distanceToPoint: function() {
  40967. var e = new n.Vector2;
  40968. return function(t) {
  40969. var i = e.copy(t).clamp(this.min, this.max);
  40970. return i.sub(t).length()
  40971. }
  40972. }(),
  40973. intersect: function(e) {
  40974. return this.min.max(e.min),
  40975. this.max.min(e.max),
  40976. this
  40977. },
  40978. union: function(e) {
  40979. return this.min.min(e.min),
  40980. this.max.max(e.max),
  40981. this
  40982. },
  40983. translate: function(e) {
  40984. return this.min.add(e),
  40985. this.max.add(e),
  40986. this
  40987. },
  40988. equals: function(e) {
  40989. return e.min.equals(this.min) && e.max.equals(this.max)
  40990. }
  40991. },
  40992. n.Box3 = function(e, t) {
  40993. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  40994. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  40995. }
  40996. ,
  40997. n.Box3.prototype = {
  40998. constructor: n.Box3,
  40999. set: function(e, t) {
  41000. return this.min.copy(e),
  41001. this.max.copy(t),
  41002. this
  41003. },
  41004. setFromArray: function(e) {
  41005. this.makeEmpty();
  41006. 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) {
  41007. var c = e[s]
  41008. , h = e[s + 1]
  41009. , u = e[s + 2];
  41010. c < t && (t = c),
  41011. h < i && (i = h),
  41012. u < n && (n = u),
  41013. c > r && (r = c),
  41014. h > o && (o = h),
  41015. u > a && (a = u)
  41016. }
  41017. this.min.set(t, i, n),
  41018. this.max.set(r, o, a)
  41019. },
  41020. setFromPoints: function(e) {
  41021. this.makeEmpty();
  41022. for (var t = 0, i = e.length; t < i; t++)
  41023. this.expandByPoint(e[t]);
  41024. return this
  41025. },
  41026. setFromCenterAndSize: function() {
  41027. var e = new n.Vector3;
  41028. return function(t, i) {
  41029. var n = e.copy(i).multiplyScalar(.5);
  41030. return this.min.copy(t).sub(n),
  41031. this.max.copy(t).add(n),
  41032. this
  41033. }
  41034. }(),
  41035. setFromObject: function() {
  41036. var e;
  41037. return function(t) {
  41038. void 0 === e && (e = new n.Box3);
  41039. var i = this;
  41040. return this.makeEmpty(),
  41041. t.updateMatrixWorld(!0),
  41042. t.traverse(function(t) {
  41043. var n = t.geometry;
  41044. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41045. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41046. e.applyMatrix4(t.matrixWorld),
  41047. i.union(e)))
  41048. }),
  41049. this
  41050. }
  41051. }(),
  41052. clone: function() {
  41053. return (new this.constructor).copy(this)
  41054. },
  41055. copy: function(e) {
  41056. return this.min.copy(e.min),
  41057. this.max.copy(e.max),
  41058. this
  41059. },
  41060. makeEmpty: function() {
  41061. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41062. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41063. this
  41064. },
  41065. isEmpty: function() {
  41066. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41067. },
  41068. center: function(e) {
  41069. var t = e || new n.Vector3;
  41070. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41071. },
  41072. size: function(e) {
  41073. var t = e || new n.Vector3;
  41074. return t.subVectors(this.max, this.min)
  41075. },
  41076. expandByPoint: function(e) {
  41077. return this.min.min(e),
  41078. this.max.max(e),
  41079. this
  41080. },
  41081. expandByVector: function(e) {
  41082. return this.min.sub(e),
  41083. this.max.add(e),
  41084. this
  41085. },
  41086. expandByScalar: function(e) {
  41087. return this.min.addScalar(-e),
  41088. this.max.addScalar(e),
  41089. this
  41090. },
  41091. containsPoint: function(e) {
  41092. 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)
  41093. },
  41094. containsBox: function(e) {
  41095. 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
  41096. },
  41097. getParameter: function(e, t) {
  41098. var i = t || new n.Vector3;
  41099. return i.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))
  41100. },
  41101. intersectsBox: function(e) {
  41102. 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)
  41103. },
  41104. intersectsSphere: function() {
  41105. var e;
  41106. return function(t) {
  41107. return void 0 === e && (e = new n.Vector3),
  41108. this.clampPoint(t.center, e),
  41109. e.distanceToSquared(t.center) <= t.radius * t.radius
  41110. }
  41111. }(),
  41112. intersectsPlane: function(e) {
  41113. var t, i;
  41114. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41115. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41116. i = e.normal.x * this.min.x),
  41117. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41118. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41119. i += e.normal.y * this.min.y),
  41120. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41121. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41122. i += e.normal.z * this.min.z),
  41123. t <= e.constant && i >= e.constant
  41124. },
  41125. clampPoint: function(e, t) {
  41126. var i = t || new n.Vector3;
  41127. return i.copy(e).clamp(this.min, this.max)
  41128. },
  41129. distanceToPoint: function() {
  41130. var e = new n.Vector3;
  41131. return function(t) {
  41132. var i = e.copy(t).clamp(this.min, this.max);
  41133. return i.sub(t).length()
  41134. }
  41135. }(),
  41136. getBoundingSphere: function() {
  41137. var e = new n.Vector3;
  41138. return function(t) {
  41139. var i = t || new n.Sphere;
  41140. return i.center = this.center(),
  41141. i.radius = .5 * this.size(e).length(),
  41142. i
  41143. }
  41144. }(),
  41145. intersect: function(e) {
  41146. return this.min.max(e.min),
  41147. this.max.min(e.max),
  41148. this
  41149. },
  41150. union: function(e) {
  41151. return this.min.min(e.min),
  41152. this.max.max(e.max),
  41153. this
  41154. },
  41155. applyMatrix4: function() {
  41156. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  41157. return function(t) {
  41158. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41159. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41160. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41161. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41162. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41163. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41164. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41165. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41166. this.makeEmpty(),
  41167. this.setFromPoints(e),
  41168. this
  41169. }
  41170. }(),
  41171. translate: function(e) {
  41172. return this.min.add(e),
  41173. this.max.add(e),
  41174. this
  41175. },
  41176. equals: function(e) {
  41177. return e.min.equals(this.min) && e.max.equals(this.max)
  41178. }
  41179. },
  41180. n.Matrix3 = function() {
  41181. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41182. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41183. }
  41184. ,
  41185. n.Matrix3.prototype = {
  41186. constructor: n.Matrix3,
  41187. set: function(e, t, i, n, r, o, a, s, l) {
  41188. var c = this.elements;
  41189. return c[0] = e,
  41190. c[1] = n,
  41191. c[2] = a,
  41192. c[3] = t,
  41193. c[4] = r,
  41194. c[5] = s,
  41195. c[6] = i,
  41196. c[7] = o,
  41197. c[8] = l,
  41198. this
  41199. },
  41200. identity: function() {
  41201. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41202. this
  41203. },
  41204. clone: function() {
  41205. return (new this.constructor).fromArray(this.elements)
  41206. },
  41207. copy: function(e) {
  41208. var t = e.elements;
  41209. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41210. this
  41211. },
  41212. setFromMatrix4: function(e) {
  41213. var t = e.elements;
  41214. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41215. this
  41216. },
  41217. applyToVector3Array: function() {
  41218. var e;
  41219. return function(t, i, r) {
  41220. void 0 === e && (e = new n.Vector3),
  41221. void 0 === i && (i = 0),
  41222. void 0 === r && (r = t.length);
  41223. for (var o = 0, a = i; o < r; o += 3,
  41224. a += 3)
  41225. e.fromArray(t, a),
  41226. e.applyMatrix3(this),
  41227. e.toArray(t, a);
  41228. return t
  41229. }
  41230. }(),
  41231. applyToBuffer: function() {
  41232. var e;
  41233. return function(t, i, r) {
  41234. void 0 === e && (e = new n.Vector3),
  41235. void 0 === i && (i = 0),
  41236. void 0 === r && (r = t.length / t.itemSize);
  41237. for (var o = 0, a = i; o < r; o++,
  41238. a++)
  41239. e.x = t.getX(a),
  41240. e.y = t.getY(a),
  41241. e.z = t.getZ(a),
  41242. e.applyMatrix3(this),
  41243. t.setXYZ(e.x, e.y, e.z);
  41244. return t
  41245. }
  41246. }(),
  41247. multiplyScalar: function(e) {
  41248. var t = this.elements;
  41249. return t[0] *= e,
  41250. t[3] *= e,
  41251. t[6] *= e,
  41252. t[1] *= e,
  41253. t[4] *= e,
  41254. t[7] *= e,
  41255. t[2] *= e,
  41256. t[5] *= e,
  41257. t[8] *= e,
  41258. this
  41259. },
  41260. determinant: function() {
  41261. var e = this.elements
  41262. , t = e[0]
  41263. , i = e[1]
  41264. , n = e[2]
  41265. , r = e[3]
  41266. , o = e[4]
  41267. , a = e[5]
  41268. , s = e[6]
  41269. , l = e[7]
  41270. , c = e[8];
  41271. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41272. },
  41273. getInverse: function(e, t) {
  41274. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41275. var i = e.elements
  41276. , r = this.elements
  41277. , o = i[0]
  41278. , a = i[1]
  41279. , s = i[2]
  41280. , l = i[3]
  41281. , c = i[4]
  41282. , h = i[5]
  41283. , u = i[6]
  41284. , d = i[7]
  41285. , p = i[8]
  41286. , f = p * c - h * d
  41287. , g = h * u - p * l
  41288. , m = d * l - c * u
  41289. , v = o * f + a * g + s * m;
  41290. if (0 === v) {
  41291. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41292. if (t)
  41293. throw new Error(A);
  41294. return console.warn(A),
  41295. this.identity()
  41296. }
  41297. return r[0] = f,
  41298. r[1] = s * d - p * a,
  41299. r[2] = h * a - s * c,
  41300. r[3] = g,
  41301. r[4] = p * o - s * u,
  41302. r[5] = s * l - h * o,
  41303. r[6] = m,
  41304. r[7] = a * u - d * o,
  41305. r[8] = c * o - a * l,
  41306. this.multiplyScalar(1 / v)
  41307. },
  41308. transpose: function() {
  41309. var e, t = this.elements;
  41310. return e = t[1],
  41311. t[1] = t[3],
  41312. t[3] = e,
  41313. e = t[2],
  41314. t[2] = t[6],
  41315. t[6] = e,
  41316. e = t[5],
  41317. t[5] = t[7],
  41318. t[7] = e,
  41319. this
  41320. },
  41321. flattenToArrayOffset: function(e, t) {
  41322. var i = this.elements;
  41323. return e[t] = i[0],
  41324. e[t + 1] = i[1],
  41325. e[t + 2] = i[2],
  41326. e[t + 3] = i[3],
  41327. e[t + 4] = i[4],
  41328. e[t + 5] = i[5],
  41329. e[t + 6] = i[6],
  41330. e[t + 7] = i[7],
  41331. e[t + 8] = i[8],
  41332. e
  41333. },
  41334. getNormalMatrix: function(e) {
  41335. return this.setFromMatrix4(e).getInverse(this).transpose()
  41336. },
  41337. transposeIntoArray: function(e) {
  41338. var t = this.elements;
  41339. return e[0] = t[0],
  41340. e[1] = t[3],
  41341. e[2] = t[6],
  41342. e[3] = t[1],
  41343. e[4] = t[4],
  41344. e[5] = t[7],
  41345. e[6] = t[2],
  41346. e[7] = t[5],
  41347. e[8] = t[8],
  41348. this
  41349. },
  41350. fromArray: function(e) {
  41351. return this.elements.set(e),
  41352. this
  41353. },
  41354. toArray: function() {
  41355. var e = this.elements;
  41356. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41357. }
  41358. },
  41359. n.Matrix4 = function() {
  41360. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41361. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41362. }
  41363. ,
  41364. n.Matrix4.prototype = {
  41365. constructor: n.Matrix4,
  41366. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41367. var m = this.elements;
  41368. return m[0] = e,
  41369. m[4] = t,
  41370. m[8] = i,
  41371. m[12] = n,
  41372. m[1] = r,
  41373. m[5] = o,
  41374. m[9] = a,
  41375. m[13] = s,
  41376. m[2] = l,
  41377. m[6] = c,
  41378. m[10] = h,
  41379. m[14] = u,
  41380. m[3] = d,
  41381. m[7] = p,
  41382. m[11] = f,
  41383. m[15] = g,
  41384. this
  41385. },
  41386. identity: function() {
  41387. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41388. this
  41389. },
  41390. clone: function() {
  41391. return (new n.Matrix4).fromArray(this.elements)
  41392. },
  41393. copy: function(e) {
  41394. return this.elements.set(e.elements),
  41395. this
  41396. },
  41397. copyPosition: function(e) {
  41398. var t = this.elements
  41399. , i = e.elements;
  41400. return t[12] = i[12],
  41401. t[13] = i[13],
  41402. t[14] = i[14],
  41403. this
  41404. },
  41405. extractBasis: function(e, t, i) {
  41406. return e.setFromMatrixColumn(this, 0),
  41407. t.setFromMatrixColumn(this, 1),
  41408. i.setFromMatrixColumn(this, 2),
  41409. this
  41410. },
  41411. makeBasis: function(e, t, i) {
  41412. 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),
  41413. this
  41414. },
  41415. extractRotation: function() {
  41416. var e;
  41417. return function(t) {
  41418. void 0 === e && (e = new n.Vector3);
  41419. var i = this.elements
  41420. , r = t.elements
  41421. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41422. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41423. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41424. return i[0] = r[0] * o,
  41425. i[1] = r[1] * o,
  41426. i[2] = r[2] * o,
  41427. i[4] = r[4] * a,
  41428. i[5] = r[5] * a,
  41429. i[6] = r[6] * a,
  41430. i[8] = r[8] * s,
  41431. i[9] = r[9] * s,
  41432. i[10] = r[10] * s,
  41433. this
  41434. }
  41435. }(),
  41436. makeRotationFromEuler: function(e) {
  41437. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41438. var t = this.elements
  41439. , i = e.x
  41440. , r = e.y
  41441. , o = e.z
  41442. , a = Math.cos(i)
  41443. , s = Math.sin(i)
  41444. , l = Math.cos(r)
  41445. , c = Math.sin(r)
  41446. , h = Math.cos(o)
  41447. , u = Math.sin(o);
  41448. if ("XYZ" === e.order) {
  41449. var d = a * h
  41450. , p = a * u
  41451. , f = s * h
  41452. , g = s * u;
  41453. t[0] = l * h,
  41454. t[4] = -l * u,
  41455. t[8] = c,
  41456. t[1] = p + f * c,
  41457. t[5] = d - g * c,
  41458. t[9] = -s * l,
  41459. t[2] = g - d * c,
  41460. t[6] = f + p * c,
  41461. t[10] = a * l
  41462. } else if ("YXZ" === e.order) {
  41463. var m = l * h
  41464. , v = l * u
  41465. , A = c * h
  41466. , y = c * u;
  41467. t[0] = m + y * s,
  41468. t[4] = A * s - v,
  41469. t[8] = a * c,
  41470. t[1] = a * u,
  41471. t[5] = a * h,
  41472. t[9] = -s,
  41473. t[2] = v * s - A,
  41474. t[6] = y + m * s,
  41475. t[10] = a * l
  41476. } else if ("ZXY" === e.order) {
  41477. var m = l * h
  41478. , v = l * u
  41479. , A = c * h
  41480. , y = c * u;
  41481. t[0] = m - y * s,
  41482. t[4] = -a * u,
  41483. t[8] = A + v * s,
  41484. t[1] = v + A * s,
  41485. t[5] = a * h,
  41486. t[9] = y - m * s,
  41487. t[2] = -a * c,
  41488. t[6] = s,
  41489. t[10] = a * l
  41490. } else if ("ZYX" === e.order) {
  41491. var d = a * h
  41492. , p = a * u
  41493. , f = s * h
  41494. , g = s * u;
  41495. t[0] = l * h,
  41496. t[4] = f * c - p,
  41497. t[8] = d * c + g,
  41498. t[1] = l * u,
  41499. t[5] = g * c + d,
  41500. t[9] = p * c - f,
  41501. t[2] = -c,
  41502. t[6] = s * l,
  41503. t[10] = a * l
  41504. } else if ("YZX" === e.order) {
  41505. var C = a * l
  41506. , I = a * c
  41507. , E = s * l
  41508. , b = s * c;
  41509. t[0] = l * h,
  41510. t[4] = b - C * u,
  41511. t[8] = E * u + I,
  41512. t[1] = u,
  41513. t[5] = a * h,
  41514. t[9] = -s * h,
  41515. t[2] = -c * h,
  41516. t[6] = I * u + E,
  41517. t[10] = C - b * u
  41518. } else if ("XZY" === e.order) {
  41519. var C = a * l
  41520. , I = a * c
  41521. , E = s * l
  41522. , b = s * c;
  41523. t[0] = l * h,
  41524. t[4] = -u,
  41525. t[8] = c * h,
  41526. t[1] = C * u + b,
  41527. t[5] = a * h,
  41528. t[9] = I * u - E,
  41529. t[2] = E * u - I,
  41530. t[6] = s * h,
  41531. t[10] = b * u + C
  41532. }
  41533. return t[3] = 0,
  41534. t[7] = 0,
  41535. t[11] = 0,
  41536. t[12] = 0,
  41537. t[13] = 0,
  41538. t[14] = 0,
  41539. t[15] = 1,
  41540. this
  41541. },
  41542. makeRotationFromQuaternion: function(e) {
  41543. var t = this.elements
  41544. , i = e.x
  41545. , n = e.y
  41546. , r = e.z
  41547. , o = e.w
  41548. , a = i + i
  41549. , s = n + n
  41550. , l = r + r
  41551. , c = i * a
  41552. , h = i * s
  41553. , u = i * l
  41554. , d = n * s
  41555. , p = n * l
  41556. , f = r * l
  41557. , g = o * a
  41558. , m = o * s
  41559. , v = o * l;
  41560. return t[0] = 1 - (d + f),
  41561. t[4] = h - v,
  41562. t[8] = u + m,
  41563. t[1] = h + v,
  41564. t[5] = 1 - (c + f),
  41565. t[9] = p - g,
  41566. t[2] = u - m,
  41567. t[6] = p + g,
  41568. t[10] = 1 - (c + d),
  41569. t[3] = 0,
  41570. t[7] = 0,
  41571. t[11] = 0,
  41572. t[12] = 0,
  41573. t[13] = 0,
  41574. t[14] = 0,
  41575. t[15] = 1,
  41576. this
  41577. },
  41578. lookAt: function() {
  41579. var e, t, i;
  41580. return function(r, o, a) {
  41581. void 0 === e && (e = new n.Vector3),
  41582. void 0 === t && (t = new n.Vector3),
  41583. void 0 === i && (i = new n.Vector3);
  41584. var s = this.elements;
  41585. return i.subVectors(r, o).normalize(),
  41586. 0 === i.lengthSq() && (i.z = 1),
  41587. e.crossVectors(a, i).normalize(),
  41588. 0 === e.lengthSq() && (i.x += 1e-4,
  41589. e.crossVectors(a, i).normalize()),
  41590. t.crossVectors(i, e),
  41591. s[0] = e.x,
  41592. s[4] = t.x,
  41593. s[8] = i.x,
  41594. s[1] = e.y,
  41595. s[5] = t.y,
  41596. s[9] = i.y,
  41597. s[2] = e.z,
  41598. s[6] = t.z,
  41599. s[10] = i.z,
  41600. this
  41601. }
  41602. }(),
  41603. multiply: function(e, t) {
  41604. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  41605. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  41606. },
  41607. multiplyMatrices: function(e, t) {
  41608. var i = e.elements
  41609. , n = t.elements
  41610. , r = this.elements
  41611. , o = i[0]
  41612. , a = i[4]
  41613. , s = i[8]
  41614. , l = i[12]
  41615. , c = i[1]
  41616. , h = i[5]
  41617. , u = i[9]
  41618. , d = i[13]
  41619. , p = i[2]
  41620. , f = i[6]
  41621. , g = i[10]
  41622. , m = i[14]
  41623. , v = i[3]
  41624. , A = i[7]
  41625. , y = i[11]
  41626. , C = i[15]
  41627. , I = n[0]
  41628. , E = n[4]
  41629. , b = n[8]
  41630. , w = n[12]
  41631. , _ = n[1]
  41632. , T = n[5]
  41633. , x = n[9]
  41634. , S = n[13]
  41635. , M = n[2]
  41636. , R = n[6]
  41637. , P = n[10]
  41638. , O = n[14]
  41639. , L = n[3]
  41640. , D = n[7]
  41641. , N = n[11]
  41642. , B = n[15];
  41643. return r[0] = o * I + a * _ + s * M + l * L,
  41644. r[4] = o * E + a * T + s * R + l * D,
  41645. r[8] = o * b + a * x + s * P + l * N,
  41646. r[12] = o * w + a * S + s * O + l * B,
  41647. r[1] = c * I + h * _ + u * M + d * L,
  41648. r[5] = c * E + h * T + u * R + d * D,
  41649. r[9] = c * b + h * x + u * P + d * N,
  41650. r[13] = c * w + h * S + u * O + d * B,
  41651. r[2] = p * I + f * _ + g * M + m * L,
  41652. r[6] = p * E + f * T + g * R + m * D,
  41653. r[10] = p * b + f * x + g * P + m * N,
  41654. r[14] = p * w + f * S + g * O + m * B,
  41655. r[3] = v * I + A * _ + y * M + C * L,
  41656. r[7] = v * E + A * T + y * R + C * D,
  41657. r[11] = v * b + A * x + y * P + C * N,
  41658. r[15] = v * w + A * S + y * O + C * B,
  41659. this
  41660. },
  41661. multiplyToArray: function(e, t, i) {
  41662. var n = this.elements;
  41663. return this.multiplyMatrices(e, t),
  41664. i[0] = n[0],
  41665. i[1] = n[1],
  41666. i[2] = n[2],
  41667. i[3] = n[3],
  41668. i[4] = n[4],
  41669. i[5] = n[5],
  41670. i[6] = n[6],
  41671. i[7] = n[7],
  41672. i[8] = n[8],
  41673. i[9] = n[9],
  41674. i[10] = n[10],
  41675. i[11] = n[11],
  41676. i[12] = n[12],
  41677. i[13] = n[13],
  41678. i[14] = n[14],
  41679. i[15] = n[15],
  41680. this
  41681. },
  41682. multiplyScalar: function(e) {
  41683. var t = this.elements;
  41684. return t[0] *= e,
  41685. t[4] *= e,
  41686. t[8] *= e,
  41687. t[12] *= e,
  41688. t[1] *= e,
  41689. t[5] *= e,
  41690. t[9] *= e,
  41691. t[13] *= e,
  41692. t[2] *= e,
  41693. t[6] *= e,
  41694. t[10] *= e,
  41695. t[14] *= e,
  41696. t[3] *= e,
  41697. t[7] *= e,
  41698. t[11] *= e,
  41699. t[15] *= e,
  41700. this
  41701. },
  41702. applyToVector3Array: function() {
  41703. var e;
  41704. return function(t, i, r) {
  41705. void 0 === e && (e = new n.Vector3),
  41706. void 0 === i && (i = 0),
  41707. void 0 === r && (r = t.length);
  41708. for (var o = 0, a = i; o < r; o += 3,
  41709. a += 3)
  41710. e.fromArray(t, a),
  41711. e.applyMatrix4(this),
  41712. e.toArray(t, a);
  41713. return t
  41714. }
  41715. }(),
  41716. applyToBuffer: function() {
  41717. var e;
  41718. return function(t, i, r) {
  41719. void 0 === e && (e = new n.Vector3),
  41720. void 0 === i && (i = 0),
  41721. void 0 === r && (r = t.length / t.itemSize);
  41722. for (var o = 0, a = i; o < r; o++,
  41723. a++)
  41724. e.x = t.getX(a),
  41725. e.y = t.getY(a),
  41726. e.z = t.getZ(a),
  41727. e.applyMatrix4(this),
  41728. t.setXYZ(e.x, e.y, e.z);
  41729. return t
  41730. }
  41731. }(),
  41732. determinant: function() {
  41733. var e = this.elements
  41734. , t = e[0]
  41735. , i = e[4]
  41736. , n = e[8]
  41737. , r = e[12]
  41738. , o = e[1]
  41739. , a = e[5]
  41740. , s = e[9]
  41741. , l = e[13]
  41742. , c = e[2]
  41743. , h = e[6]
  41744. , u = e[10]
  41745. , d = e[14]
  41746. , p = e[3]
  41747. , f = e[7]
  41748. , g = e[11]
  41749. , m = e[15];
  41750. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  41751. },
  41752. transpose: function() {
  41753. var e, t = this.elements;
  41754. return e = t[1],
  41755. t[1] = t[4],
  41756. t[4] = e,
  41757. e = t[2],
  41758. t[2] = t[8],
  41759. t[8] = e,
  41760. e = t[6],
  41761. t[6] = t[9],
  41762. t[9] = e,
  41763. e = t[3],
  41764. t[3] = t[12],
  41765. t[12] = e,
  41766. e = t[7],
  41767. t[7] = t[13],
  41768. t[13] = e,
  41769. e = t[11],
  41770. t[11] = t[14],
  41771. t[14] = e,
  41772. this
  41773. },
  41774. flattenToArrayOffset: function(e, t) {
  41775. var i = this.elements;
  41776. return e[t] = i[0],
  41777. e[t + 1] = i[1],
  41778. e[t + 2] = i[2],
  41779. e[t + 3] = i[3],
  41780. e[t + 4] = i[4],
  41781. e[t + 5] = i[5],
  41782. e[t + 6] = i[6],
  41783. e[t + 7] = i[7],
  41784. e[t + 8] = i[8],
  41785. e[t + 9] = i[9],
  41786. e[t + 10] = i[10],
  41787. e[t + 11] = i[11],
  41788. e[t + 12] = i[12],
  41789. e[t + 13] = i[13],
  41790. e[t + 14] = i[14],
  41791. e[t + 15] = i[15],
  41792. e
  41793. },
  41794. getPosition: function() {
  41795. var e;
  41796. return function() {
  41797. return void 0 === e && (e = new n.Vector3),
  41798. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  41799. e.setFromMatrixColumn(this, 3)
  41800. }
  41801. }(),
  41802. setPosition: function(e) {
  41803. var t = this.elements;
  41804. return t[12] = e.x,
  41805. t[13] = e.y,
  41806. t[14] = e.z,
  41807. this
  41808. },
  41809. getInverse: function(e, t) {
  41810. var i = this.elements
  41811. , n = e.elements
  41812. , r = n[0]
  41813. , o = n[1]
  41814. , a = n[2]
  41815. , s = n[3]
  41816. , l = n[4]
  41817. , c = n[5]
  41818. , h = n[6]
  41819. , u = n[7]
  41820. , d = n[8]
  41821. , p = n[9]
  41822. , f = n[10]
  41823. , g = n[11]
  41824. , m = n[12]
  41825. , v = n[13]
  41826. , A = n[14]
  41827. , y = n[15]
  41828. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  41829. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  41830. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  41831. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  41832. , w = r * C + o * I + a * E + s * b;
  41833. if (0 === w) {
  41834. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  41835. if (t)
  41836. throw new Error(_);
  41837. return console.warn(_),
  41838. this.identity()
  41839. }
  41840. return i[0] = C,
  41841. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  41842. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  41843. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  41844. i[4] = I,
  41845. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  41846. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  41847. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  41848. i[8] = E,
  41849. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  41850. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  41851. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  41852. i[12] = b,
  41853. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  41854. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  41855. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  41856. this.multiplyScalar(1 / w)
  41857. },
  41858. scale: function(e) {
  41859. var t = this.elements
  41860. , i = e.x
  41861. , n = e.y
  41862. , r = e.z;
  41863. return t[0] *= i,
  41864. t[4] *= n,
  41865. t[8] *= r,
  41866. t[1] *= i,
  41867. t[5] *= n,
  41868. t[9] *= r,
  41869. t[2] *= i,
  41870. t[6] *= n,
  41871. t[10] *= r,
  41872. t[3] *= i,
  41873. t[7] *= n,
  41874. t[11] *= r,
  41875. this
  41876. },
  41877. getMaxScaleOnAxis: function() {
  41878. var e = this.elements
  41879. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  41880. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  41881. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  41882. return Math.sqrt(Math.max(t, i, n))
  41883. },
  41884. makeTranslation: function(e, t, i) {
  41885. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  41886. this
  41887. },
  41888. makeRotationX: function(e) {
  41889. var t = Math.cos(e)
  41890. , i = Math.sin(e);
  41891. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  41892. this
  41893. },
  41894. makeRotationY: function(e) {
  41895. var t = Math.cos(e)
  41896. , i = Math.sin(e);
  41897. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  41898. this
  41899. },
  41900. makeRotationZ: function(e) {
  41901. var t = Math.cos(e)
  41902. , i = Math.sin(e);
  41903. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41904. this
  41905. },
  41906. makeRotationAxis: function(e, t) {
  41907. var i = Math.cos(t)
  41908. , n = Math.sin(t)
  41909. , r = 1 - i
  41910. , o = e.x
  41911. , a = e.y
  41912. , s = e.z
  41913. , l = r * o
  41914. , c = r * a;
  41915. 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),
  41916. this
  41917. },
  41918. makeScale: function(e, t, i) {
  41919. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  41920. this
  41921. },
  41922. compose: function(e, t, i) {
  41923. return this.makeRotationFromQuaternion(t),
  41924. this.scale(i),
  41925. this.setPosition(e),
  41926. this
  41927. },
  41928. decompose: function() {
  41929. var e, t;
  41930. return function(i, r, o) {
  41931. void 0 === e && (e = new n.Vector3),
  41932. void 0 === t && (t = new n.Matrix4);
  41933. var a = this.elements
  41934. , s = e.set(a[0], a[1], a[2]).length()
  41935. , l = e.set(a[4], a[5], a[6]).length()
  41936. , c = e.set(a[8], a[9], a[10]).length()
  41937. , h = this.determinant();
  41938. h < 0 && (s = -s),
  41939. i.x = a[12],
  41940. i.y = a[13],
  41941. i.z = a[14],
  41942. t.elements.set(this.elements);
  41943. var u = 1 / s
  41944. , d = 1 / l
  41945. , p = 1 / c;
  41946. return t.elements[0] *= u,
  41947. t.elements[1] *= u,
  41948. t.elements[2] *= u,
  41949. t.elements[4] *= d,
  41950. t.elements[5] *= d,
  41951. t.elements[6] *= d,
  41952. t.elements[8] *= p,
  41953. t.elements[9] *= p,
  41954. t.elements[10] *= p,
  41955. r.setFromRotationMatrix(t),
  41956. o.x = s,
  41957. o.y = l,
  41958. o.z = c,
  41959. this
  41960. }
  41961. }(),
  41962. makeFrustum: function(e, t, i, n, r, o) {
  41963. var a = this.elements
  41964. , s = 2 * r / (t - e)
  41965. , l = 2 * r / (n - i)
  41966. , c = (t + e) / (t - e)
  41967. , h = (n + i) / (n - i)
  41968. , u = -(o + r) / (o - r)
  41969. , d = -2 * o * r / (o - r);
  41970. return a[0] = s,
  41971. a[4] = 0,
  41972. a[8] = c,
  41973. a[12] = 0,
  41974. a[1] = 0,
  41975. a[5] = l,
  41976. a[9] = h,
  41977. a[13] = 0,
  41978. a[2] = 0,
  41979. a[6] = 0,
  41980. a[10] = u,
  41981. a[14] = d,
  41982. a[3] = 0,
  41983. a[7] = 0,
  41984. a[11] = -1,
  41985. a[15] = 0,
  41986. this
  41987. },
  41988. makePerspective: function(e, t, i, r) {
  41989. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  41990. , a = -o
  41991. , s = a * t
  41992. , l = o * t;
  41993. return this.makeFrustum(s, l, a, o, i, r)
  41994. },
  41995. makeOrthographic: function(e, t, i, n, r, o) {
  41996. var a = this.elements
  41997. , s = 1 / (t - e)
  41998. , l = 1 / (i - n)
  41999. , c = 1 / (o - r)
  42000. , h = (t + e) * s
  42001. , u = (i + n) * l
  42002. , d = (o + r) * c;
  42003. return a[0] = 2 * s,
  42004. a[4] = 0,
  42005. a[8] = 0,
  42006. a[12] = -h,
  42007. a[1] = 0,
  42008. a[5] = 2 * l,
  42009. a[9] = 0,
  42010. a[13] = -u,
  42011. a[2] = 0,
  42012. a[6] = 0,
  42013. a[10] = -2 * c,
  42014. a[14] = -d,
  42015. a[3] = 0,
  42016. a[7] = 0,
  42017. a[11] = 0,
  42018. a[15] = 1,
  42019. this
  42020. },
  42021. equals: function(e) {
  42022. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42023. if (t[n] !== i[n])
  42024. return !1;
  42025. return !0
  42026. },
  42027. fromArray: function(e) {
  42028. return this.elements.set(e),
  42029. this
  42030. },
  42031. toArray: function() {
  42032. var e = this.elements;
  42033. 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]]
  42034. }
  42035. },
  42036. n.Ray = function(e, t) {
  42037. this.origin = void 0 !== e ? e : new n.Vector3,
  42038. this.direction = void 0 !== t ? t : new n.Vector3
  42039. }
  42040. ,
  42041. n.Ray.prototype = {
  42042. constructor: n.Ray,
  42043. set: function(e, t) {
  42044. return this.origin.copy(e),
  42045. this.direction.copy(t),
  42046. this
  42047. },
  42048. clone: function() {
  42049. return (new this.constructor).copy(this)
  42050. },
  42051. copy: function(e) {
  42052. return this.origin.copy(e.origin),
  42053. this.direction.copy(e.direction),
  42054. this
  42055. },
  42056. at: function(e, t) {
  42057. var i = t || new n.Vector3;
  42058. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42059. },
  42060. lookAt: function(e) {
  42061. this.direction.copy(e).sub(this.origin).normalize()
  42062. },
  42063. recast: function() {
  42064. var e = new n.Vector3;
  42065. return function(t) {
  42066. return this.origin.copy(this.at(t, e)),
  42067. this
  42068. }
  42069. }(),
  42070. closestPointToPoint: function(e, t) {
  42071. var i = t || new n.Vector3;
  42072. i.subVectors(e, this.origin);
  42073. var r = i.dot(this.direction);
  42074. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42075. },
  42076. distanceToPoint: function(e) {
  42077. return Math.sqrt(this.distanceSqToPoint(e))
  42078. },
  42079. distanceSqToPoint: function() {
  42080. var e = new n.Vector3;
  42081. return function(t) {
  42082. var i = e.subVectors(t, this.origin).dot(this.direction);
  42083. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42084. e.distanceToSquared(t))
  42085. }
  42086. }(),
  42087. distanceSqToSegment: function() {
  42088. var e = new n.Vector3
  42089. , t = new n.Vector3
  42090. , i = new n.Vector3;
  42091. return function(n, r, o, a) {
  42092. e.copy(n).add(r).multiplyScalar(.5),
  42093. t.copy(r).sub(n).normalize(),
  42094. i.copy(this.origin).sub(e);
  42095. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  42096. if (m > 0)
  42097. if (s = d * f - p,
  42098. l = d * p - f,
  42099. h = u * m,
  42100. s >= 0)
  42101. if (l >= -h)
  42102. if (l <= h) {
  42103. var v = 1 / m;
  42104. s *= v,
  42105. l *= v,
  42106. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42107. } else
  42108. l = u,
  42109. s = Math.max(0, -(d * l + p)),
  42110. c = -s * s + l * (l + 2 * f) + g;
  42111. else
  42112. l = -u,
  42113. s = Math.max(0, -(d * l + p)),
  42114. c = -s * s + l * (l + 2 * f) + g;
  42115. else
  42116. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42117. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42118. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42119. l = Math.min(Math.max(-u, -f), u),
  42120. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42121. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42122. c = -s * s + l * (l + 2 * f) + g);
  42123. else
  42124. l = d > 0 ? -u : u,
  42125. s = Math.max(0, -(d * l + p)),
  42126. c = -s * s + l * (l + 2 * f) + g;
  42127. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42128. a && a.copy(t).multiplyScalar(l).add(e),
  42129. c
  42130. }
  42131. }(),
  42132. intersectSphere: function() {
  42133. var e = new n.Vector3;
  42134. return function(t, i) {
  42135. e.subVectors(t.center, this.origin);
  42136. var n = e.dot(this.direction)
  42137. , r = e.dot(e) - n * n
  42138. , o = t.radius * t.radius;
  42139. if (r > o)
  42140. return null;
  42141. var a = Math.sqrt(o - r)
  42142. , s = n - a
  42143. , l = n + a;
  42144. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42145. }
  42146. }(),
  42147. intersectsSphere: function(e) {
  42148. return this.distanceToPoint(e.center) <= e.radius
  42149. },
  42150. distanceToPlane: function(e) {
  42151. var t = e.normal.dot(this.direction);
  42152. if (0 === t)
  42153. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42154. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42155. return i >= 0 ? i : null
  42156. },
  42157. intersectPlane: function(e, t) {
  42158. var i = this.distanceToPlane(e);
  42159. return null === i ? null : this.at(i, t)
  42160. },
  42161. intersectsPlane: function(e) {
  42162. var t = e.distanceToPoint(this.origin);
  42163. if (0 === t)
  42164. return !0;
  42165. var i = e.normal.dot(this.direction);
  42166. return i * t < 0
  42167. },
  42168. intersectBox: function(e, t) {
  42169. 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;
  42170. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42171. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42172. n = (e.min.x - u.x) * l),
  42173. c >= 0 ? (r = (e.min.y - u.y) * c,
  42174. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42175. o = (e.min.y - u.y) * c),
  42176. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42177. (o < n || n !== n) && (n = o),
  42178. h >= 0 ? (a = (e.min.z - u.z) * h,
  42179. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42180. s = (e.min.z - u.z) * h),
  42181. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42182. (s < n || n !== n) && (n = s),
  42183. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42184. },
  42185. intersectsBox: function() {
  42186. var e = new n.Vector3;
  42187. return function(t) {
  42188. return null !== this.intersectBox(t, e)
  42189. }
  42190. }(),
  42191. intersectTriangle: function() {
  42192. var e = new n.Vector3
  42193. , t = new n.Vector3
  42194. , i = new n.Vector3
  42195. , r = new n.Vector3;
  42196. return function(n, o, a, s, l) {
  42197. t.subVectors(o, n),
  42198. i.subVectors(a, n),
  42199. r.crossVectors(t, i);
  42200. var c, h = this.direction.dot(r);
  42201. if (h > 0) {
  42202. if (s)
  42203. return null;
  42204. c = 1
  42205. } else {
  42206. if (!(h < 0))
  42207. return null;
  42208. c = -1,
  42209. h = -h
  42210. }
  42211. e.subVectors(this.origin, n);
  42212. var u = c * this.direction.dot(i.crossVectors(e, i));
  42213. if (u < 0)
  42214. return null;
  42215. var d = c * this.direction.dot(t.cross(e));
  42216. if (d < 0)
  42217. return null;
  42218. if (u + d > h)
  42219. return null;
  42220. var p = -c * e.dot(r);
  42221. return p < 0 ? null : this.at(p / h, l)
  42222. }
  42223. }(),
  42224. applyMatrix4: function(e) {
  42225. return this.direction.add(this.origin).applyMatrix4(e),
  42226. this.origin.applyMatrix4(e),
  42227. this.direction.sub(this.origin),
  42228. this.direction.normalize(),
  42229. this
  42230. },
  42231. equals: function(e) {
  42232. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42233. }
  42234. },
  42235. n.Sphere = function(e, t) {
  42236. this.center = void 0 !== e ? e : new n.Vector3,
  42237. this.radius = void 0 !== t ? t : 0
  42238. }
  42239. ,
  42240. n.Sphere.prototype = {
  42241. constructor: n.Sphere,
  42242. set: function(e, t) {
  42243. return this.center.copy(e),
  42244. this.radius = t,
  42245. this
  42246. },
  42247. setFromPoints: function() {
  42248. var e = new n.Box3;
  42249. return function(t, i) {
  42250. var n = this.center;
  42251. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42252. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42253. r = Math.max(r, n.distanceToSquared(t[o]));
  42254. return this.radius = Math.sqrt(r),
  42255. this
  42256. }
  42257. }(),
  42258. clone: function() {
  42259. return (new this.constructor).copy(this)
  42260. },
  42261. copy: function(e) {
  42262. return this.center.copy(e.center),
  42263. this.radius = e.radius,
  42264. this
  42265. },
  42266. empty: function() {
  42267. return this.radius <= 0
  42268. },
  42269. containsPoint: function(e) {
  42270. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42271. },
  42272. distanceToPoint: function(e) {
  42273. return e.distanceTo(this.center) - this.radius
  42274. },
  42275. intersectsSphere: function(e) {
  42276. var t = this.radius + e.radius;
  42277. return e.center.distanceToSquared(this.center) <= t * t
  42278. },
  42279. intersectsBox: function(e) {
  42280. return e.intersectsSphere(this)
  42281. },
  42282. intersectsPlane: function(e) {
  42283. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42284. },
  42285. clampPoint: function(e, t) {
  42286. var i = this.center.distanceToSquared(e)
  42287. , r = t || new n.Vector3;
  42288. return r.copy(e),
  42289. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42290. r.multiplyScalar(this.radius).add(this.center)),
  42291. r
  42292. },
  42293. getBoundingBox: function(e) {
  42294. var t = e || new n.Box3;
  42295. return t.set(this.center, this.center),
  42296. t.expandByScalar(this.radius),
  42297. t
  42298. },
  42299. applyMatrix4: function(e) {
  42300. return this.center.applyMatrix4(e),
  42301. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42302. this
  42303. },
  42304. translate: function(e) {
  42305. return this.center.add(e),
  42306. this
  42307. },
  42308. equals: function(e) {
  42309. return e.center.equals(this.center) && e.radius === this.radius
  42310. }
  42311. },
  42312. n.Frustum = function(e, t, i, r, o, a) {
  42313. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  42314. }
  42315. ,
  42316. n.Frustum.prototype = {
  42317. constructor: n.Frustum,
  42318. set: function(e, t, i, n, r, o) {
  42319. var a = this.planes;
  42320. return a[0].copy(e),
  42321. a[1].copy(t),
  42322. a[2].copy(i),
  42323. a[3].copy(n),
  42324. a[4].copy(r),
  42325. a[5].copy(o),
  42326. this
  42327. },
  42328. clone: function() {
  42329. return (new this.constructor).copy(this)
  42330. },
  42331. copy: function(e) {
  42332. for (var t = this.planes, i = 0; i < 6; i++)
  42333. t[i].copy(e.planes[i]);
  42334. return this
  42335. },
  42336. setFromMatrix: function(e) {
  42337. var t = this.planes
  42338. , i = e.elements
  42339. , n = i[0]
  42340. , r = i[1]
  42341. , o = i[2]
  42342. , a = i[3]
  42343. , s = i[4]
  42344. , l = i[5]
  42345. , c = i[6]
  42346. , h = i[7]
  42347. , u = i[8]
  42348. , d = i[9]
  42349. , p = i[10]
  42350. , f = i[11]
  42351. , g = i[12]
  42352. , m = i[13]
  42353. , v = i[14]
  42354. , A = i[15];
  42355. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42356. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42357. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42358. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42359. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42360. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42361. this
  42362. },
  42363. intersectsObject: function() {
  42364. var e = new n.Sphere;
  42365. return function(t) {
  42366. var i = t.geometry;
  42367. return null === i.boundingSphere && i.computeBoundingSphere(),
  42368. e.copy(i.boundingSphere),
  42369. e.applyMatrix4(t.matrixWorld),
  42370. this.intersectsSphere(e)
  42371. }
  42372. }(),
  42373. intersectsSphere: function(e) {
  42374. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42375. var o = t[r].distanceToPoint(i);
  42376. if (o < n)
  42377. return !1
  42378. }
  42379. return !0
  42380. },
  42381. intersectsBox: function() {
  42382. var e = new n.Vector3
  42383. , t = new n.Vector3;
  42384. return function(i) {
  42385. for (var n = this.planes, r = 0; r < 6; r++) {
  42386. var o = n[r];
  42387. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42388. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42389. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42390. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42391. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42392. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42393. var a = o.distanceToPoint(e)
  42394. , s = o.distanceToPoint(t);
  42395. if (a < 0 && s < 0)
  42396. return !1
  42397. }
  42398. return !0
  42399. }
  42400. }(),
  42401. containsPoint: function(e) {
  42402. for (var t = this.planes, i = 0; i < 6; i++)
  42403. if (t[i].distanceToPoint(e) < 0)
  42404. return !1;
  42405. return !0
  42406. }
  42407. },
  42408. n.Plane = function(e, t) {
  42409. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42410. this.constant = void 0 !== t ? t : 0
  42411. }
  42412. ,
  42413. n.Plane.prototype = {
  42414. constructor: n.Plane,
  42415. set: function(e, t) {
  42416. return this.normal.copy(e),
  42417. this.constant = t,
  42418. this
  42419. },
  42420. setComponents: function(e, t, i, n) {
  42421. return this.normal.set(e, t, i),
  42422. this.constant = n,
  42423. this
  42424. },
  42425. setFromNormalAndCoplanarPoint: function(e, t) {
  42426. return this.normal.copy(e),
  42427. this.constant = -t.dot(this.normal),
  42428. this
  42429. },
  42430. setFromCoplanarPoints: function() {
  42431. var e = new n.Vector3
  42432. , t = new n.Vector3;
  42433. return function(i, n, r) {
  42434. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42435. return this.setFromNormalAndCoplanarPoint(o, i),
  42436. this
  42437. }
  42438. }(),
  42439. clone: function() {
  42440. return (new this.constructor).copy(this)
  42441. },
  42442. copy: function(e) {
  42443. return this.normal.copy(e.normal),
  42444. this.constant = e.constant,
  42445. this
  42446. },
  42447. normalize: function() {
  42448. var e = 1 / this.normal.length();
  42449. return this.normal.multiplyScalar(e),
  42450. this.constant *= e,
  42451. this
  42452. },
  42453. negate: function() {
  42454. return this.constant *= -1,
  42455. this.normal.negate(),
  42456. this
  42457. },
  42458. distanceToPoint: function(e) {
  42459. return this.normal.dot(e) + this.constant
  42460. },
  42461. distanceToSphere: function(e) {
  42462. return this.distanceToPoint(e.center) - e.radius
  42463. },
  42464. projectPoint: function(e, t) {
  42465. return this.orthoPoint(e, t).sub(e).negate()
  42466. },
  42467. orthoPoint: function(e, t) {
  42468. var i = this.distanceToPoint(e)
  42469. , r = t || new n.Vector3;
  42470. return r.copy(this.normal).multiplyScalar(i)
  42471. },
  42472. intersectLine: function() {
  42473. var e = new n.Vector3;
  42474. return function(t, i) {
  42475. var r = i || new n.Vector3
  42476. , o = t.delta(e)
  42477. , a = this.normal.dot(o);
  42478. if (0 !== a) {
  42479. var s = -(t.start.dot(this.normal) + this.constant) / a;
  42480. if (!(s < 0 || s > 1))
  42481. return r.copy(o).multiplyScalar(s).add(t.start)
  42482. } else if (0 === this.distanceToPoint(t.start))
  42483. return r.copy(t.start)
  42484. }
  42485. }(),
  42486. intersectsLine: function(e) {
  42487. var t = this.distanceToPoint(e.start)
  42488. , i = this.distanceToPoint(e.end);
  42489. return t < 0 && i > 0 || i < 0 && t > 0
  42490. },
  42491. intersectsBox: function(e) {
  42492. return e.intersectsPlane(this)
  42493. },
  42494. intersectsSphere: function(e) {
  42495. return e.intersectsPlane(this)
  42496. },
  42497. coplanarPoint: function(e) {
  42498. var t = e || new n.Vector3;
  42499. return t.copy(this.normal).multiplyScalar(-this.constant)
  42500. },
  42501. applyMatrix4: function() {
  42502. var e = new n.Vector3
  42503. , t = new n.Vector3
  42504. , i = new n.Matrix3;
  42505. return function(n, r) {
  42506. var o = r || i.getNormalMatrix(n)
  42507. , a = e.copy(this.normal).applyMatrix3(o)
  42508. , s = this.coplanarPoint(t);
  42509. return s.applyMatrix4(n),
  42510. this.setFromNormalAndCoplanarPoint(a, s),
  42511. this
  42512. }
  42513. }(),
  42514. translate: function(e) {
  42515. return this.constant = this.constant - e.dot(this.normal),
  42516. this
  42517. },
  42518. equals: function(e) {
  42519. return e.normal.equals(this.normal) && e.constant === this.constant
  42520. }
  42521. },
  42522. n.Spherical = function(e, t, i) {
  42523. return this.radius = void 0 !== e ? e : 1,
  42524. this.phi = void 0 !== t ? t : 0,
  42525. this.theta = void 0 !== i ? i : 0,
  42526. this
  42527. }
  42528. ,
  42529. n.Spherical.prototype = {
  42530. constructor: n.Spherical,
  42531. set: function(e, t, i) {
  42532. this.radius = e,
  42533. this.phi = t,
  42534. this.theta = i
  42535. },
  42536. clone: function() {
  42537. return (new this.constructor).copy(this)
  42538. },
  42539. copy: function(e) {
  42540. return this.radius.copy(e.radius),
  42541. this.phi.copy(e.phi),
  42542. this.theta.copy(e.theta),
  42543. this
  42544. },
  42545. makeSafe: function() {
  42546. var e = 1e-6;
  42547. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  42548. },
  42549. setFromVector3: function(e) {
  42550. return this.radius = e.length(),
  42551. 0 === this.radius ? (this.theta = 0,
  42552. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  42553. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  42554. this
  42555. }
  42556. },
  42557. n.Math = {
  42558. generateUUID: function() {
  42559. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  42560. return function() {
  42561. for (var r = 0; r < 36; r++)
  42562. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  42563. e = 15 & n,
  42564. n >>= 4,
  42565. i[r] = t[19 === r ? 3 & e | 8 : e]);
  42566. return i.join("")
  42567. }
  42568. }(),
  42569. clamp: function(e, t, i) {
  42570. return Math.max(t, Math.min(i, e))
  42571. },
  42572. euclideanModulo: function(e, t) {
  42573. return (e % t + t) % t
  42574. },
  42575. mapLinear: function(e, t, i, n, r) {
  42576. return n + (e - t) * (r - n) / (i - t)
  42577. },
  42578. smoothstep: function(e, t, i) {
  42579. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42580. e * e * (3 - 2 * e))
  42581. },
  42582. smootherstep: function(e, t, i) {
  42583. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42584. e * e * e * (e * (6 * e - 15) + 10))
  42585. },
  42586. random16: function() {
  42587. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  42588. Math.random()
  42589. },
  42590. randInt: function(e, t) {
  42591. return e + Math.floor(Math.random() * (t - e + 1))
  42592. },
  42593. randFloat: function(e, t) {
  42594. return e + Math.random() * (t - e)
  42595. },
  42596. randFloatSpread: function(e) {
  42597. return e * (.5 - Math.random())
  42598. },
  42599. degToRad: function() {
  42600. var e = Math.PI / 180;
  42601. return function(t) {
  42602. return t * e
  42603. }
  42604. }(),
  42605. radToDeg: function() {
  42606. var e = 180 / Math.PI;
  42607. return function(t) {
  42608. return t * e
  42609. }
  42610. }(),
  42611. isPowerOfTwo: function(e) {
  42612. return 0 === (e & e - 1) && 0 !== e
  42613. },
  42614. nearestPowerOfTwo: function(e) {
  42615. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  42616. },
  42617. nextPowerOfTwo: function(e) {
  42618. return e--,
  42619. e |= e >> 1,
  42620. e |= e >> 2,
  42621. e |= e >> 4,
  42622. e |= e >> 8,
  42623. e |= e >> 16,
  42624. e++,
  42625. e
  42626. }
  42627. },
  42628. n.Spline = function(e) {
  42629. function t(e, t, i, n, r, o, a) {
  42630. var s = .5 * (i - e)
  42631. , l = .5 * (n - t);
  42632. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  42633. }
  42634. this.points = e;
  42635. var i, r, o, a, s, l, c, h, u, d = [], p = {
  42636. x: 0,
  42637. y: 0,
  42638. z: 0
  42639. };
  42640. this.initFromArray = function(e) {
  42641. this.points = [];
  42642. for (var t = 0; t < e.length; t++)
  42643. this.points[t] = {
  42644. x: e[t][0],
  42645. y: e[t][1],
  42646. z: e[t][2]
  42647. }
  42648. }
  42649. ,
  42650. this.getPoint = function(e) {
  42651. return i = (this.points.length - 1) * e,
  42652. r = Math.floor(i),
  42653. o = i - r,
  42654. d[0] = 0 === r ? r : r - 1,
  42655. d[1] = r,
  42656. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  42657. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  42658. l = this.points[d[0]],
  42659. c = this.points[d[1]],
  42660. h = this.points[d[2]],
  42661. u = this.points[d[3]],
  42662. a = o * o,
  42663. s = o * a,
  42664. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  42665. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  42666. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  42667. p
  42668. }
  42669. ,
  42670. this.getControlPointsArray = function() {
  42671. var e, t, i = this.points.length, n = [];
  42672. for (e = 0; e < i; e++)
  42673. t = this.points[e],
  42674. n[e] = [t.x, t.y, t.z];
  42675. return n
  42676. }
  42677. ,
  42678. this.getLength = function(e) {
  42679. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  42680. for (u[0] = 0,
  42681. e || (e = 100),
  42682. r = this.points.length * e,
  42683. c.copy(this.points[0]),
  42684. t = 1; t < r; t++)
  42685. i = t / r,
  42686. o = this.getPoint(i),
  42687. h.copy(o),
  42688. d += h.distanceTo(c),
  42689. c.copy(o),
  42690. a = (this.points.length - 1) * i,
  42691. s = Math.floor(a),
  42692. s !== l && (u[s] = d,
  42693. l = s);
  42694. return u[u.length] = d,
  42695. {
  42696. chunks: u,
  42697. total: d
  42698. }
  42699. }
  42700. ,
  42701. this.reparametrizeByArcLength = function(e) {
  42702. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  42703. for (h.push(u.copy(this.points[0]).clone()),
  42704. t = 1; t < this.points.length; t++) {
  42705. for (s = d.chunks[t] - d.chunks[t - 1],
  42706. l = Math.ceil(e * s / d.total),
  42707. o = (t - 1) / (this.points.length - 1),
  42708. a = t / (this.points.length - 1),
  42709. i = 1; i < l - 1; i++)
  42710. r = o + i * (1 / l) * (a - o),
  42711. c = this.getPoint(r),
  42712. h.push(u.copy(c).clone());
  42713. h.push(u.copy(this.points[t]).clone())
  42714. }
  42715. this.points = h
  42716. }
  42717. }
  42718. ,
  42719. n.Triangle = function(e, t, i) {
  42720. this.a = void 0 !== e ? e : new n.Vector3,
  42721. this.b = void 0 !== t ? t : new n.Vector3,
  42722. this.c = void 0 !== i ? i : new n.Vector3
  42723. }
  42724. ,
  42725. n.Triangle.normal = function() {
  42726. var e = new n.Vector3;
  42727. return function(t, i, r, o) {
  42728. var a = o || new n.Vector3;
  42729. a.subVectors(r, i),
  42730. e.subVectors(t, i),
  42731. a.cross(e);
  42732. var s = a.lengthSq();
  42733. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  42734. }
  42735. }(),
  42736. n.Triangle.barycoordFromPoint = function() {
  42737. var e = new n.Vector3
  42738. , t = new n.Vector3
  42739. , i = new n.Vector3;
  42740. return function(r, o, a, s, l) {
  42741. e.subVectors(s, o),
  42742. t.subVectors(a, o),
  42743. i.subVectors(r, o);
  42744. var c = e.dot(e)
  42745. , h = e.dot(t)
  42746. , u = e.dot(i)
  42747. , d = t.dot(t)
  42748. , p = t.dot(i)
  42749. , f = c * d - h * h
  42750. , g = l || new n.Vector3;
  42751. if (0 === f)
  42752. return g.set(-2, -1, -1);
  42753. var m = 1 / f
  42754. , v = (d * u - h * p) * m
  42755. , A = (c * p - h * u) * m;
  42756. return g.set(1 - v - A, A, v)
  42757. }
  42758. }(),
  42759. n.Triangle.containsPoint = function() {
  42760. var e = new n.Vector3;
  42761. return function(t, i, r, o) {
  42762. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  42763. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  42764. }
  42765. }(),
  42766. n.Triangle.prototype = {
  42767. constructor: n.Triangle,
  42768. set: function(e, t, i) {
  42769. return this.a.copy(e),
  42770. this.b.copy(t),
  42771. this.c.copy(i),
  42772. this
  42773. },
  42774. setFromPointsAndIndices: function(e, t, i, n) {
  42775. return this.a.copy(e[t]),
  42776. this.b.copy(e[i]),
  42777. this.c.copy(e[n]),
  42778. this
  42779. },
  42780. clone: function() {
  42781. return (new this.constructor).copy(this)
  42782. },
  42783. copy: function(e) {
  42784. return this.a.copy(e.a),
  42785. this.b.copy(e.b),
  42786. this.c.copy(e.c),
  42787. this
  42788. },
  42789. area: function() {
  42790. var e = new n.Vector3
  42791. , t = new n.Vector3;
  42792. return function() {
  42793. return e.subVectors(this.c, this.b),
  42794. t.subVectors(this.a, this.b),
  42795. .5 * e.cross(t).length()
  42796. }
  42797. }(),
  42798. midpoint: function(e) {
  42799. var t = e || new n.Vector3;
  42800. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  42801. },
  42802. normal: function(e) {
  42803. return n.Triangle.normal(this.a, this.b, this.c, e)
  42804. },
  42805. plane: function(e) {
  42806. var t = e || new n.Plane;
  42807. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  42808. },
  42809. barycoordFromPoint: function(e, t) {
  42810. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  42811. },
  42812. containsPoint: function(e) {
  42813. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  42814. },
  42815. equals: function(e) {
  42816. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  42817. }
  42818. },
  42819. n.Interpolant = function(e, t, i, n) {
  42820. this.parameterPositions = e,
  42821. this._cachedIndex = 0,
  42822. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  42823. this.sampleValues = t,
  42824. this.valueSize = i
  42825. }
  42826. ,
  42827. n.Interpolant.prototype = {
  42828. constructor: n.Interpolant,
  42829. evaluate: function(e) {
  42830. var t = this.parameterPositions
  42831. , i = this._cachedIndex
  42832. , n = t[i]
  42833. , r = t[i - 1];
  42834. e: {
  42835. t: {
  42836. var o;
  42837. i: {
  42838. n: if (!(e < n)) {
  42839. for (var a = i + 2; ; ) {
  42840. if (void 0 === n) {
  42841. if (e < r)
  42842. break n;
  42843. return i = t.length,
  42844. this._cachedIndex = i,
  42845. this.afterEnd_(i - 1, e, r)
  42846. }
  42847. if (i === a)
  42848. break;
  42849. if (r = n,
  42850. n = t[++i],
  42851. e < n)
  42852. break t
  42853. }
  42854. o = t.length;
  42855. break i
  42856. }
  42857. {
  42858. if (e >= r)
  42859. break e;
  42860. var s = t[1];
  42861. e < s && (i = 2,
  42862. r = s);
  42863. for (var a = i - 2; ; ) {
  42864. if (void 0 === r)
  42865. return this._cachedIndex = 0,
  42866. this.beforeStart_(0, e, n);
  42867. if (i === a)
  42868. break;
  42869. if (n = r,
  42870. r = t[--i - 1],
  42871. e >= r)
  42872. break t
  42873. }
  42874. o = i,
  42875. i = 0
  42876. }
  42877. }
  42878. for (; i < o; ) {
  42879. var l = i + o >>> 1;
  42880. e < t[l] ? o = l : i = l + 1
  42881. }
  42882. if (n = t[i],
  42883. r = t[i - 1],
  42884. void 0 === r)
  42885. return this._cachedIndex = 0,
  42886. this.beforeStart_(0, e, n);
  42887. if (void 0 === n)
  42888. return i = t.length,
  42889. this._cachedIndex = i,
  42890. this.afterEnd_(i - 1, r, e)
  42891. }
  42892. this._cachedIndex = i,
  42893. this.intervalChanged_(i, r, n)
  42894. }
  42895. return this.interpolate_(i, r, e, n)
  42896. },
  42897. settings: null,
  42898. DefaultSettings_: {},
  42899. getSettings_: function() {
  42900. return this.settings || this.DefaultSettings_
  42901. },
  42902. copySampleValue_: function(e) {
  42903. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  42904. t[o] = i[r + o];
  42905. return t
  42906. },
  42907. interpolate_: function(e, t, i, n) {
  42908. throw new Error("call to abstract method")
  42909. },
  42910. intervalChanged_: function(e, t, i) {}
  42911. },
  42912. Object.assign(n.Interpolant.prototype, {
  42913. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  42914. afterEnd_: n.Interpolant.prototype.copySampleValue_
  42915. }),
  42916. n.CubicInterpolant = function(e, t, i, r) {
  42917. n.Interpolant.call(this, e, t, i, r),
  42918. this._weightPrev = -0,
  42919. this._offsetPrev = -0,
  42920. this._weightNext = -0,
  42921. this._offsetNext = -0
  42922. }
  42923. ,
  42924. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42925. constructor: n.CubicInterpolant,
  42926. DefaultSettings_: {
  42927. endingStart: n.ZeroCurvatureEnding,
  42928. endingEnd: n.ZeroCurvatureEnding
  42929. },
  42930. intervalChanged_: function(e, t, i) {
  42931. var r = this.parameterPositions
  42932. , o = e - 2
  42933. , a = e + 1
  42934. , s = r[o]
  42935. , l = r[a];
  42936. if (void 0 === s)
  42937. switch (this.getSettings_().endingStart) {
  42938. case n.ZeroSlopeEnding:
  42939. o = e,
  42940. s = 2 * t - i;
  42941. break;
  42942. case n.WrapAroundEnding:
  42943. o = r.length - 2,
  42944. s = t + r[o] - r[o + 1];
  42945. break;
  42946. default:
  42947. o = e,
  42948. s = i
  42949. }
  42950. if (void 0 === l)
  42951. switch (this.getSettings_().endingEnd) {
  42952. case n.ZeroSlopeEnding:
  42953. a = e,
  42954. l = 2 * i - t;
  42955. break;
  42956. case n.WrapAroundEnding:
  42957. a = 1,
  42958. l = i + r[1] - r[0];
  42959. break;
  42960. default:
  42961. a = e - 1,
  42962. l = t
  42963. }
  42964. var c = .5 * (i - t)
  42965. , h = this.valueSize;
  42966. this._weightPrev = c / (t - s),
  42967. this._weightNext = c / (l - i),
  42968. this._offsetPrev = o * h,
  42969. this._offsetNext = a * h
  42970. },
  42971. interpolate_: function(e, t, i, n) {
  42972. 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, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  42973. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  42974. return r
  42975. }
  42976. }),
  42977. n.DiscreteInterpolant = function(e, t, i, r) {
  42978. n.Interpolant.call(this, e, t, i, r)
  42979. }
  42980. ,
  42981. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42982. constructor: n.DiscreteInterpolant,
  42983. interpolate_: function(e, t, i, n) {
  42984. return this.copySampleValue_(e - 1)
  42985. }
  42986. }),
  42987. n.LinearInterpolant = function(e, t, i, r) {
  42988. n.Interpolant.call(this, e, t, i, r)
  42989. }
  42990. ,
  42991. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42992. constructor: n.LinearInterpolant,
  42993. interpolate_: function(e, t, i, n) {
  42994. 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)
  42995. r[u] = o[l + u] * h + o[s + u] * c;
  42996. return r
  42997. }
  42998. }),
  42999. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43000. n.Interpolant.call(this, e, t, i, r)
  43001. }
  43002. ,
  43003. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43004. constructor: n.QuaternionLinearInterpolant,
  43005. interpolate_: function(e, t, i, r) {
  43006. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  43007. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43008. return o
  43009. }
  43010. }),
  43011. n.Clock = function(e) {
  43012. this.autoStart = void 0 === e || e,
  43013. this.startTime = 0,
  43014. this.oldTime = 0,
  43015. this.elapsedTime = 0,
  43016. this.running = !1
  43017. }
  43018. ,
  43019. n.Clock.prototype = {
  43020. constructor: n.Clock,
  43021. start: function() {
  43022. this.startTime = performance.now(),
  43023. this.oldTime = this.startTime,
  43024. this.running = !0
  43025. },
  43026. stop: function() {
  43027. this.getElapsedTime(),
  43028. this.running = !1
  43029. },
  43030. getElapsedTime: function() {
  43031. return this.getDelta(),
  43032. this.elapsedTime
  43033. },
  43034. getDelta: function() {
  43035. var e = 0;
  43036. if (this.autoStart && !this.running && this.start(),
  43037. this.running) {
  43038. var t = performance.now();
  43039. e = .001 * (t - this.oldTime),
  43040. this.oldTime = t,
  43041. this.elapsedTime += e
  43042. }
  43043. return e
  43044. }
  43045. },
  43046. n.EventDispatcher = function() {}
  43047. ,
  43048. n.EventDispatcher.prototype = {
  43049. constructor: n.EventDispatcher,
  43050. apply: function(e) {
  43051. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43052. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43053. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43054. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43055. },
  43056. addEventListener: function(e, t) {
  43057. void 0 === this._listeners && (this._listeners = {});
  43058. var i = this._listeners;
  43059. void 0 === i[e] && (i[e] = []),
  43060. i[e].indexOf(t) === -1 && i[e].push(t)
  43061. },
  43062. hasEventListener: function(e, t) {
  43063. if (void 0 === this._listeners)
  43064. return !1;
  43065. var i = this._listeners;
  43066. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43067. },
  43068. removeEventListener: function(e, t) {
  43069. if (void 0 !== this._listeners) {
  43070. var i = this._listeners
  43071. , n = i[e];
  43072. if (void 0 !== n) {
  43073. var r = n.indexOf(t);
  43074. r !== -1 && n.splice(r, 1)
  43075. }
  43076. }
  43077. },
  43078. dispatchEvent: function(e) {
  43079. if (void 0 !== this._listeners) {
  43080. var t = this._listeners
  43081. , i = t[e.type];
  43082. if (void 0 !== i) {
  43083. e.target = this;
  43084. for (var n = [], r = i.length, o = 0; o < r; o++)
  43085. n[o] = i[o];
  43086. for (var o = 0; o < r; o++)
  43087. n[o].call(this, e)
  43088. }
  43089. }
  43090. }
  43091. },
  43092. n.Layers = function() {
  43093. this.mask = 1
  43094. }
  43095. ,
  43096. n.Layers.prototype = {
  43097. constructor: n.Layers,
  43098. set: function(e) {
  43099. this.mask = 1 << e
  43100. },
  43101. enable: function(e) {
  43102. this.mask |= 1 << e
  43103. },
  43104. toggle: function(e) {
  43105. this.mask ^= 1 << e
  43106. },
  43107. disable: function(e) {
  43108. this.mask &= ~(1 << e)
  43109. },
  43110. test: function(e) {
  43111. return 0 !== (this.mask & e.mask)
  43112. }
  43113. },
  43114. function(e) {
  43115. function t(e, t) {
  43116. return e.distance - t.distance
  43117. }
  43118. function i(e, t, n, r) {
  43119. if (e.visible !== !1 && (e.raycast(t, n),
  43120. r === !0))
  43121. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43122. i(o[a], t, n, !0)
  43123. }
  43124. e.Raycaster = function(t, i, n, r) {
  43125. this.ray = new e.Ray(t,i),
  43126. this.near = n || 0,
  43127. this.far = r || 1 / 0,
  43128. this.params = {
  43129. Mesh: {},
  43130. Line: {},
  43131. LOD: {},
  43132. Points: {
  43133. threshold: 1
  43134. },
  43135. Sprite: {}
  43136. },
  43137. Object.defineProperties(this.params, {
  43138. PointCloud: {
  43139. get: function() {
  43140. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43141. this.Points
  43142. }
  43143. }
  43144. })
  43145. }
  43146. ,
  43147. e.Raycaster.prototype = {
  43148. constructor: e.Raycaster,
  43149. linePrecision: 1,
  43150. set: function(e, t) {
  43151. this.ray.set(e, t)
  43152. },
  43153. setFromCamera: function(t, i) {
  43154. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43155. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  43156. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43157. },
  43158. intersectObject: function(e, n) {
  43159. var r = [];
  43160. return i(e, this, r, n),
  43161. r.sort(t),
  43162. r
  43163. },
  43164. intersectObjects: function(e, n) {
  43165. var r = [];
  43166. if (Array.isArray(e) === !1)
  43167. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43168. r;
  43169. for (var o = 0, a = e.length; o < a; o++)
  43170. i(e[o], this, r, n);
  43171. return r.sort(t),
  43172. r
  43173. }
  43174. }
  43175. }(n),
  43176. n.Object3D = function() {
  43177. function e() {
  43178. o.setFromEuler(r, !1)
  43179. }
  43180. function t() {
  43181. r.setFromQuaternion(o, void 0, !1)
  43182. }
  43183. Object.defineProperty(this, "id", {
  43184. value: n.Object3DIdCount++
  43185. }),
  43186. this.uuid = n.Math.generateUUID(),
  43187. this.name = "",
  43188. this.type = "Object3D",
  43189. this.parent = null,
  43190. this.children = [],
  43191. this.up = n.Object3D.DefaultUp.clone();
  43192. var i = new n.Vector3
  43193. , r = new n.Euler
  43194. , o = new n.Quaternion
  43195. , a = new n.Vector3(1,1,1);
  43196. r.onChange(e),
  43197. o.onChange(t),
  43198. Object.defineProperties(this, {
  43199. position: {
  43200. enumerable: !0,
  43201. value: i
  43202. },
  43203. rotation: {
  43204. enumerable: !0,
  43205. value: r
  43206. },
  43207. quaternion: {
  43208. enumerable: !0,
  43209. value: o
  43210. },
  43211. scale: {
  43212. enumerable: !0,
  43213. value: a
  43214. },
  43215. modelViewMatrix: {
  43216. value: new n.Matrix4
  43217. },
  43218. normalMatrix: {
  43219. value: new n.Matrix3
  43220. }
  43221. }),
  43222. this.rotationAutoUpdate = !0,
  43223. this.matrix = new n.Matrix4,
  43224. this.matrixWorld = new n.Matrix4,
  43225. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43226. this.matrixWorldNeedsUpdate = !1,
  43227. this.layers = new n.Layers,
  43228. this.visible = !0,
  43229. this.castShadow = !1,
  43230. this.receiveShadow = !1,
  43231. this.frustumCulled = !0,
  43232. this.renderOrder = 0,
  43233. this.userData = {}
  43234. }
  43235. ,
  43236. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43237. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43238. n.Object3D.prototype = {
  43239. constructor: n.Object3D,
  43240. applyMatrix: function(e) {
  43241. this.matrix.multiplyMatrices(e, this.matrix),
  43242. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43243. },
  43244. setRotationFromAxisAngle: function(e, t) {
  43245. this.quaternion.setFromAxisAngle(e, t)
  43246. },
  43247. setRotationFromEuler: function(e) {
  43248. this.quaternion.setFromEuler(e, !0)
  43249. },
  43250. setRotationFromMatrix: function(e) {
  43251. this.quaternion.setFromRotationMatrix(e)
  43252. },
  43253. setRotationFromQuaternion: function(e) {
  43254. this.quaternion.copy(e)
  43255. },
  43256. rotateOnAxis: function() {
  43257. var e = new n.Quaternion;
  43258. return function(t, i) {
  43259. return e.setFromAxisAngle(t, i),
  43260. this.quaternion.multiply(e),
  43261. this
  43262. }
  43263. }(),
  43264. rotateX: function() {
  43265. var e = new n.Vector3(1,0,0);
  43266. return function(t) {
  43267. return this.rotateOnAxis(e, t)
  43268. }
  43269. }(),
  43270. rotateY: function() {
  43271. var e = new n.Vector3(0,1,0);
  43272. return function(t) {
  43273. return this.rotateOnAxis(e, t)
  43274. }
  43275. }(),
  43276. rotateZ: function() {
  43277. var e = new n.Vector3(0,0,1);
  43278. return function(t) {
  43279. return this.rotateOnAxis(e, t)
  43280. }
  43281. }(),
  43282. translateOnAxis: function() {
  43283. var e = new n.Vector3;
  43284. return function(t, i) {
  43285. return e.copy(t).applyQuaternion(this.quaternion),
  43286. this.position.add(e.multiplyScalar(i)),
  43287. this
  43288. }
  43289. }(),
  43290. translateX: function() {
  43291. var e = new n.Vector3(1,0,0);
  43292. return function(t) {
  43293. return this.translateOnAxis(e, t)
  43294. }
  43295. }(),
  43296. translateY: function() {
  43297. var e = new n.Vector3(0,1,0);
  43298. return function(t) {
  43299. return this.translateOnAxis(e, t)
  43300. }
  43301. }(),
  43302. translateZ: function() {
  43303. var e = new n.Vector3(0,0,1);
  43304. return function(t) {
  43305. return this.translateOnAxis(e, t)
  43306. }
  43307. }(),
  43308. localToWorld: function(e) {
  43309. return e.applyMatrix4(this.matrixWorld)
  43310. },
  43311. worldToLocal: function() {
  43312. var e = new n.Matrix4;
  43313. return function(t) {
  43314. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43315. }
  43316. }(),
  43317. lookAt: function() {
  43318. var e = new n.Matrix4;
  43319. return function(t) {
  43320. e.lookAt(t, this.position, this.up),
  43321. this.quaternion.setFromRotationMatrix(e)
  43322. }
  43323. }(),
  43324. add: function(e) {
  43325. if (arguments.length > 1) {
  43326. for (var t = 0; t < arguments.length; t++)
  43327. this.add(arguments[t]);
  43328. return this
  43329. }
  43330. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43331. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43332. e.parent = this,
  43333. e.dispatchEvent({
  43334. type: "added"
  43335. }),
  43336. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43337. this)
  43338. },
  43339. remove: function(e) {
  43340. if (arguments.length > 1)
  43341. for (var t = 0; t < arguments.length; t++)
  43342. this.remove(arguments[t]);
  43343. var i = this.children.indexOf(e);
  43344. i !== -1 && (e.parent = null,
  43345. e.dispatchEvent({
  43346. type: "removed"
  43347. }),
  43348. this.children.splice(i, 1))
  43349. },
  43350. getObjectById: function(e) {
  43351. return this.getObjectByProperty("id", e)
  43352. },
  43353. getObjectByName: function(e) {
  43354. return this.getObjectByProperty("name", e)
  43355. },
  43356. getObjectByProperty: function(e, t) {
  43357. if (this[e] === t)
  43358. return this;
  43359. for (var i = 0, n = this.children.length; i < n; i++) {
  43360. var r = this.children[i]
  43361. , o = r.getObjectByProperty(e, t);
  43362. if (void 0 !== o)
  43363. return o
  43364. }
  43365. },
  43366. getWorldPosition: function(e) {
  43367. var t = e || new n.Vector3;
  43368. return this.updateMatrixWorld(!0),
  43369. t.setFromMatrixPosition(this.matrixWorld)
  43370. },
  43371. getWorldQuaternion: function() {
  43372. var e = new n.Vector3
  43373. , t = new n.Vector3;
  43374. return function(i) {
  43375. var r = i || new n.Quaternion;
  43376. return this.updateMatrixWorld(!0),
  43377. this.matrixWorld.decompose(e, r, t),
  43378. r
  43379. }
  43380. }(),
  43381. getWorldRotation: function() {
  43382. var e = new n.Quaternion;
  43383. return function(t) {
  43384. var i = t || new n.Euler;
  43385. return this.getWorldQuaternion(e),
  43386. i.setFromQuaternion(e, this.rotation.order, !1)
  43387. }
  43388. }(),
  43389. getWorldScale: function() {
  43390. var e = new n.Vector3
  43391. , t = new n.Quaternion;
  43392. return function(i) {
  43393. var r = i || new n.Vector3;
  43394. return this.updateMatrixWorld(!0),
  43395. this.matrixWorld.decompose(e, t, r),
  43396. r
  43397. }
  43398. }(),
  43399. getWorldDirection: function() {
  43400. var e = new n.Quaternion;
  43401. return function(t) {
  43402. var i = t || new n.Vector3;
  43403. return this.getWorldQuaternion(e),
  43404. i.set(0, 0, 1).applyQuaternion(e)
  43405. }
  43406. }(),
  43407. raycast: function() {},
  43408. traverse: function(e) {
  43409. e(this);
  43410. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43411. t[i].traverse(e)
  43412. },
  43413. traverseVisible: function(e) {
  43414. if (this.visible !== !1) {
  43415. e(this);
  43416. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43417. t[i].traverseVisible(e)
  43418. }
  43419. },
  43420. traverseAncestors: function(e) {
  43421. var t = this.parent;
  43422. null !== t && (e(t),
  43423. t.traverseAncestors(e))
  43424. },
  43425. updateMatrix: function() {
  43426. this.matrix.compose(this.position, this.quaternion, this.scale),
  43427. this.matrixWorldNeedsUpdate = !0
  43428. },
  43429. updateMatrixWorld: function(e) {
  43430. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43431. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43432. this.matrixWorldNeedsUpdate = !1,
  43433. e = !0);
  43434. for (var t = 0, i = this.children.length; t < i; t++)
  43435. this.children[t].updateMatrixWorld(e)
  43436. },
  43437. toJSON: function(e) {
  43438. function t(e) {
  43439. var t = [];
  43440. for (var i in e) {
  43441. var n = e[i];
  43442. delete n.metadata,
  43443. t.push(n)
  43444. }
  43445. return t
  43446. }
  43447. var i = void 0 === e
  43448. , n = {};
  43449. i && (e = {
  43450. geometries: {},
  43451. materials: {},
  43452. textures: {},
  43453. images: {}
  43454. },
  43455. n.metadata = {
  43456. version: 4.4,
  43457. type: "Object",
  43458. generator: "Object3D.toJSON"
  43459. });
  43460. var r = {};
  43461. if (r.uuid = this.uuid,
  43462. r.type = this.type,
  43463. "" !== this.name && (r.name = this.name),
  43464. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  43465. this.castShadow === !0 && (r.castShadow = !0),
  43466. this.receiveShadow === !0 && (r.receiveShadow = !0),
  43467. this.visible === !1 && (r.visible = !1),
  43468. r.matrix = this.matrix.toArray(),
  43469. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  43470. r.geometry = this.geometry.uuid),
  43471. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  43472. r.material = this.material.uuid),
  43473. this.children.length > 0) {
  43474. r.children = [];
  43475. for (var o = 0; o < this.children.length; o++)
  43476. r.children.push(this.children[o].toJSON(e).object)
  43477. }
  43478. if (i) {
  43479. var a = t(e.geometries)
  43480. , s = t(e.materials)
  43481. , l = t(e.textures)
  43482. , c = t(e.images);
  43483. a.length > 0 && (n.geometries = a),
  43484. s.length > 0 && (n.materials = s),
  43485. l.length > 0 && (n.textures = l),
  43486. c.length > 0 && (n.images = c)
  43487. }
  43488. return n.object = r,
  43489. n
  43490. },
  43491. clone: function(e) {
  43492. return (new this.constructor).copy(this, e)
  43493. },
  43494. copy: function(e, t) {
  43495. if (void 0 === t && (t = !0),
  43496. this.name = e.name,
  43497. this.up.copy(e.up),
  43498. this.position.copy(e.position),
  43499. this.quaternion.copy(e.quaternion),
  43500. this.scale.copy(e.scale),
  43501. this.rotationAutoUpdate = e.rotationAutoUpdate,
  43502. this.matrix.copy(e.matrix),
  43503. this.matrixWorld.copy(e.matrixWorld),
  43504. this.matrixAutoUpdate = e.matrixAutoUpdate,
  43505. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  43506. this.visible = e.visible,
  43507. this.castShadow = e.castShadow,
  43508. this.receiveShadow = e.receiveShadow,
  43509. this.frustumCulled = e.frustumCulled,
  43510. this.renderOrder = e.renderOrder,
  43511. this.userData = JSON.parse(JSON.stringify(e.userData)),
  43512. t === !0)
  43513. for (var i = 0; i < e.children.length; i++) {
  43514. var n = e.children[i];
  43515. this.add(n.clone())
  43516. }
  43517. return this
  43518. }
  43519. },
  43520. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  43521. n.Object3DIdCount = 0,
  43522. n.Face3 = function(e, t, i, r, o, a) {
  43523. this.a = e,
  43524. this.b = t,
  43525. this.c = i,
  43526. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  43527. this.vertexNormals = Array.isArray(r) ? r : [],
  43528. this.color = o instanceof n.Color ? o : new n.Color,
  43529. this.vertexColors = Array.isArray(o) ? o : [],
  43530. this.materialIndex = void 0 !== a ? a : 0
  43531. }
  43532. ,
  43533. n.Face3.prototype = {
  43534. constructor: n.Face3,
  43535. clone: function() {
  43536. return (new this.constructor).copy(this)
  43537. },
  43538. copy: function(e) {
  43539. this.a = e.a,
  43540. this.b = e.b,
  43541. this.c = e.c,
  43542. this.normal.copy(e.normal),
  43543. this.color.copy(e.color),
  43544. this.materialIndex = e.materialIndex;
  43545. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  43546. this.vertexNormals[t] = e.vertexNormals[t].clone();
  43547. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  43548. this.vertexColors[t] = e.vertexColors[t].clone();
  43549. return this
  43550. }
  43551. },
  43552. n.BufferAttribute = function(e, t) {
  43553. this.uuid = n.Math.generateUUID(),
  43554. this.array = e,
  43555. this.itemSize = t,
  43556. this.dynamic = !1,
  43557. this.updateRange = {
  43558. offset: 0,
  43559. count: -1
  43560. },
  43561. this.version = 0
  43562. }
  43563. ,
  43564. n.BufferAttribute.prototype = {
  43565. constructor: n.BufferAttribute,
  43566. get count() {
  43567. return this.array.length / this.itemSize
  43568. },
  43569. set needsUpdate(e) {
  43570. e === !0 && this.version++
  43571. },
  43572. setDynamic: function(e) {
  43573. return this.dynamic = e,
  43574. this
  43575. },
  43576. copy: function(e) {
  43577. return this.array = new e.array.constructor(e.array),
  43578. this.itemSize = e.itemSize,
  43579. this.dynamic = e.dynamic,
  43580. this
  43581. },
  43582. copyAt: function(e, t, i) {
  43583. e *= this.itemSize,
  43584. i *= t.itemSize;
  43585. for (var n = 0, r = this.itemSize; n < r; n++)
  43586. this.array[e + n] = t.array[i + n];
  43587. return this
  43588. },
  43589. copyArray: function(e) {
  43590. return this.array.set(e),
  43591. this
  43592. },
  43593. copyColorsArray: function(e) {
  43594. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43595. var a = e[r];
  43596. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  43597. a = new n.Color),
  43598. t[i++] = a.r,
  43599. t[i++] = a.g,
  43600. t[i++] = a.b
  43601. }
  43602. return this
  43603. },
  43604. copyIndicesArray: function(e) {
  43605. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  43606. var o = e[n];
  43607. t[i++] = o.a,
  43608. t[i++] = o.b,
  43609. t[i++] = o.c
  43610. }
  43611. return this
  43612. },
  43613. copyVector2sArray: function(e) {
  43614. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43615. var a = e[r];
  43616. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  43617. a = new n.Vector2),
  43618. t[i++] = a.x,
  43619. t[i++] = a.y
  43620. }
  43621. return this
  43622. },
  43623. copyVector3sArray: function(e) {
  43624. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43625. var a = e[r];
  43626. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  43627. a = new n.Vector3),
  43628. t[i++] = a.x,
  43629. t[i++] = a.y,
  43630. t[i++] = a.z
  43631. }
  43632. return this
  43633. },
  43634. copyVector4sArray: function(e) {
  43635. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43636. var a = e[r];
  43637. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  43638. a = new n.Vector4),
  43639. t[i++] = a.x,
  43640. t[i++] = a.y,
  43641. t[i++] = a.z,
  43642. t[i++] = a.w
  43643. }
  43644. return this
  43645. },
  43646. set: function(e, t) {
  43647. return void 0 === t && (t = 0),
  43648. this.array.set(e, t),
  43649. this
  43650. },
  43651. getX: function(e) {
  43652. return this.array[e * this.itemSize]
  43653. },
  43654. setX: function(e, t) {
  43655. return this.array[e * this.itemSize] = t,
  43656. this
  43657. },
  43658. getY: function(e) {
  43659. return this.array[e * this.itemSize + 1]
  43660. },
  43661. setY: function(e, t) {
  43662. return this.array[e * this.itemSize + 1] = t,
  43663. this
  43664. },
  43665. getZ: function(e) {
  43666. return this.array[e * this.itemSize + 2]
  43667. },
  43668. setZ: function(e, t) {
  43669. return this.array[e * this.itemSize + 2] = t,
  43670. this
  43671. },
  43672. getW: function(e) {
  43673. return this.array[e * this.itemSize + 3]
  43674. },
  43675. setW: function(e, t) {
  43676. return this.array[e * this.itemSize + 3] = t,
  43677. this
  43678. },
  43679. setXY: function(e, t, i) {
  43680. return e *= this.itemSize,
  43681. this.array[e + 0] = t,
  43682. this.array[e + 1] = i,
  43683. this
  43684. },
  43685. setXYZ: function(e, t, i, n) {
  43686. return e *= this.itemSize,
  43687. this.array[e + 0] = t,
  43688. this.array[e + 1] = i,
  43689. this.array[e + 2] = n,
  43690. this
  43691. },
  43692. setXYZW: function(e, t, i, n, r) {
  43693. return e *= this.itemSize,
  43694. this.array[e + 0] = t,
  43695. this.array[e + 1] = i,
  43696. this.array[e + 2] = n,
  43697. this.array[e + 3] = r,
  43698. this
  43699. },
  43700. clone: function() {
  43701. return (new this.constructor).copy(this)
  43702. }
  43703. },
  43704. n.Int8Attribute = function(e, t) {
  43705. return new n.BufferAttribute(new Int8Array(e),t)
  43706. }
  43707. ,
  43708. n.Uint8Attribute = function(e, t) {
  43709. return new n.BufferAttribute(new Uint8Array(e),t)
  43710. }
  43711. ,
  43712. n.Uint8ClampedAttribute = function(e, t) {
  43713. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  43714. }
  43715. ,
  43716. n.Int16Attribute = function(e, t) {
  43717. return new n.BufferAttribute(new Int16Array(e),t)
  43718. }
  43719. ,
  43720. n.Uint16Attribute = function(e, t) {
  43721. return new n.BufferAttribute(new Uint16Array(e),t)
  43722. }
  43723. ;
  43724. n.Int32Attribute = function(e, t) {
  43725. return new n.BufferAttribute(new Int32Array(e),t)
  43726. }
  43727. ;
  43728. n.Uint32Attribute = function(e, t) {
  43729. return new n.BufferAttribute(new Uint32Array(e),t)
  43730. }
  43731. ,
  43732. n.Float32Attribute = function(e, t) {
  43733. return new n.BufferAttribute(new Float32Array(e),t)
  43734. }
  43735. ,
  43736. n.Float64Attribute = function(e, t) {
  43737. return new n.BufferAttribute(new Float64Array(e),t)
  43738. }
  43739. ,
  43740. n.DynamicBufferAttribute = function(e, t) {
  43741. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  43742. new n.BufferAttribute(e,t).setDynamic(!0)
  43743. }
  43744. ,
  43745. n.InstancedBufferAttribute = function(e, t, i) {
  43746. n.BufferAttribute.call(this, e, t),
  43747. this.meshPerAttribute = i || 1
  43748. }
  43749. ,
  43750. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  43751. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  43752. n.InstancedBufferAttribute.prototype.copy = function(e) {
  43753. return n.BufferAttribute.prototype.copy.call(this, e),
  43754. this.meshPerAttribute = e.meshPerAttribute,
  43755. this
  43756. }
  43757. ,
  43758. n.InterleavedBuffer = function(e, t) {
  43759. this.uuid = n.Math.generateUUID(),
  43760. this.array = e,
  43761. this.stride = t,
  43762. this.dynamic = !1,
  43763. this.updateRange = {
  43764. offset: 0,
  43765. count: -1
  43766. },
  43767. this.version = 0
  43768. }
  43769. ,
  43770. n.InterleavedBuffer.prototype = {
  43771. constructor: n.InterleavedBuffer,
  43772. get length() {
  43773. return this.array.length
  43774. },
  43775. get count() {
  43776. return this.array.length / this.stride
  43777. },
  43778. set needsUpdate(e) {
  43779. e === !0 && this.version++
  43780. },
  43781. setDynamic: function(e) {
  43782. return this.dynamic = e,
  43783. this
  43784. },
  43785. copy: function(e) {
  43786. return this.array = new e.array.constructor(e.array),
  43787. this.stride = e.stride,
  43788. this.dynamic = e.dynamic,
  43789. this
  43790. },
  43791. copyAt: function(e, t, i) {
  43792. e *= this.stride,
  43793. i *= t.stride;
  43794. for (var n = 0, r = this.stride; n < r; n++)
  43795. this.array[e + n] = t.array[i + n];
  43796. return this
  43797. },
  43798. set: function(e, t) {
  43799. return void 0 === t && (t = 0),
  43800. this.array.set(e, t),
  43801. this
  43802. },
  43803. clone: function() {
  43804. return (new this.constructor).copy(this)
  43805. }
  43806. },
  43807. n.InstancedInterleavedBuffer = function(e, t, i) {
  43808. n.InterleavedBuffer.call(this, e, t),
  43809. this.meshPerAttribute = i || 1
  43810. }
  43811. ,
  43812. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  43813. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  43814. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  43815. return n.InterleavedBuffer.prototype.copy.call(this, e),
  43816. this.meshPerAttribute = e.meshPerAttribute,
  43817. this
  43818. }
  43819. ,
  43820. n.InterleavedBufferAttribute = function(e, t, i) {
  43821. this.uuid = n.Math.generateUUID(),
  43822. this.data = e,
  43823. this.itemSize = t,
  43824. this.offset = i
  43825. }
  43826. ,
  43827. n.InterleavedBufferAttribute.prototype = {
  43828. constructor: n.InterleavedBufferAttribute,
  43829. get length() {
  43830. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  43831. this.array.length
  43832. },
  43833. get count() {
  43834. return this.data.count
  43835. },
  43836. setX: function(e, t) {
  43837. return this.data.array[e * this.data.stride + this.offset] = t,
  43838. this
  43839. },
  43840. setY: function(e, t) {
  43841. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  43842. this
  43843. },
  43844. setZ: function(e, t) {
  43845. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  43846. this
  43847. },
  43848. setW: function(e, t) {
  43849. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  43850. this
  43851. },
  43852. getX: function(e) {
  43853. return this.data.array[e * this.data.stride + this.offset]
  43854. },
  43855. getY: function(e) {
  43856. return this.data.array[e * this.data.stride + this.offset + 1]
  43857. },
  43858. getZ: function(e) {
  43859. return this.data.array[e * this.data.stride + this.offset + 2]
  43860. },
  43861. getW: function(e) {
  43862. return this.data.array[e * this.data.stride + this.offset + 3]
  43863. },
  43864. setXY: function(e, t, i) {
  43865. return e = e * this.data.stride + this.offset,
  43866. this.data.array[e + 0] = t,
  43867. this.data.array[e + 1] = i,
  43868. this
  43869. },
  43870. setXYZ: function(e, t, i, n) {
  43871. return e = e * this.data.stride + this.offset,
  43872. this.data.array[e + 0] = t,
  43873. this.data.array[e + 1] = i,
  43874. this.data.array[e + 2] = n,
  43875. this
  43876. },
  43877. setXYZW: function(e, t, i, n, r) {
  43878. return e = e * this.data.stride + this.offset,
  43879. this.data.array[e + 0] = t,
  43880. this.data.array[e + 1] = i,
  43881. this.data.array[e + 2] = n,
  43882. this.data.array[e + 3] = r,
  43883. this
  43884. }
  43885. },
  43886. n.Geometry = function() {
  43887. Object.defineProperty(this, "id", {
  43888. value: n.GeometryIdCount++
  43889. }),
  43890. this.uuid = n.Math.generateUUID(),
  43891. this.name = "",
  43892. this.type = "Geometry",
  43893. this.vertices = [],
  43894. this.colors = [],
  43895. this.faces = [],
  43896. this.faceVertexUvs = [[]],
  43897. this.morphTargets = [],
  43898. this.morphNormals = [],
  43899. this.skinWeights = [],
  43900. this.skinIndices = [],
  43901. this.lineDistances = [],
  43902. this.boundingBox = null,
  43903. this.boundingSphere = null,
  43904. this.verticesNeedUpdate = !1,
  43905. this.elementsNeedUpdate = !1,
  43906. this.uvsNeedUpdate = !1,
  43907. this.normalsNeedUpdate = !1,
  43908. this.colorsNeedUpdate = !1,
  43909. this.lineDistancesNeedUpdate = !1,
  43910. this.groupsNeedUpdate = !1
  43911. }
  43912. ,
  43913. n.Geometry.prototype = {
  43914. constructor: n.Geometry,
  43915. applyMatrix: function(e) {
  43916. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  43917. var o = this.vertices[i];
  43918. o.applyMatrix4(e)
  43919. }
  43920. for (var i = 0, r = this.faces.length; i < r; i++) {
  43921. var a = this.faces[i];
  43922. a.normal.applyMatrix3(t).normalize();
  43923. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  43924. a.vertexNormals[s].applyMatrix3(t).normalize()
  43925. }
  43926. return null !== this.boundingBox && this.computeBoundingBox(),
  43927. null !== this.boundingSphere && this.computeBoundingSphere(),
  43928. this.verticesNeedUpdate = !0,
  43929. this.normalsNeedUpdate = !0,
  43930. this
  43931. },
  43932. rotateX: function() {
  43933. var e;
  43934. return function(t) {
  43935. return void 0 === e && (e = new n.Matrix4),
  43936. e.makeRotationX(t),
  43937. this.applyMatrix(e),
  43938. this
  43939. }
  43940. }(),
  43941. rotateY: function() {
  43942. var e;
  43943. return function(t) {
  43944. return void 0 === e && (e = new n.Matrix4),
  43945. e.makeRotationY(t),
  43946. this.applyMatrix(e),
  43947. this
  43948. }
  43949. }(),
  43950. rotateZ: function() {
  43951. var e;
  43952. return function(t) {
  43953. return void 0 === e && (e = new n.Matrix4),
  43954. e.makeRotationZ(t),
  43955. this.applyMatrix(e),
  43956. this
  43957. }
  43958. }(),
  43959. translate: function() {
  43960. var e;
  43961. return function(t, i, r) {
  43962. return void 0 === e && (e = new n.Matrix4),
  43963. e.makeTranslation(t, i, r),
  43964. this.applyMatrix(e),
  43965. this
  43966. }
  43967. }(),
  43968. scale: function() {
  43969. var e;
  43970. return function(t, i, r) {
  43971. return void 0 === e && (e = new n.Matrix4),
  43972. e.makeScale(t, i, r),
  43973. this.applyMatrix(e),
  43974. this
  43975. }
  43976. }(),
  43977. lookAt: function() {
  43978. var e;
  43979. return function(t) {
  43980. void 0 === e && (e = new n.Object3D),
  43981. e.lookAt(t),
  43982. e.updateMatrix(),
  43983. this.applyMatrix(e.matrix)
  43984. }
  43985. }(),
  43986. fromBufferGeometry: function(e) {
  43987. function t(e, t, r, o) {
  43988. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  43989. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  43990. , g = new n.Face3(e,t,r,a,f,o);
  43991. i.faces.push(g),
  43992. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  43993. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  43994. }
  43995. var i = this
  43996. , r = null !== e.index ? e.index.array : void 0
  43997. , o = e.attributes
  43998. , a = o.position.array
  43999. , s = void 0 !== o.normal ? o.normal.array : void 0
  44000. , l = void 0 !== o.color ? o.color.array : void 0
  44001. , c = void 0 !== o.uv ? o.uv.array : void 0
  44002. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44003. void 0 !== h && (this.faceVertexUvs[1] = []);
  44004. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44005. g += 2)
  44006. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44007. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44008. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44009. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44010. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44011. if (void 0 !== r) {
  44012. var m = e.groups;
  44013. if (m.length > 0)
  44014. for (var f = 0; f < m.length; f++)
  44015. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44016. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44017. else
  44018. for (var f = 0; f < r.length; f += 3)
  44019. t(r[f], r[f + 1], r[f + 2])
  44020. } else
  44021. for (var f = 0; f < a.length / 3; f += 3)
  44022. t(f, f + 1, f + 2);
  44023. return this.computeFaceNormals(),
  44024. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44025. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44026. this
  44027. },
  44028. center: function() {
  44029. this.computeBoundingBox();
  44030. var e = this.boundingBox.center().negate();
  44031. return this.translate(e.x, e.y, e.z),
  44032. e
  44033. },
  44034. normalize: function() {
  44035. this.computeBoundingSphere();
  44036. var e = this.boundingSphere.center
  44037. , t = this.boundingSphere.radius
  44038. , i = 0 === t ? 1 : 1 / t
  44039. , r = new n.Matrix4;
  44040. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  44041. this.applyMatrix(r),
  44042. this
  44043. },
  44044. computeFaceNormals: function() {
  44045. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44046. var o = this.faces[i]
  44047. , a = this.vertices[o.a]
  44048. , s = this.vertices[o.b]
  44049. , l = this.vertices[o.c];
  44050. e.subVectors(l, s),
  44051. t.subVectors(a, s),
  44052. e.cross(t),
  44053. e.normalize(),
  44054. o.normal.copy(e)
  44055. }
  44056. },
  44057. computeVertexNormals: function(e) {
  44058. void 0 === e && (e = !0);
  44059. var t, i, r, o, a, s;
  44060. for (s = new Array(this.vertices.length),
  44061. t = 0,
  44062. i = this.vertices.length; t < i; t++)
  44063. s[t] = new n.Vector3;
  44064. if (e) {
  44065. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44066. for (r = 0,
  44067. o = this.faces.length; r < o; r++)
  44068. a = this.faces[r],
  44069. l = this.vertices[a.a],
  44070. c = this.vertices[a.b],
  44071. h = this.vertices[a.c],
  44072. u.subVectors(h, c),
  44073. d.subVectors(l, c),
  44074. u.cross(d),
  44075. s[a.a].add(u),
  44076. s[a.b].add(u),
  44077. s[a.c].add(u)
  44078. } else
  44079. for (r = 0,
  44080. o = this.faces.length; r < o; r++)
  44081. a = this.faces[r],
  44082. s[a.a].add(a.normal),
  44083. s[a.b].add(a.normal),
  44084. s[a.c].add(a.normal);
  44085. for (t = 0,
  44086. i = this.vertices.length; t < i; t++)
  44087. s[t].normalize();
  44088. for (r = 0,
  44089. o = this.faces.length; r < o; r++) {
  44090. a = this.faces[r];
  44091. var p = a.vertexNormals;
  44092. 3 === p.length ? (p[0].copy(s[a.a]),
  44093. p[1].copy(s[a.b]),
  44094. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44095. p[1] = s[a.b].clone(),
  44096. p[2] = s[a.c].clone())
  44097. }
  44098. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44099. },
  44100. computeMorphNormals: function() {
  44101. var e, t, i, r, o;
  44102. for (i = 0,
  44103. r = this.faces.length; i < r; i++)
  44104. for (o = this.faces[i],
  44105. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44106. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44107. e = 0,
  44108. t = o.vertexNormals.length; e < t; e++)
  44109. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44110. var a = new n.Geometry;
  44111. for (a.faces = this.faces,
  44112. e = 0,
  44113. t = this.morphTargets.length; e < t; e++) {
  44114. if (!this.morphNormals[e]) {
  44115. this.morphNormals[e] = {},
  44116. this.morphNormals[e].faceNormals = [],
  44117. this.morphNormals[e].vertexNormals = [];
  44118. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44119. for (i = 0,
  44120. r = this.faces.length; i < r; i++)
  44121. s = new n.Vector3,
  44122. l = {
  44123. a: new n.Vector3,
  44124. b: new n.Vector3,
  44125. c: new n.Vector3
  44126. },
  44127. c.push(s),
  44128. h.push(l)
  44129. }
  44130. var u = this.morphNormals[e];
  44131. a.vertices = this.morphTargets[e].vertices,
  44132. a.computeFaceNormals(),
  44133. a.computeVertexNormals();
  44134. var s, l;
  44135. for (i = 0,
  44136. r = this.faces.length; i < r; i++)
  44137. o = this.faces[i],
  44138. s = u.faceNormals[i],
  44139. l = u.vertexNormals[i],
  44140. s.copy(o.normal),
  44141. l.a.copy(o.vertexNormals[0]),
  44142. l.b.copy(o.vertexNormals[1]),
  44143. l.c.copy(o.vertexNormals[2])
  44144. }
  44145. for (i = 0,
  44146. r = this.faces.length; i < r; i++)
  44147. o = this.faces[i],
  44148. o.normal = o.__originalFaceNormal,
  44149. o.vertexNormals = o.__originalVertexNormals
  44150. },
  44151. computeTangents: function() {
  44152. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44153. },
  44154. computeLineDistances: function() {
  44155. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44156. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44157. this.lineDistances[i] = e
  44158. },
  44159. computeBoundingBox: function() {
  44160. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44161. this.boundingBox.setFromPoints(this.vertices)
  44162. },
  44163. computeBoundingSphere: function() {
  44164. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44165. this.boundingSphere.setFromPoints(this.vertices)
  44166. },
  44167. merge: function(e, t, i) {
  44168. if (e instanceof n.Geometry == !1)
  44169. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44170. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  44171. void 0 === i && (i = 0),
  44172. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44173. for (var d = 0, p = s.length; d < p; d++) {
  44174. var f = s[d]
  44175. , g = f.clone();
  44176. void 0 !== t && g.applyMatrix4(t),
  44177. a.push(g)
  44178. }
  44179. for (d = 0,
  44180. p = c.length; d < p; d++) {
  44181. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44182. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44183. m.normal.copy(y.normal),
  44184. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44185. for (var E = 0, b = C.length; E < b; E++)
  44186. v = C[E].clone(),
  44187. void 0 !== r && v.applyMatrix3(r).normalize(),
  44188. m.vertexNormals.push(v);
  44189. m.color.copy(y.color);
  44190. for (var E = 0, b = I.length; E < b; E++)
  44191. A = I[E],
  44192. m.vertexColors.push(A.clone());
  44193. m.materialIndex = y.materialIndex + i,
  44194. l.push(m)
  44195. }
  44196. for (d = 0,
  44197. p = u.length; d < p; d++) {
  44198. var w = u[d]
  44199. , _ = [];
  44200. if (void 0 !== w) {
  44201. for (var E = 0, b = w.length; E < b; E++)
  44202. _.push(w[E].clone());
  44203. h.push(_)
  44204. }
  44205. }
  44206. },
  44207. mergeMesh: function(e) {
  44208. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44209. void this.merge(e.geometry, e.matrix))
  44210. },
  44211. mergeVertices: function() {
  44212. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44213. for (i = 0,
  44214. n = this.vertices.length; i < n; i++)
  44215. e = this.vertices[i],
  44216. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44217. void 0 === l[t] ? (l[t] = i,
  44218. c.push(this.vertices[i]),
  44219. h[i] = c.length - 1) : h[i] = h[l[t]];
  44220. var p = [];
  44221. for (i = 0,
  44222. n = this.faces.length; i < n; i++) {
  44223. r = this.faces[i],
  44224. r.a = h[r.a],
  44225. r.b = h[r.b],
  44226. r.c = h[r.c],
  44227. o = [r.a, r.b, r.c];
  44228. for (var f = -1, g = 0; g < 3; g++)
  44229. if (o[g] === o[(g + 1) % 3]) {
  44230. f = g,
  44231. p.push(i);
  44232. break
  44233. }
  44234. }
  44235. for (i = p.length - 1; i >= 0; i--) {
  44236. var m = p[i];
  44237. for (this.faces.splice(m, 1),
  44238. a = 0,
  44239. s = this.faceVertexUvs.length; a < s; a++)
  44240. this.faceVertexUvs[a].splice(m, 1)
  44241. }
  44242. var v = this.vertices.length - c.length;
  44243. return this.vertices = c,
  44244. v
  44245. },
  44246. sortFacesByMaterialIndex: function() {
  44247. function e(e, t) {
  44248. return e.materialIndex - t.materialIndex
  44249. }
  44250. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44251. t[n]._id = n;
  44252. t.sort(e);
  44253. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44254. a && a.length === i && (r = []),
  44255. s && s.length === i && (o = []);
  44256. for (var n = 0; n < i; n++) {
  44257. var l = t[n]._id;
  44258. r && r.push(a[l]),
  44259. o && o.push(s[l])
  44260. }
  44261. r && (this.faceVertexUvs[0] = r),
  44262. o && (this.faceVertexUvs[1] = o)
  44263. },
  44264. toJSON: function() {
  44265. function e(e, t, i) {
  44266. return i ? e | 1 << t : e & ~(1 << t)
  44267. }
  44268. function t(e) {
  44269. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44270. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44271. u.push(e.x, e.y, e.z),
  44272. d[t])
  44273. }
  44274. function i(e) {
  44275. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44276. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44277. p.push(e.getHex()),
  44278. f[t])
  44279. }
  44280. function n(e) {
  44281. var t = e.x.toString() + e.y.toString();
  44282. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44283. g.push(e.x, e.y),
  44284. m[t])
  44285. }
  44286. var r = {
  44287. metadata: {
  44288. version: 4.4,
  44289. type: "Geometry",
  44290. generator: "Geometry.toJSON"
  44291. }
  44292. };
  44293. if (r.uuid = this.uuid,
  44294. r.type = this.type,
  44295. "" !== this.name && (r.name = this.name),
  44296. void 0 !== this.parameters) {
  44297. var o = this.parameters;
  44298. for (var a in o)
  44299. void 0 !== o[a] && (r[a] = o[a]);
  44300. return r
  44301. }
  44302. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44303. var c = this.vertices[l];
  44304. s.push(c.x, c.y, c.z)
  44305. }
  44306. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44307. var v = this.faces[l]
  44308. , A = !0
  44309. , y = !1
  44310. , C = void 0 !== this.faceVertexUvs[0][l]
  44311. , I = v.normal.length() > 0
  44312. , E = v.vertexNormals.length > 0
  44313. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44314. , w = v.vertexColors.length > 0
  44315. , _ = 0;
  44316. if (_ = e(_, 0, 0),
  44317. _ = e(_, 1, A),
  44318. _ = e(_, 2, y),
  44319. _ = e(_, 3, C),
  44320. _ = e(_, 4, I),
  44321. _ = e(_, 5, E),
  44322. _ = e(_, 6, b),
  44323. _ = e(_, 7, w),
  44324. h.push(_),
  44325. h.push(v.a, v.b, v.c),
  44326. h.push(v.materialIndex),
  44327. C) {
  44328. var T = this.faceVertexUvs[0][l];
  44329. h.push(n(T[0]), n(T[1]), n(T[2]))
  44330. }
  44331. if (I && h.push(t(v.normal)),
  44332. E) {
  44333. var x = v.vertexNormals;
  44334. h.push(t(x[0]), t(x[1]), t(x[2]))
  44335. }
  44336. if (b && h.push(i(v.color)),
  44337. w) {
  44338. var S = v.vertexColors;
  44339. h.push(i(S[0]), i(S[1]), i(S[2]))
  44340. }
  44341. }
  44342. return r.data = {},
  44343. r.data.vertices = s,
  44344. r.data.normals = u,
  44345. p.length > 0 && (r.data.colors = p),
  44346. g.length > 0 && (r.data.uvs = [g]),
  44347. r.data.faces = h,
  44348. r
  44349. },
  44350. clone: function() {
  44351. return (new n.Geometry).copy(this)
  44352. },
  44353. copy: function(e) {
  44354. this.vertices = [],
  44355. this.faces = [],
  44356. this.faceVertexUvs = [[]];
  44357. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44358. this.vertices.push(t[i].clone());
  44359. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44360. this.faces.push(r[i].clone());
  44361. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44362. var o = e.faceVertexUvs[i];
  44363. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44364. for (var a = 0, s = o.length; a < s; a++) {
  44365. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44366. var d = l[h];
  44367. c.push(d.clone())
  44368. }
  44369. this.faceVertexUvs[i].push(c)
  44370. }
  44371. }
  44372. return this
  44373. },
  44374. dispose: function() {
  44375. this.dispatchEvent({
  44376. type: "dispose"
  44377. })
  44378. }
  44379. },
  44380. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44381. n.GeometryIdCount = 0,
  44382. n.DirectGeometry = function() {
  44383. Object.defineProperty(this, "id", {
  44384. value: n.GeometryIdCount++
  44385. }),
  44386. this.uuid = n.Math.generateUUID(),
  44387. this.name = "",
  44388. this.type = "DirectGeometry",
  44389. this.indices = [],
  44390. this.vertices = [],
  44391. this.normals = [],
  44392. this.colors = [],
  44393. this.uvs = [],
  44394. this.uvs2 = [],
  44395. this.groups = [],
  44396. this.morphTargets = {},
  44397. this.skinWeights = [],
  44398. this.skinIndices = [],
  44399. this.boundingBox = null,
  44400. this.boundingSphere = null,
  44401. this.verticesNeedUpdate = !1,
  44402. this.normalsNeedUpdate = !1,
  44403. this.colorsNeedUpdate = !1,
  44404. this.uvsNeedUpdate = !1,
  44405. this.groupsNeedUpdate = !1
  44406. }
  44407. ,
  44408. n.DirectGeometry.prototype = {
  44409. constructor: n.DirectGeometry,
  44410. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44411. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44412. computeFaceNormals: function() {
  44413. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44414. },
  44415. computeVertexNormals: function() {
  44416. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44417. },
  44418. computeGroups: function(e) {
  44419. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44420. var a = r[o];
  44421. a.materialIndex !== i && (i = a.materialIndex,
  44422. void 0 !== t && (t.count = 3 * o - t.start,
  44423. n.push(t)),
  44424. t = {
  44425. start: 3 * o,
  44426. materialIndex: i
  44427. })
  44428. }
  44429. void 0 !== t && (t.count = 3 * o - t.start,
  44430. n.push(t)),
  44431. this.groups = n
  44432. },
  44433. fromGeometry: function(e) {
  44434. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  44435. if (c > 0) {
  44436. t = [];
  44437. for (var h = 0; h < c; h++)
  44438. t[h] = [];
  44439. this.morphTargets.position = t
  44440. }
  44441. var u, d = e.morphNormals, p = d.length;
  44442. if (p > 0) {
  44443. u = [];
  44444. for (var h = 0; h < p; h++)
  44445. u[h] = [];
  44446. this.morphTargets.normal = u
  44447. }
  44448. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  44449. var A = i[h];
  44450. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  44451. var y = A.vertexNormals;
  44452. if (3 === y.length)
  44453. this.normals.push(y[0], y[1], y[2]);
  44454. else {
  44455. var C = A.normal;
  44456. this.normals.push(C, C, C)
  44457. }
  44458. var I = A.vertexColors;
  44459. if (3 === I.length)
  44460. this.colors.push(I[0], I[1], I[2]);
  44461. else {
  44462. var E = A.color;
  44463. this.colors.push(E, E, E)
  44464. }
  44465. if (a === !0) {
  44466. var b = o[0][h];
  44467. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  44468. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44469. }
  44470. if (s === !0) {
  44471. var b = o[1][h];
  44472. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  44473. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44474. }
  44475. for (var w = 0; w < c; w++) {
  44476. var _ = l[w].vertices;
  44477. t[w].push(_[A.a], _[A.b], _[A.c])
  44478. }
  44479. for (var w = 0; w < p; w++) {
  44480. var T = d[w].vertexNormals[h];
  44481. u[w].push(T.a, T.b, T.c)
  44482. }
  44483. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  44484. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  44485. }
  44486. return this.computeGroups(e),
  44487. this.verticesNeedUpdate = e.verticesNeedUpdate,
  44488. this.normalsNeedUpdate = e.normalsNeedUpdate,
  44489. this.colorsNeedUpdate = e.colorsNeedUpdate,
  44490. this.uvsNeedUpdate = e.uvsNeedUpdate,
  44491. this.groupsNeedUpdate = e.groupsNeedUpdate,
  44492. this
  44493. },
  44494. dispose: function() {
  44495. this.dispatchEvent({
  44496. type: "dispose"
  44497. })
  44498. }
  44499. },
  44500. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  44501. n.BufferGeometry = function() {
  44502. Object.defineProperty(this, "id", {
  44503. value: n.GeometryIdCount++
  44504. }),
  44505. this.uuid = n.Math.generateUUID(),
  44506. this.name = "",
  44507. this.type = "BufferGeometry",
  44508. this.index = null,
  44509. this.attributes = {},
  44510. this.morphAttributes = {},
  44511. this.groups = [],
  44512. this.boundingBox = null,
  44513. this.boundingSphere = null,
  44514. this.drawRange = {
  44515. start: 0,
  44516. count: 1 / 0
  44517. }
  44518. }
  44519. ,
  44520. n.BufferGeometry.prototype = {
  44521. constructor: n.BufferGeometry,
  44522. getIndex: function() {
  44523. return this.index
  44524. },
  44525. setIndex: function(e) {
  44526. this.index = e
  44527. },
  44528. addAttribute: function(e, t) {
  44529. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  44530. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  44531. void this.setIndex(t)) : (this.attributes[e] = t,
  44532. this)
  44533. },
  44534. getAttribute: function(e) {
  44535. return this.attributes[e]
  44536. },
  44537. removeAttribute: function(e) {
  44538. return delete this.attributes[e],
  44539. this
  44540. },
  44541. addGroup: function(e, t, i) {
  44542. this.groups.push({
  44543. start: e,
  44544. count: t,
  44545. materialIndex: void 0 !== i ? i : 0
  44546. })
  44547. },
  44548. clearGroups: function() {
  44549. this.groups = []
  44550. },
  44551. setDrawRange: function(e, t) {
  44552. this.drawRange.start = e,
  44553. this.drawRange.count = t
  44554. },
  44555. applyMatrix: function(e) {
  44556. var t = this.attributes.position;
  44557. void 0 !== t && (e.applyToVector3Array(t.array),
  44558. t.needsUpdate = !0);
  44559. var i = this.attributes.normal;
  44560. if (void 0 !== i) {
  44561. var r = (new n.Matrix3).getNormalMatrix(e);
  44562. r.applyToVector3Array(i.array),
  44563. i.needsUpdate = !0
  44564. }
  44565. return null !== this.boundingBox && this.computeBoundingBox(),
  44566. null !== this.boundingSphere && this.computeBoundingSphere(),
  44567. this
  44568. },
  44569. rotateX: function() {
  44570. var e;
  44571. return function(t) {
  44572. return void 0 === e && (e = new n.Matrix4),
  44573. e.makeRotationX(t),
  44574. this.applyMatrix(e),
  44575. this
  44576. }
  44577. }(),
  44578. rotateY: function() {
  44579. var e;
  44580. return function(t) {
  44581. return void 0 === e && (e = new n.Matrix4),
  44582. e.makeRotationY(t),
  44583. this.applyMatrix(e),
  44584. this
  44585. }
  44586. }(),
  44587. rotateZ: function() {
  44588. var e;
  44589. return function(t) {
  44590. return void 0 === e && (e = new n.Matrix4),
  44591. e.makeRotationZ(t),
  44592. this.applyMatrix(e),
  44593. this
  44594. }
  44595. }(),
  44596. translate: function() {
  44597. var e;
  44598. return function(t, i, r) {
  44599. return void 0 === e && (e = new n.Matrix4),
  44600. e.makeTranslation(t, i, r),
  44601. this.applyMatrix(e),
  44602. this
  44603. }
  44604. }(),
  44605. scale: function() {
  44606. var e;
  44607. return function(t, i, r) {
  44608. return void 0 === e && (e = new n.Matrix4),
  44609. e.makeScale(t, i, r),
  44610. this.applyMatrix(e),
  44611. this
  44612. }
  44613. }(),
  44614. lookAt: function() {
  44615. var e;
  44616. return function(t) {
  44617. void 0 === e && (e = new n.Object3D),
  44618. e.lookAt(t),
  44619. e.updateMatrix(),
  44620. this.applyMatrix(e.matrix)
  44621. }
  44622. }(),
  44623. center: function() {
  44624. this.computeBoundingBox();
  44625. var e = this.boundingBox.center().negate();
  44626. return this.translate(e.x, e.y, e.z),
  44627. e
  44628. },
  44629. setFromObject: function(e) {
  44630. var t = e.geometry;
  44631. if (e instanceof n.Points || e instanceof n.Line) {
  44632. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  44633. , r = new n.Float32Attribute(3 * t.colors.length,3);
  44634. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  44635. this.addAttribute("color", r.copyColorsArray(t.colors)),
  44636. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  44637. var o = new n.Float32Attribute(t.lineDistances.length,1);
  44638. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  44639. }
  44640. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  44641. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  44642. } else
  44643. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  44644. return this
  44645. },
  44646. updateFromObject: function(e) {
  44647. var t = e.geometry;
  44648. if (e instanceof n.Mesh) {
  44649. var i = t.__directGeometry;
  44650. if (void 0 === i)
  44651. return this.fromGeometry(t);
  44652. i.verticesNeedUpdate = t.verticesNeedUpdate,
  44653. i.normalsNeedUpdate = t.normalsNeedUpdate,
  44654. i.colorsNeedUpdate = t.colorsNeedUpdate,
  44655. i.uvsNeedUpdate = t.uvsNeedUpdate,
  44656. i.groupsNeedUpdate = t.groupsNeedUpdate,
  44657. t.verticesNeedUpdate = !1,
  44658. t.normalsNeedUpdate = !1,
  44659. t.colorsNeedUpdate = !1,
  44660. t.uvsNeedUpdate = !1,
  44661. t.groupsNeedUpdate = !1,
  44662. t = i
  44663. }
  44664. if (t.verticesNeedUpdate === !0) {
  44665. var r = this.attributes.position;
  44666. void 0 !== r && (r.copyVector3sArray(t.vertices),
  44667. r.needsUpdate = !0),
  44668. t.verticesNeedUpdate = !1
  44669. }
  44670. if (t.normalsNeedUpdate === !0) {
  44671. var r = this.attributes.normal;
  44672. void 0 !== r && (r.copyVector3sArray(t.normals),
  44673. r.needsUpdate = !0),
  44674. t.normalsNeedUpdate = !1
  44675. }
  44676. if (t.colorsNeedUpdate === !0) {
  44677. var r = this.attributes.color;
  44678. void 0 !== r && (r.copyColorsArray(t.colors),
  44679. r.needsUpdate = !0),
  44680. t.colorsNeedUpdate = !1
  44681. }
  44682. if (t.uvsNeedUpdate) {
  44683. var r = this.attributes.uv;
  44684. void 0 !== r && (r.copyVector2sArray(t.uvs),
  44685. r.needsUpdate = !0),
  44686. t.uvsNeedUpdate = !1
  44687. }
  44688. if (t.lineDistancesNeedUpdate) {
  44689. var r = this.attributes.lineDistance;
  44690. void 0 !== r && (r.copyArray(t.lineDistances),
  44691. r.needsUpdate = !0),
  44692. t.lineDistancesNeedUpdate = !1
  44693. }
  44694. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  44695. this.groups = t.groups,
  44696. t.groupsNeedUpdate = !1),
  44697. this
  44698. },
  44699. fromGeometry: function(e) {
  44700. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  44701. this.fromDirectGeometry(e.__directGeometry)
  44702. },
  44703. fromDirectGeometry: function(e) {
  44704. var t = new Float32Array(3 * e.vertices.length);
  44705. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  44706. e.normals.length > 0) {
  44707. var i = new Float32Array(3 * e.normals.length);
  44708. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  44709. }
  44710. if (e.colors.length > 0) {
  44711. var r = new Float32Array(3 * e.colors.length);
  44712. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  44713. }
  44714. if (e.uvs.length > 0) {
  44715. var o = new Float32Array(2 * e.uvs.length);
  44716. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  44717. }
  44718. if (e.uvs2.length > 0) {
  44719. var a = new Float32Array(2 * e.uvs2.length);
  44720. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  44721. }
  44722. if (e.indices.length > 0) {
  44723. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  44724. , l = new s(3 * e.indices.length);
  44725. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  44726. }
  44727. this.groups = e.groups;
  44728. for (var c in e.morphTargets) {
  44729. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  44730. var f = u[d]
  44731. , g = new n.Float32Attribute(3 * f.length,3);
  44732. h.push(g.copyVector3sArray(f))
  44733. }
  44734. this.morphAttributes[c] = h
  44735. }
  44736. if (e.skinIndices.length > 0) {
  44737. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  44738. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  44739. }
  44740. if (e.skinWeights.length > 0) {
  44741. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  44742. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  44743. }
  44744. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44745. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44746. this
  44747. },
  44748. computeBoundingBox: function() {
  44749. new n.Vector3;
  44750. return function() {
  44751. null === this.boundingBox && (this.boundingBox = new n.Box3);
  44752. var e = this.attributes.position.array;
  44753. e && this.boundingBox.setFromArray(e),
  44754. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  44755. this.boundingBox.max.set(0, 0, 0)),
  44756. (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)
  44757. }
  44758. }(),
  44759. computeBoundingSphere: function() {
  44760. var e = new n.Box3
  44761. , t = new n.Vector3;
  44762. return function() {
  44763. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  44764. var i = this.attributes.position.array;
  44765. if (i) {
  44766. var r = this.boundingSphere.center;
  44767. e.setFromArray(i),
  44768. e.center(r);
  44769. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  44770. t.fromArray(i, a),
  44771. o = Math.max(o, r.distanceToSquared(t));
  44772. this.boundingSphere.radius = Math.sqrt(o),
  44773. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  44774. }
  44775. }
  44776. }(),
  44777. computeFaceNormals: function() {},
  44778. computeVertexNormals: function() {
  44779. var e = this.index
  44780. , t = this.attributes
  44781. , i = this.groups;
  44782. if (t.position) {
  44783. var r = t.position.array;
  44784. if (void 0 === t.normal)
  44785. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  44786. else
  44787. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  44788. o[a] = 0;
  44789. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  44790. if (e) {
  44791. var v = e.array;
  44792. 0 === i.length && this.addGroup(0, v.length);
  44793. for (var A = 0, y = i.length; A < y; ++A)
  44794. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  44795. l = 3 * v[a + 0],
  44796. c = 3 * v[a + 1],
  44797. h = 3 * v[a + 2],
  44798. d.fromArray(r, l),
  44799. p.fromArray(r, c),
  44800. f.fromArray(r, h),
  44801. g.subVectors(f, p),
  44802. m.subVectors(d, p),
  44803. g.cross(m),
  44804. u[l] += g.x,
  44805. u[l + 1] += g.y,
  44806. u[l + 2] += g.z,
  44807. u[c] += g.x,
  44808. u[c + 1] += g.y,
  44809. u[c + 2] += g.z,
  44810. u[h] += g.x,
  44811. u[h + 1] += g.y,
  44812. u[h + 2] += g.z
  44813. } else
  44814. for (var a = 0, s = r.length; a < s; a += 9)
  44815. d.fromArray(r, a),
  44816. p.fromArray(r, a + 3),
  44817. f.fromArray(r, a + 6),
  44818. g.subVectors(f, p),
  44819. m.subVectors(d, p),
  44820. g.cross(m),
  44821. u[a] = g.x,
  44822. u[a + 1] = g.y,
  44823. u[a + 2] = g.z,
  44824. u[a + 3] = g.x,
  44825. u[a + 4] = g.y,
  44826. u[a + 5] = g.z,
  44827. u[a + 6] = g.x,
  44828. u[a + 7] = g.y,
  44829. u[a + 8] = g.z;
  44830. this.normalizeNormals(),
  44831. t.normal.needsUpdate = !0
  44832. }
  44833. },
  44834. merge: function(e, t) {
  44835. if (e instanceof n.BufferGeometry == !1)
  44836. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  44837. void 0 === t && (t = 0);
  44838. var i = this.attributes;
  44839. for (var r in i)
  44840. if (void 0 !== e.attributes[r])
  44841. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  44842. u++)
  44843. a[u] = l[h];
  44844. return this
  44845. },
  44846. normalizeNormals: function() {
  44847. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  44848. e = r[o],
  44849. t = r[o + 1],
  44850. i = r[o + 2],
  44851. n = 1 / Math.sqrt(e * e + t * t + i * i),
  44852. r[o] *= n,
  44853. r[o + 1] *= n,
  44854. r[o + 2] *= n
  44855. },
  44856. toNonIndexed: function() {
  44857. if (null === this.index)
  44858. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  44859. this;
  44860. var e = new n.BufferGeometry
  44861. , t = this.index.array
  44862. , i = this.attributes;
  44863. for (var r in i) {
  44864. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  44865. c = t[u] * s;
  44866. for (var p = 0; p < s; p++)
  44867. l[h++] = a[c++]
  44868. }
  44869. e.addAttribute(r, new n.BufferAttribute(l,s))
  44870. }
  44871. return e
  44872. },
  44873. toJSON: function() {
  44874. var e = {
  44875. metadata: {
  44876. version: 4.4,
  44877. type: "BufferGeometry",
  44878. generator: "BufferGeometry.toJSON"
  44879. }
  44880. };
  44881. if (e.uuid = this.uuid,
  44882. e.type = this.type,
  44883. "" !== this.name && (e.name = this.name),
  44884. void 0 !== this.parameters) {
  44885. var t = this.parameters;
  44886. for (var i in t)
  44887. void 0 !== t[i] && (e[i] = t[i]);
  44888. return e
  44889. }
  44890. e.data = {
  44891. attributes: {}
  44892. };
  44893. var n = this.index;
  44894. if (null !== n) {
  44895. var r = Array.prototype.slice.call(n.array);
  44896. e.data.index = {
  44897. type: n.array.constructor.name,
  44898. array: r
  44899. }
  44900. }
  44901. var o = this.attributes;
  44902. for (var i in o) {
  44903. var a = o[i]
  44904. , r = Array.prototype.slice.call(a.array);
  44905. e.data.attributes[i] = {
  44906. itemSize: a.itemSize,
  44907. type: a.array.constructor.name,
  44908. array: r
  44909. }
  44910. }
  44911. var s = this.groups;
  44912. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  44913. var l = this.boundingSphere;
  44914. return null !== l && (e.data.boundingSphere = {
  44915. center: l.center.toArray(),
  44916. radius: l.radius
  44917. }),
  44918. e
  44919. },
  44920. clone: function() {
  44921. return (new n.BufferGeometry).copy(this)
  44922. },
  44923. copy: function(e) {
  44924. var t = e.index;
  44925. null !== t && this.setIndex(t.clone());
  44926. var i = e.attributes;
  44927. for (var n in i) {
  44928. var r = i[n];
  44929. this.addAttribute(n, r.clone())
  44930. }
  44931. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44932. var l = o[a];
  44933. this.addGroup(l.start, l.count)
  44934. }
  44935. return this
  44936. },
  44937. dispose: function() {
  44938. this.dispatchEvent({
  44939. type: "dispose"
  44940. })
  44941. }
  44942. },
  44943. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  44944. n.BufferGeometry.MaxIndex = 65535,
  44945. n.InstancedBufferGeometry = function() {
  44946. n.BufferGeometry.call(this),
  44947. this.type = "InstancedBufferGeometry",
  44948. this.maxInstancedCount = void 0
  44949. }
  44950. ,
  44951. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  44952. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  44953. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  44954. this.groups.push({
  44955. start: e,
  44956. count: t,
  44957. instances: i
  44958. })
  44959. }
  44960. ,
  44961. n.InstancedBufferGeometry.prototype.copy = function(e) {
  44962. var t = e.index;
  44963. null !== t && this.setIndex(t.clone());
  44964. var i = e.attributes;
  44965. for (var n in i) {
  44966. var r = i[n];
  44967. this.addAttribute(n, r.clone())
  44968. }
  44969. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44970. var l = o[a];
  44971. this.addGroup(l.start, l.count, l.instances)
  44972. }
  44973. return this
  44974. }
  44975. ,
  44976. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  44977. n.Uniform = function(e, t) {
  44978. this.type = e,
  44979. this.value = t,
  44980. this.dynamic = !1
  44981. }
  44982. ,
  44983. n.Uniform.prototype = {
  44984. constructor: n.Uniform,
  44985. onUpdate: function(e) {
  44986. return this.dynamic = !0,
  44987. this.onUpdateCallback = e,
  44988. this
  44989. }
  44990. },
  44991. n.AnimationClip = function(e, t, i) {
  44992. this.name = e || n.Math.generateUUID(),
  44993. this.tracks = i,
  44994. this.duration = void 0 !== t ? t : -1,
  44995. this.duration < 0 && this.resetDuration(),
  44996. this.trim(),
  44997. this.optimize()
  44998. }
  44999. ,
  45000. n.AnimationClip.prototype = {
  45001. constructor: n.AnimationClip,
  45002. resetDuration: function() {
  45003. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45004. var r = this.tracks[i];
  45005. t = Math.max(t, r.times[r.times.length - 1])
  45006. }
  45007. this.duration = t
  45008. },
  45009. trim: function() {
  45010. for (var e = 0; e < this.tracks.length; e++)
  45011. this.tracks[e].trim(0, this.duration);
  45012. return this
  45013. },
  45014. optimize: function() {
  45015. for (var e = 0; e < this.tracks.length; e++)
  45016. this.tracks[e].optimize();
  45017. return this
  45018. }
  45019. },
  45020. Object.assign(n.AnimationClip, {
  45021. parse: function(e) {
  45022. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45023. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45024. return new n.AnimationClip(e.name,e.duration,t)
  45025. },
  45026. toJSON: function(e) {
  45027. for (var t = [], i = e.tracks, r = {
  45028. name: e.name,
  45029. duration: e.duration,
  45030. tracks: t
  45031. }, o = 0, a = i.length; o !== a; ++o)
  45032. t.push(n.KeyframeTrack.toJSON(i[o]));
  45033. return r
  45034. },
  45035. CreateFromMorphTargetSequence: function(e, t, i) {
  45036. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45037. var s = []
  45038. , l = [];
  45039. s.push((a + r - 1) % r, a, (a + 1) % r),
  45040. l.push(0, 1, 0);
  45041. var c = n.AnimationUtils.getKeyframeOrder(s);
  45042. s = n.AnimationUtils.sortedArray(s, 1, c),
  45043. l = n.AnimationUtils.sortedArray(l, 1, c),
  45044. 0 === s[0] && (s.push(r),
  45045. l.push(l[0])),
  45046. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45047. }
  45048. return new n.AnimationClip(e,-1,o)
  45049. },
  45050. findByName: function(e, t) {
  45051. for (var i = 0; i < e.length; i++)
  45052. if (e[i].name === t)
  45053. return e[i];
  45054. return null
  45055. },
  45056. CreateClipsFromMorphTargetSequences: function(e, t) {
  45057. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45058. var s = e[o]
  45059. , l = s.name.match(r);
  45060. if (l && l.length > 1) {
  45061. var c = l[1]
  45062. , h = i[c];
  45063. h || (i[c] = h = []),
  45064. h.push(s)
  45065. }
  45066. }
  45067. var u = [];
  45068. for (var c in i)
  45069. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45070. return u
  45071. },
  45072. parseAnimation: function(e, t, i) {
  45073. if (!e)
  45074. return console.error(" no animation in JSONLoader data"),
  45075. null;
  45076. for (var r = function(e, t, i, r, o) {
  45077. if (0 !== i.length) {
  45078. var a = []
  45079. , s = [];
  45080. n.AnimationUtils.flattenJSON(i, a, s, r),
  45081. 0 !== a.length && o.push(new e(t,a,s))
  45082. }
  45083. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45084. var u = c[h].keys;
  45085. if (u && 0 != u.length)
  45086. if (u[0].morphTargets) {
  45087. for (var d = {}, p = 0; p < u.length; p++)
  45088. if (u[p].morphTargets)
  45089. for (var f = 0; f < u[p].morphTargets.length; f++)
  45090. d[u[p].morphTargets[f]] = -1;
  45091. for (var g in d) {
  45092. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45093. var A = u[p];
  45094. m.push(A.time),
  45095. v.push(A.morphTarget === g ? 1 : 0)
  45096. }
  45097. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45098. }
  45099. s = d.length * (l || 1)
  45100. } else {
  45101. var y = ".bones[" + t[h].name + "]";
  45102. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45103. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45104. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45105. }
  45106. }
  45107. if (0 === o.length)
  45108. return null;
  45109. var C = new n.AnimationClip(a,s,o);
  45110. return C
  45111. }
  45112. }),
  45113. n.AnimationMixer = function(e) {
  45114. this._root = e,
  45115. this._initMemoryManager(),
  45116. this._accuIndex = 0,
  45117. this.time = 0,
  45118. this.timeScale = 1
  45119. }
  45120. ,
  45121. n.AnimationMixer.prototype = {
  45122. constructor: n.AnimationMixer,
  45123. clipAction: function(e, t) {
  45124. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  45125. if (void 0 !== l) {
  45126. var c = l.actionByRoot[o];
  45127. if (void 0 !== c)
  45128. return c;
  45129. if (i = l.knownActions[0],
  45130. s = i._clip,
  45131. e !== a && e !== s)
  45132. throw new Error("Different clips with the same name detected!")
  45133. }
  45134. if (null === s)
  45135. return null;
  45136. var h = new n.AnimationMixer._Action(this,s,t);
  45137. return this._bindAction(h, i),
  45138. this._addInactiveAction(h, a, o),
  45139. h
  45140. },
  45141. existingAction: function(e, t) {
  45142. var i = t || this._root
  45143. , n = i.uuid
  45144. , r = "string" == typeof e ? e : e.name
  45145. , o = this._actionsByClip[r];
  45146. return void 0 !== o ? o.actionByRoot[n] || null : null
  45147. },
  45148. stopAllAction: function() {
  45149. var e = this._actions
  45150. , t = this._nActiveActions
  45151. , i = this._bindings
  45152. , n = this._nActiveBindings;
  45153. this._nActiveActions = 0,
  45154. this._nActiveBindings = 0;
  45155. for (var r = 0; r !== t; ++r)
  45156. e[r].reset();
  45157. for (var r = 0; r !== n; ++r)
  45158. i[r].useCount = 0;
  45159. return this
  45160. },
  45161. update: function(e) {
  45162. e *= this.timeScale;
  45163. 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) {
  45164. var s = t[a];
  45165. s.enabled && s._update(n, e, r, o)
  45166. }
  45167. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45168. l[a].apply(o);
  45169. return this
  45170. },
  45171. getRoot: function() {
  45172. return this._root
  45173. },
  45174. uncacheClip: function(e) {
  45175. var t = this._actions
  45176. , i = e.name
  45177. , n = this._actionsByClip
  45178. , r = n[i];
  45179. if (void 0 !== r) {
  45180. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45181. var l = o[a];
  45182. this._deactivateAction(l);
  45183. var c = l._cacheIndex
  45184. , h = t[t.length - 1];
  45185. l._cacheIndex = null,
  45186. l._byClipCacheIndex = null,
  45187. h._cacheIndex = c,
  45188. t[c] = h,
  45189. t.pop(),
  45190. this._removeInactiveBindingsForAction(l)
  45191. }
  45192. delete n[i]
  45193. }
  45194. },
  45195. uncacheRoot: function(e) {
  45196. var t = e.uuid
  45197. , i = this._actionsByClip;
  45198. for (var n in i) {
  45199. var r = i[n].actionByRoot
  45200. , o = r[t];
  45201. void 0 !== o && (this._deactivateAction(o),
  45202. this._removeInactiveAction(o))
  45203. }
  45204. var a = this._bindingsByRootAndName
  45205. , s = a[t];
  45206. if (void 0 !== s)
  45207. for (var l in s) {
  45208. var c = s[l];
  45209. c.restoreOriginalState(),
  45210. this._removeInactiveBinding(c)
  45211. }
  45212. },
  45213. uncacheAction: function(e, t) {
  45214. var i = this.existingAction(e, t);
  45215. null !== i && (this._deactivateAction(i),
  45216. this._removeInactiveAction(i))
  45217. }
  45218. },
  45219. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45220. n.AnimationMixer._Action = function(e, t, i) {
  45221. this._mixer = e,
  45222. this._clip = t,
  45223. this._localRoot = i || null;
  45224. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45225. endingStart: n.ZeroCurvatureEnding,
  45226. endingEnd: n.ZeroCurvatureEnding
  45227. }, l = 0; l !== o; ++l) {
  45228. var c = r[l].createInterpolant(null);
  45229. a[l] = c,
  45230. c.settings = s
  45231. }
  45232. this._interpolantSettings = s,
  45233. this._interpolants = a,
  45234. this._propertyBindings = new Array(o),
  45235. this._cacheIndex = null,
  45236. this._byClipCacheIndex = null,
  45237. this._timeScaleInterpolant = null,
  45238. this._weightInterpolant = null,
  45239. this.loop = n.LoopRepeat,
  45240. this._loopCount = -1,
  45241. this._startTime = null,
  45242. this.time = 0,
  45243. this.timeScale = 1,
  45244. this._effectiveTimeScale = 1,
  45245. this.weight = 1,
  45246. this._effectiveWeight = 1,
  45247. this.repetitions = 1 / 0,
  45248. this.paused = !1,
  45249. this.enabled = !0,
  45250. this.clampWhenFinished = !1,
  45251. this.zeroSlopeAtStart = !0,
  45252. this.zeroSlopeAtEnd = !0
  45253. }
  45254. ,
  45255. n.AnimationMixer._Action.prototype = {
  45256. constructor: n.AnimationMixer._Action,
  45257. play: function() {
  45258. return this._mixer._activateAction(this),
  45259. this
  45260. },
  45261. stop: function() {
  45262. return this._mixer._deactivateAction(this),
  45263. this.reset()
  45264. },
  45265. reset: function() {
  45266. return this.paused = !1,
  45267. this.enabled = !0,
  45268. this.time = 0,
  45269. this._loopCount = -1,
  45270. this._startTime = null,
  45271. this.stopFading().stopWarping()
  45272. },
  45273. isRunning: function() {
  45274. this._startTime;
  45275. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45276. },
  45277. isScheduled: function() {
  45278. return this._mixer._isActiveAction(this)
  45279. },
  45280. startAt: function(e) {
  45281. return this._startTime = e,
  45282. this
  45283. },
  45284. setLoop: function(e, t) {
  45285. return this.loop = e,
  45286. this.repetitions = t,
  45287. this
  45288. },
  45289. setEffectiveWeight: function(e) {
  45290. return this.weight = e,
  45291. this._effectiveWeight = this.enabled ? e : 0,
  45292. this.stopFading()
  45293. },
  45294. getEffectiveWeight: function() {
  45295. return this._effectiveWeight
  45296. },
  45297. fadeIn: function(e) {
  45298. return this._scheduleFading(e, 0, 1)
  45299. },
  45300. fadeOut: function(e) {
  45301. return this._scheduleFading(e, 1, 0)
  45302. },
  45303. crossFadeFrom: function(e, t, i) {
  45304. this._mixer;
  45305. if (e.fadeOut(t),
  45306. this.fadeIn(t),
  45307. i) {
  45308. var n = this._clip.duration
  45309. , r = e._clip.duration
  45310. , o = r / n
  45311. , a = n / r;
  45312. e.warp(1, o, t),
  45313. this.warp(a, 1, t)
  45314. }
  45315. return this
  45316. },
  45317. crossFadeTo: function(e, t, i) {
  45318. return e.crossFadeFrom(this, t, i)
  45319. },
  45320. stopFading: function() {
  45321. var e = this._weightInterpolant;
  45322. return null !== e && (this._weightInterpolant = null,
  45323. this._mixer._takeBackControlInterpolant(e)),
  45324. this
  45325. },
  45326. setEffectiveTimeScale: function(e) {
  45327. return this.timeScale = e,
  45328. this._effectiveTimeScale = this.paused ? 0 : e,
  45329. this.stopWarping()
  45330. },
  45331. getEffectiveTimeScale: function() {
  45332. return this._effectiveTimeScale
  45333. },
  45334. setDuration: function(e) {
  45335. return this.timeScale = this._clip.duration / e,
  45336. this.stopWarping()
  45337. },
  45338. syncWith: function(e) {
  45339. return this.time = e.time,
  45340. this.timeScale = e.timeScale,
  45341. this.stopWarping()
  45342. },
  45343. halt: function(e) {
  45344. return this.warp(this._currentTimeScale, 0, e)
  45345. },
  45346. warp: function(e, t, i) {
  45347. var n = this._mixer
  45348. , r = n.time
  45349. , o = this._timeScaleInterpolant
  45350. , a = this.timeScale;
  45351. null === o && (o = n._lendControlInterpolant(),
  45352. this._timeScaleInterpolant = o);
  45353. var s = o.parameterPositions
  45354. , l = o.sampleValues;
  45355. return s[0] = r,
  45356. s[1] = r + i,
  45357. l[0] = e / a,
  45358. l[1] = t / a,
  45359. this
  45360. },
  45361. stopWarping: function() {
  45362. var e = this._timeScaleInterpolant;
  45363. return null !== e && (this._timeScaleInterpolant = null,
  45364. this._mixer._takeBackControlInterpolant(e)),
  45365. this
  45366. },
  45367. getMixer: function() {
  45368. return this._mixer
  45369. },
  45370. getClip: function() {
  45371. return this._clip
  45372. },
  45373. getRoot: function() {
  45374. return this._localRoot || this._mixer._root
  45375. },
  45376. _update: function(e, t, i, n) {
  45377. var r = this._startTime;
  45378. if (null !== r) {
  45379. var o = (e - r) * i;
  45380. if (o < 0 || 0 === i)
  45381. return;
  45382. this._startTime = null,
  45383. t = i * o
  45384. }
  45385. t *= this._updateTimeScale(e);
  45386. var a = this._updateTime(t)
  45387. , s = this._updateWeight(e);
  45388. if (s > 0)
  45389. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45390. l[h].evaluate(a),
  45391. c[h].accumulate(n, s)
  45392. },
  45393. _updateWeight: function(e) {
  45394. var t = 0;
  45395. if (this.enabled) {
  45396. t = this.weight;
  45397. var i = this._weightInterpolant;
  45398. if (null !== i) {
  45399. var n = i.evaluate(e)[0];
  45400. t *= n,
  45401. e > i.parameterPositions[1] && (this.stopFading(),
  45402. 0 === n && (this.enabled = !1))
  45403. }
  45404. }
  45405. return this._effectiveWeight = t,
  45406. t
  45407. },
  45408. _updateTimeScale: function(e) {
  45409. var t = 0;
  45410. if (!this.paused) {
  45411. t = this.timeScale;
  45412. var i = this._timeScaleInterpolant;
  45413. if (null !== i) {
  45414. var n = i.evaluate(e)[0];
  45415. t *= n,
  45416. e > i.parameterPositions[1] && (this.stopWarping(),
  45417. 0 === t ? this.pause = !0 : this.timeScale = t)
  45418. }
  45419. }
  45420. return this._effectiveTimeScale = t,
  45421. t
  45422. },
  45423. _updateTime: function(e) {
  45424. var t = this.time + e;
  45425. if (0 === e)
  45426. return t;
  45427. var i = this._clip.duration
  45428. , r = this.loop
  45429. , o = this._loopCount
  45430. , a = !1;
  45431. switch (r) {
  45432. case n.LoopOnce:
  45433. if (o === -1 && (this.loopCount = 0,
  45434. this._setEndings(!0, !0, !1)),
  45435. t >= i)
  45436. t = i;
  45437. else {
  45438. if (!(t < 0))
  45439. break;
  45440. t = 0
  45441. }
  45442. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45443. this._mixer.dispatchEvent({
  45444. type: "finished",
  45445. action: this,
  45446. direction: e < 0 ? -1 : 1
  45447. });
  45448. break;
  45449. case n.LoopPingPong:
  45450. a = !0;
  45451. case n.LoopRepeat:
  45452. if (o === -1 && (e > 0 ? (o = 0,
  45453. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  45454. t >= i || t < 0) {
  45455. var s = Math.floor(t / i);
  45456. t -= i * s,
  45457. o += Math.abs(s);
  45458. var l = this.repetitions - o;
  45459. if (l < 0) {
  45460. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  45461. t = e > 0 ? i : 0,
  45462. this._mixer.dispatchEvent({
  45463. type: "finished",
  45464. action: this,
  45465. direction: e > 0 ? 1 : -1
  45466. });
  45467. break
  45468. }
  45469. if (0 === l) {
  45470. var c = e < 0;
  45471. this._setEndings(c, !c, a)
  45472. } else
  45473. this._setEndings(!1, !1, a);
  45474. this._loopCount = o,
  45475. this._mixer.dispatchEvent({
  45476. type: "loop",
  45477. action: this,
  45478. loopDelta: s
  45479. })
  45480. }
  45481. if (r === n.LoopPingPong && 1 === (1 & o))
  45482. return this.time = t,
  45483. i - t
  45484. }
  45485. return this.time = t,
  45486. t
  45487. },
  45488. _setEndings: function(e, t, i) {
  45489. var r = this._interpolantSettings;
  45490. i ? (r.endingStart = n.ZeroSlopeEnding,
  45491. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  45492. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  45493. },
  45494. _scheduleFading: function(e, t, i) {
  45495. var n = this._mixer
  45496. , r = n.time
  45497. , o = this._weightInterpolant;
  45498. null === o && (o = n._lendControlInterpolant(),
  45499. this._weightInterpolant = o);
  45500. var a = o.parameterPositions
  45501. , s = o.sampleValues;
  45502. return a[0] = r,
  45503. s[0] = t,
  45504. a[1] = r + e,
  45505. s[1] = i,
  45506. this
  45507. }
  45508. },
  45509. Object.assign(n.AnimationMixer.prototype, {
  45510. _bindAction: function(e, t) {
  45511. var i = e._localRoot || this._root
  45512. , r = e._clip.tracks
  45513. , o = r.length
  45514. , a = e._propertyBindings
  45515. , s = e._interpolants
  45516. , l = i.uuid
  45517. , c = this._bindingsByRootAndName
  45518. , h = c[l];
  45519. void 0 === h && (h = {},
  45520. c[l] = h);
  45521. for (var u = 0; u !== o; ++u) {
  45522. var d = r[u]
  45523. , p = d.name
  45524. , f = h[p];
  45525. if (void 0 !== f)
  45526. a[u] = f;
  45527. else {
  45528. if (f = a[u],
  45529. void 0 !== f) {
  45530. null === f._cacheIndex && (++f.referenceCount,
  45531. this._addInactiveBinding(f, l, p));
  45532. continue
  45533. }
  45534. var g = t && t._propertyBindings[u].binding.parsedPath;
  45535. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  45536. ++f.referenceCount,
  45537. this._addInactiveBinding(f, l, p),
  45538. a[u] = f
  45539. }
  45540. s[u].resultBuffer = f.buffer
  45541. }
  45542. },
  45543. _activateAction: function(e) {
  45544. if (!this._isActiveAction(e)) {
  45545. if (null === e._cacheIndex) {
  45546. var t = (e._localRoot || this._root).uuid
  45547. , i = e._clip.name
  45548. , n = this._actionsByClip[i];
  45549. this._bindAction(e, n && n.knownActions[0]),
  45550. this._addInactiveAction(e, i, t)
  45551. }
  45552. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  45553. var s = r[o];
  45554. 0 === s.useCount++ && (this._lendBinding(s),
  45555. s.saveOriginalState())
  45556. }
  45557. this._lendAction(e)
  45558. }
  45559. },
  45560. _deactivateAction: function(e) {
  45561. if (this._isActiveAction(e)) {
  45562. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45563. var r = t[i];
  45564. 0 === --r.useCount && (r.restoreOriginalState(),
  45565. this._takeBackBinding(r))
  45566. }
  45567. this._takeBackAction(e)
  45568. }
  45569. },
  45570. _initMemoryManager: function() {
  45571. this._actions = [],
  45572. this._nActiveActions = 0,
  45573. this._actionsByClip = {},
  45574. this._bindings = [],
  45575. this._nActiveBindings = 0,
  45576. this._bindingsByRootAndName = {},
  45577. this._controlInterpolants = [],
  45578. this._nActiveControlInterpolants = 0;
  45579. var e = this;
  45580. this.stats = {
  45581. actions: {
  45582. get total() {
  45583. return e._actions.length
  45584. },
  45585. get inUse() {
  45586. return e._nActiveActions
  45587. }
  45588. },
  45589. bindings: {
  45590. get total() {
  45591. return e._bindings.length
  45592. },
  45593. get inUse() {
  45594. return e._nActiveBindings
  45595. }
  45596. },
  45597. controlInterpolants: {
  45598. get total() {
  45599. return e._controlInterpolants.length
  45600. },
  45601. get inUse() {
  45602. return e._nActiveControlInterpolants
  45603. }
  45604. }
  45605. }
  45606. },
  45607. _isActiveAction: function(e) {
  45608. var t = e._cacheIndex;
  45609. return null !== t && t < this._nActiveActions
  45610. },
  45611. _addInactiveAction: function(e, t, i) {
  45612. var n = this._actions
  45613. , r = this._actionsByClip
  45614. , o = r[t];
  45615. if (void 0 === o)
  45616. o = {
  45617. knownActions: [e],
  45618. actionByRoot: {}
  45619. },
  45620. e._byClipCacheIndex = 0,
  45621. r[t] = o;
  45622. else {
  45623. var a = o.knownActions;
  45624. e._byClipCacheIndex = a.length,
  45625. a.push(e)
  45626. }
  45627. e._cacheIndex = n.length,
  45628. n.push(e),
  45629. o.actionByRoot[i] = e
  45630. },
  45631. _removeInactiveAction: function(e) {
  45632. var t = this._actions
  45633. , i = t[t.length - 1]
  45634. , n = e._cacheIndex;
  45635. i._cacheIndex = n,
  45636. t[n] = i,
  45637. t.pop(),
  45638. e._cacheIndex = null;
  45639. var r = e._clip.name
  45640. , o = this._actionsByClip
  45641. , a = o[r]
  45642. , s = a.knownActions
  45643. , l = s[s.length - 1]
  45644. , c = e._byClipCacheIndex;
  45645. l._byClipCacheIndex = c,
  45646. s[c] = l,
  45647. s.pop(),
  45648. e._byClipCacheIndex = null;
  45649. var h = a.actionByRoot
  45650. , u = (t._localRoot || this._root).uuid;
  45651. delete h[u],
  45652. 0 === s.length && delete o[r],
  45653. this._removeInactiveBindingsForAction(e)
  45654. },
  45655. _removeInactiveBindingsForAction: function(e) {
  45656. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45657. var r = t[i];
  45658. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  45659. }
  45660. },
  45661. _lendAction: function(e) {
  45662. var t = this._actions
  45663. , i = e._cacheIndex
  45664. , n = this._nActiveActions++
  45665. , r = t[n];
  45666. e._cacheIndex = n,
  45667. t[n] = e,
  45668. r._cacheIndex = i,
  45669. t[i] = r
  45670. },
  45671. _takeBackAction: function(e) {
  45672. var t = this._actions
  45673. , i = e._cacheIndex
  45674. , n = --this._nActiveActions
  45675. , r = t[n];
  45676. e._cacheIndex = n,
  45677. t[n] = e,
  45678. r._cacheIndex = i,
  45679. t[i] = r
  45680. },
  45681. _addInactiveBinding: function(e, t, i) {
  45682. var n = this._bindingsByRootAndName
  45683. , r = n[t]
  45684. , o = this._bindings;
  45685. void 0 === r && (r = {},
  45686. n[t] = r),
  45687. r[i] = e,
  45688. e._cacheIndex = o.length,
  45689. o.push(e)
  45690. },
  45691. _removeInactiveBinding: function(e) {
  45692. var t = this._bindings
  45693. , i = e.binding
  45694. , n = i.rootNode.uuid
  45695. , r = i.path
  45696. , o = this._bindingsByRootAndName
  45697. , a = o[n]
  45698. , s = t[t.length - 1]
  45699. , l = e._cacheIndex;
  45700. s._cacheIndex = l,
  45701. t[l] = s,
  45702. t.pop(),
  45703. delete a[r];
  45704. e: {
  45705. for (var c in a)
  45706. break e;
  45707. delete o[n]
  45708. }
  45709. },
  45710. _lendBinding: function(e) {
  45711. var t = this._bindings
  45712. , i = e._cacheIndex
  45713. , n = this._nActiveBindings++
  45714. , r = t[n];
  45715. e._cacheIndex = n,
  45716. t[n] = e,
  45717. r._cacheIndex = i,
  45718. t[i] = r
  45719. },
  45720. _takeBackBinding: function(e) {
  45721. var t = this._bindings
  45722. , i = e._cacheIndex
  45723. , n = --this._nActiveBindings
  45724. , r = t[n];
  45725. e._cacheIndex = n,
  45726. t[n] = e,
  45727. r._cacheIndex = i,
  45728. t[i] = r
  45729. },
  45730. _lendControlInterpolant: function() {
  45731. var e = this._controlInterpolants
  45732. , t = this._nActiveControlInterpolants++
  45733. , i = e[t];
  45734. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  45735. i.__cacheIndex = t,
  45736. e[t] = i),
  45737. i
  45738. },
  45739. _takeBackControlInterpolant: function(e) {
  45740. var t = this._controlInterpolants
  45741. , i = e.__cacheIndex
  45742. , n = --this._nActiveControlInterpolants
  45743. , r = t[n];
  45744. e.__cacheIndex = n,
  45745. t[n] = e,
  45746. r.__cacheIndex = i,
  45747. t[i] = r
  45748. },
  45749. _controlInterpolantsResultBuffer: new Float32Array(1)
  45750. }),
  45751. n.AnimationObjectGroup = function(e) {
  45752. this.uuid = n.Math.generateUUID(),
  45753. this._objects = Array.prototype.slice.call(arguments),
  45754. this.nCachedObjects_ = 0;
  45755. var t = {};
  45756. this._indicesByUUID = t;
  45757. for (var i = 0, r = arguments.length; i !== r; ++i)
  45758. t[arguments[i].uuid] = i;
  45759. this._paths = [],
  45760. this._parsedPaths = [],
  45761. this._bindings = [],
  45762. this._bindingsIndicesByPath = {};
  45763. var o = this;
  45764. this.stats = {
  45765. objects: {
  45766. get total() {
  45767. return o._objects.length
  45768. },
  45769. get inUse() {
  45770. return this.total - o.nCachedObjects_
  45771. }
  45772. },
  45773. get bindingsPerObject() {
  45774. return o._bindings.length
  45775. }
  45776. }
  45777. }
  45778. ,
  45779. n.AnimationObjectGroup.prototype = {
  45780. constructor: n.AnimationObjectGroup,
  45781. add: function(e) {
  45782. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  45783. var d = arguments[h]
  45784. , p = d.uuid
  45785. , f = o[p];
  45786. if (void 0 === f) {
  45787. f = i++,
  45788. o[p] = f,
  45789. t.push(d);
  45790. for (var g = 0, m = c; g !== m; ++g)
  45791. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  45792. } else if (f < r) {
  45793. var v = t[f]
  45794. , A = --r
  45795. , y = t[A];
  45796. o[y.uuid] = f,
  45797. t[f] = y,
  45798. o[p] = A,
  45799. t[A] = d;
  45800. for (var g = 0, m = c; g !== m; ++g) {
  45801. var C = l[g]
  45802. , I = C[A]
  45803. , E = C[f];
  45804. C[f] = I,
  45805. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  45806. C[A] = E
  45807. }
  45808. } else
  45809. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  45810. }
  45811. this.nCachedObjects_ = r
  45812. },
  45813. remove: function(e) {
  45814. for (var t = this._objects, i = (t.length,
  45815. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  45816. var l = arguments[a]
  45817. , c = l.uuid
  45818. , h = n[c];
  45819. if (void 0 !== h && h >= i) {
  45820. var u = i++
  45821. , d = t[u];
  45822. n[d.uuid] = h,
  45823. t[h] = d,
  45824. n[c] = u,
  45825. t[u] = l;
  45826. for (var p = 0, f = o; p !== f; ++p) {
  45827. var g = r[p]
  45828. , m = g[u]
  45829. , v = g[h];
  45830. g[h] = m,
  45831. g[u] = v
  45832. }
  45833. }
  45834. }
  45835. this.nCachedObjects_ = i
  45836. },
  45837. uncache: function(e) {
  45838. 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) {
  45839. var c = arguments[s]
  45840. , h = c.uuid
  45841. , u = r[h];
  45842. if (void 0 !== u)
  45843. if (delete r[h],
  45844. u < n) {
  45845. var d = --n
  45846. , p = t[d]
  45847. , f = --i
  45848. , g = t[f];
  45849. r[p.uuid] = u,
  45850. t[u] = p,
  45851. r[g.uuid] = d,
  45852. t[d] = g,
  45853. t.pop();
  45854. for (var m = 0, v = a; m !== v; ++m) {
  45855. var A = o[m]
  45856. , y = A[d]
  45857. , C = A[f];
  45858. A[u] = y,
  45859. A[d] = C,
  45860. A.pop()
  45861. }
  45862. } else {
  45863. var f = --i
  45864. , g = t[f];
  45865. r[g.uuid] = u,
  45866. t[u] = g,
  45867. t.pop();
  45868. for (var m = 0, v = a; m !== v; ++m) {
  45869. var A = o[m];
  45870. A[u] = A[f],
  45871. A.pop()
  45872. }
  45873. }
  45874. }
  45875. this.nCachedObjects_ = n
  45876. },
  45877. subscribe_: function(e, t) {
  45878. var i = this._bindingsIndicesByPath
  45879. , r = i[e]
  45880. , o = this._bindings;
  45881. if (void 0 !== r)
  45882. return o[r];
  45883. var a = this._paths
  45884. , s = this._parsedPaths
  45885. , l = this._objects
  45886. , c = l.length
  45887. , h = this.nCachedObjects_
  45888. , u = new Array(c);
  45889. r = o.length,
  45890. i[e] = r,
  45891. a.push(e),
  45892. s.push(t),
  45893. o.push(u);
  45894. for (var d = h, p = l.length; d !== p; ++d) {
  45895. var f = l[d];
  45896. u[d] = new n.PropertyBinding(f,e,t)
  45897. }
  45898. return u
  45899. },
  45900. unsubscribe_: function(e) {
  45901. var t = this._bindingsIndicesByPath
  45902. , i = t[e];
  45903. if (void 0 !== i) {
  45904. var n = this._paths
  45905. , r = this._parsedPaths
  45906. , o = this._bindings
  45907. , a = o.length - 1
  45908. , s = o[a]
  45909. , l = e[a];
  45910. t[l] = i,
  45911. o[i] = s,
  45912. o.pop(),
  45913. r[i] = r[a],
  45914. r.pop(),
  45915. n[i] = n[a],
  45916. n.pop()
  45917. }
  45918. }
  45919. },
  45920. n.AnimationUtils = {
  45921. arraySlice: function(e, t, i) {
  45922. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  45923. },
  45924. convertArray: function(e, t, i) {
  45925. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  45926. },
  45927. isTypedArray: function(e) {
  45928. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  45929. },
  45930. getKeyframeOrder: function(e) {
  45931. function t(t, i) {
  45932. return e[t] - e[i]
  45933. }
  45934. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  45935. n[r] = r;
  45936. return n.sort(t),
  45937. n
  45938. },
  45939. sortedArray: function(e, t, i) {
  45940. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  45941. for (var s = i[o] * t, l = 0; l !== t; ++l)
  45942. r[a++] = e[s + l];
  45943. return r
  45944. },
  45945. flattenJSON: function(e, t, i, n) {
  45946. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  45947. o = e[r++];
  45948. if (void 0 !== o) {
  45949. var a = o[n];
  45950. if (void 0 !== a)
  45951. if (Array.isArray(a)) {
  45952. do
  45953. a = o[n],
  45954. void 0 !== a && (t.push(o.time),
  45955. i.push.apply(i, a)),
  45956. o = e[r++];
  45957. while (void 0 !== o)
  45958. } else if (void 0 !== a.toArray) {
  45959. do
  45960. a = o[n],
  45961. void 0 !== a && (t.push(o.time),
  45962. a.toArray(i, i.length)),
  45963. o = e[r++];
  45964. while (void 0 !== o)
  45965. } else
  45966. do
  45967. a = o[n],
  45968. void 0 !== a && (t.push(o.time),
  45969. i.push(a)),
  45970. o = e[r++];
  45971. while (void 0 !== o)
  45972. }
  45973. }
  45974. },
  45975. n.KeyframeTrack = function(e, t, i, r) {
  45976. if (void 0 === e)
  45977. throw new Error("track name is undefined");
  45978. if (void 0 === t || 0 === t.length)
  45979. throw new Error("no keyframes in track named " + e);
  45980. this.name = e,
  45981. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  45982. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  45983. this.setInterpolation(r || this.DefaultInterpolation),
  45984. this.validate(),
  45985. this.optimize()
  45986. }
  45987. ,
  45988. n.KeyframeTrack.prototype = {
  45989. constructor: n.KeyframeTrack,
  45990. TimeBufferType: Float32Array,
  45991. ValueBufferType: Float32Array,
  45992. DefaultInterpolation: n.InterpolateLinear,
  45993. InterpolantFactoryMethodDiscrete: function(e) {
  45994. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  45995. },
  45996. InterpolantFactoryMethodLinear: function(e) {
  45997. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  45998. },
  45999. InterpolantFactoryMethodSmooth: function(e) {
  46000. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46001. },
  46002. setInterpolation: function(e) {
  46003. var t = void 0;
  46004. switch (e) {
  46005. case n.InterpolateDiscrete:
  46006. t = this.InterpolantFactoryMethodDiscrete;
  46007. break;
  46008. case n.InterpolateLinear:
  46009. t = this.InterpolantFactoryMethodLinear;
  46010. break;
  46011. case n.InterpolateSmooth:
  46012. t = this.InterpolantFactoryMethodSmooth
  46013. }
  46014. if (void 0 === t) {
  46015. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46016. if (void 0 === this.createInterpolant) {
  46017. if (e === this.DefaultInterpolation)
  46018. throw new Error(i);
  46019. this.setInterpolation(this.DefaultInterpolation)
  46020. }
  46021. return void console.warn(i)
  46022. }
  46023. this.createInterpolant = t
  46024. },
  46025. getInterpolation: function() {
  46026. switch (this.createInterpolant) {
  46027. case this.InterpolantFactoryMethodDiscrete:
  46028. return n.InterpolateDiscrete;
  46029. case this.InterpolantFactoryMethodLinear:
  46030. return n.InterpolateLinear;
  46031. case this.InterpolantFactoryMethodSmooth:
  46032. return n.InterpolateSmooth
  46033. }
  46034. },
  46035. getValueSize: function() {
  46036. return this.values.length / this.times.length
  46037. },
  46038. shift: function(e) {
  46039. if (0 !== e)
  46040. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46041. t[i] += e;
  46042. return this
  46043. },
  46044. scale: function(e) {
  46045. if (1 !== e)
  46046. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46047. t[i] *= e;
  46048. return this
  46049. },
  46050. trim: function(e, t) {
  46051. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46052. ++o;
  46053. for (; a !== -1 && i[a] > t; )
  46054. --a;
  46055. if (++a,
  46056. 0 !== o || a !== r) {
  46057. o >= a && (a = Math.max(a, 1),
  46058. o = a - 1);
  46059. var s = this.getValueSize();
  46060. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46061. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46062. }
  46063. return this
  46064. },
  46065. validate: function() {
  46066. var e = !0
  46067. , t = this.getValueSize();
  46068. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46069. e = !1);
  46070. var i = this.times
  46071. , r = this.values
  46072. , o = i.length;
  46073. 0 === o && (console.error("track is empty", this),
  46074. e = !1);
  46075. for (var a = null, s = 0; s !== o; s++) {
  46076. var l = i[s];
  46077. if ("number" == typeof l && isNaN(l)) {
  46078. console.error("time is not a valid number", this, s, l),
  46079. e = !1;
  46080. break
  46081. }
  46082. if (null !== a && a > l) {
  46083. console.error("out of order keys", this, s, l, a),
  46084. e = !1;
  46085. break
  46086. }
  46087. a = l
  46088. }
  46089. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46090. for (var s = 0, c = r.length; s !== c; ++s) {
  46091. var h = r[s];
  46092. if (isNaN(h)) {
  46093. console.error("value is not a valid number", this, s, h),
  46094. e = !1;
  46095. break
  46096. }
  46097. }
  46098. return e
  46099. },
  46100. optimize: function() {
  46101. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46102. var s = !1
  46103. , l = e[o]
  46104. , c = e[o + 1];
  46105. if (l !== c && (1 !== o || l !== l[0]))
  46106. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46107. var f = t[h + p];
  46108. if (f !== t[u + p] || f !== t[d + p]) {
  46109. s = !0;
  46110. break
  46111. }
  46112. }
  46113. if (s) {
  46114. if (o !== r) {
  46115. e[r] = e[o];
  46116. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46117. t[m + p] = t[g + p]
  46118. }
  46119. ++r
  46120. }
  46121. }
  46122. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46123. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46124. this
  46125. }
  46126. },
  46127. Object.assign(n.KeyframeTrack, {
  46128. parse: function(e) {
  46129. if (void 0 === e.type)
  46130. throw new Error("track type undefined, can not parse");
  46131. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46132. if (void 0 === e.times) {
  46133. console.warn("legacy JSON format detected, converting");
  46134. var i = []
  46135. , r = [];
  46136. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46137. e.times = i,
  46138. e.values = r
  46139. }
  46140. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46141. },
  46142. toJSON: function(e) {
  46143. var t, i = e.constructor;
  46144. if (void 0 !== i.toJSON)
  46145. t = i.toJSON(e);
  46146. else {
  46147. t = {
  46148. name: e.name,
  46149. times: n.AnimationUtils.convertArray(e.times, Array),
  46150. values: n.AnimationUtils.convertArray(e.values, Array)
  46151. };
  46152. var r = e.getInterpolation();
  46153. r !== e.DefaultInterpolation && (t.interpolation = r)
  46154. }
  46155. return t.type = e.ValueTypeName,
  46156. t
  46157. },
  46158. _getTrackTypeForValueTypeName: function(e) {
  46159. switch (e.toLowerCase()) {
  46160. case "scalar":
  46161. case "double":
  46162. case "float":
  46163. case "number":
  46164. case "integer":
  46165. return n.NumberKeyframeTrack;
  46166. case "vector":
  46167. case "vector2":
  46168. case "vector3":
  46169. case "vector4":
  46170. return n.VectorKeyframeTrack;
  46171. case "color":
  46172. return n.ColorKeyframeTrack;
  46173. case "quaternion":
  46174. return n.QuaternionKeyframeTrack;
  46175. case "bool":
  46176. case "boolean":
  46177. return n.BooleanKeyframeTrack;
  46178. case "string":
  46179. return n.StringKeyframeTrack
  46180. }
  46181. throw new Error("Unsupported typeName: " + e)
  46182. }
  46183. }),
  46184. n.PropertyBinding = function(e, t, i) {
  46185. this.path = t,
  46186. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46187. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46188. this.rootNode = e
  46189. }
  46190. ,
  46191. n.PropertyBinding.prototype = {
  46192. constructor: n.PropertyBinding,
  46193. getValue: function(e, t) {
  46194. this.bind(),
  46195. this.getValue(e, t)
  46196. },
  46197. setValue: function(e, t) {
  46198. this.bind(),
  46199. this.setValue(e, t)
  46200. },
  46201. bind: function() {
  46202. var e = this.node
  46203. , t = this.parsedPath
  46204. , i = t.objectName
  46205. , r = t.propertyName
  46206. , o = t.propertyIndex;
  46207. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46208. this.node = e),
  46209. this.getValue = this._getValue_unavailable,
  46210. this.setValue = this._setValue_unavailable,
  46211. !e)
  46212. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46213. if (i) {
  46214. var a = t.objectIndex;
  46215. switch (i) {
  46216. case "materials":
  46217. if (!e.material)
  46218. return void console.error(" can not bind to material as node does not have a material", this);
  46219. if (!e.material.materials)
  46220. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46221. e = e.material.materials;
  46222. break;
  46223. case "bones":
  46224. if (!e.skeleton)
  46225. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46226. e = e.skeleton.bones;
  46227. for (var s = 0; s < e.length; s++)
  46228. if (e[s].name === a) {
  46229. a = s;
  46230. break
  46231. }
  46232. break;
  46233. default:
  46234. if (void 0 === e[i])
  46235. return void console.error(" can not bind to objectName of node, undefined", this);
  46236. e = e[i]
  46237. }
  46238. if (void 0 !== a) {
  46239. if (void 0 === e[a])
  46240. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46241. e = e[a]
  46242. }
  46243. }
  46244. var l = e[r];
  46245. if (!l) {
  46246. var c = t.nodeName;
  46247. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46248. }
  46249. var h = this.Versioning.None;
  46250. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46251. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46252. this.targetObject = e);
  46253. var u = this.BindingType.Direct;
  46254. if (void 0 !== o) {
  46255. if ("morphTargetInfluences" === r) {
  46256. if (!e.geometry)
  46257. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46258. if (!e.geometry.morphTargets)
  46259. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46260. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46261. if (e.geometry.morphTargets[s].name === o) {
  46262. o = s;
  46263. break
  46264. }
  46265. }
  46266. u = this.BindingType.ArrayElement,
  46267. this.resolvedProperty = l,
  46268. this.propertyIndex = o
  46269. } else
  46270. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46271. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46272. this.resolvedProperty = l) : this.propertyName = r;
  46273. this.getValue = this.GetterByBindingType[u],
  46274. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46275. },
  46276. unbind: function() {
  46277. this.node = null,
  46278. this.getValue = this._getValue_unbound,
  46279. this.setValue = this._setValue_unbound
  46280. }
  46281. },
  46282. Object.assign(n.PropertyBinding.prototype, {
  46283. _getValue_unavailable: function() {},
  46284. _setValue_unavailable: function() {},
  46285. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46286. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46287. BindingType: {
  46288. Direct: 0,
  46289. EntireArray: 1,
  46290. ArrayElement: 2,
  46291. HasFromToArray: 3
  46292. },
  46293. Versioning: {
  46294. None: 0,
  46295. NeedsUpdate: 1,
  46296. MatrixWorldNeedsUpdate: 2
  46297. },
  46298. GetterByBindingType: [function(e, t) {
  46299. e[t] = this.node[this.propertyName]
  46300. }
  46301. , function(e, t) {
  46302. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46303. e[t++] = i[n]
  46304. }
  46305. , function(e, t) {
  46306. e[t] = this.resolvedProperty[this.propertyIndex]
  46307. }
  46308. , function(e, t) {
  46309. this.resolvedProperty.toArray(e, t)
  46310. }
  46311. ],
  46312. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46313. this.node[this.propertyName] = e[t]
  46314. }
  46315. , function(e, t) {
  46316. this.node[this.propertyName] = e[t],
  46317. this.targetObject.needsUpdate = !0
  46318. }
  46319. , function(e, t) {
  46320. this.node[this.propertyName] = e[t],
  46321. this.targetObject.matrixWorldNeedsUpdate = !0
  46322. }
  46323. ], [function(e, t) {
  46324. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46325. i[n] = e[t++]
  46326. }
  46327. , function(e, t) {
  46328. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46329. i[n] = e[t++];
  46330. this.targetObject.needsUpdate = !0
  46331. }
  46332. , function(e, t) {
  46333. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46334. i[n] = e[t++];
  46335. this.targetObject.matrixWorldNeedsUpdate = !0
  46336. }
  46337. ], [function(e, t) {
  46338. this.resolvedProperty[this.propertyIndex] = e[t]
  46339. }
  46340. , function(e, t) {
  46341. this.resolvedProperty[this.propertyIndex] = e[t],
  46342. this.targetObject.needsUpdate = !0
  46343. }
  46344. , function(e, t) {
  46345. this.resolvedProperty[this.propertyIndex] = e[t],
  46346. this.targetObject.matrixWorldNeedsUpdate = !0
  46347. }
  46348. ], [function(e, t) {
  46349. this.resolvedProperty.fromArray(e, t)
  46350. }
  46351. , function(e, t) {
  46352. this.resolvedProperty.fromArray(e, t),
  46353. this.targetObject.needsUpdate = !0
  46354. }
  46355. , function(e, t) {
  46356. this.resolvedProperty.fromArray(e, t),
  46357. this.targetObject.matrixWorldNeedsUpdate = !0
  46358. }
  46359. ]]
  46360. }),
  46361. n.PropertyBinding.Composite = function(e, t, i) {
  46362. var r = i || n.PropertyBinding.parseTrackName(t);
  46363. this._targetGroup = e,
  46364. this._bindings = e.subscribe_(t, r)
  46365. }
  46366. ,
  46367. n.PropertyBinding.Composite.prototype = {
  46368. constructor: n.PropertyBinding.Composite,
  46369. getValue: function(e, t) {
  46370. this.bind();
  46371. var i = this._targetGroup.nCachedObjects_
  46372. , n = this._bindings[i];
  46373. void 0 !== n && n.getValue(e, t)
  46374. },
  46375. setValue: function(e, t) {
  46376. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46377. i[n].setValue(e, t)
  46378. },
  46379. bind: function() {
  46380. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46381. e[t].bind()
  46382. },
  46383. unbind: function() {
  46384. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46385. e[t].unbind()
  46386. }
  46387. },
  46388. n.PropertyBinding.create = function(e, t, i) {
  46389. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46390. }
  46391. ,
  46392. n.PropertyBinding.parseTrackName = function(e) {
  46393. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46394. , i = t.exec(e);
  46395. if (!i)
  46396. throw new Error("cannot parse trackName at all: " + e);
  46397. i.index === t.lastIndex && t.lastIndex++;
  46398. var n = {
  46399. nodeName: i[3],
  46400. objectName: i[5],
  46401. objectIndex: i[7],
  46402. propertyName: i[9],
  46403. propertyIndex: i[11]
  46404. };
  46405. if (null === n.propertyName || 0 === n.propertyName.length)
  46406. throw new Error("can not parse propertyName from trackName: " + e);
  46407. return n
  46408. }
  46409. ,
  46410. n.PropertyBinding.findNode = function(e, t) {
  46411. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46412. return e;
  46413. if (e.skeleton) {
  46414. var i = function(e) {
  46415. for (var i = 0; i < e.bones.length; i++) {
  46416. var n = e.bones[i];
  46417. if (n.name === t)
  46418. return n
  46419. }
  46420. return null
  46421. }
  46422. , n = i(e.skeleton);
  46423. if (n)
  46424. return n
  46425. }
  46426. if (e.children) {
  46427. var r = function(e) {
  46428. for (var i = 0; i < e.length; i++) {
  46429. var n = e[i];
  46430. if (n.name === t || n.uuid === t)
  46431. return n;
  46432. var o = r(n.children);
  46433. if (o)
  46434. return o
  46435. }
  46436. return null
  46437. }
  46438. , o = r(e.children);
  46439. if (o)
  46440. return o
  46441. }
  46442. return null
  46443. }
  46444. ,
  46445. n.PropertyMixer = function(e, t, i) {
  46446. this.binding = e,
  46447. this.valueSize = i;
  46448. var n, r = Float64Array;
  46449. switch (t) {
  46450. case "quaternion":
  46451. n = this._slerp;
  46452. break;
  46453. case "string":
  46454. case "bool":
  46455. r = Array,
  46456. n = this._select;
  46457. break;
  46458. default:
  46459. n = this._lerp
  46460. }
  46461. this.buffer = new r(4 * i),
  46462. this._mixBufferRegion = n,
  46463. this.cumulativeWeight = 0,
  46464. this.useCount = 0,
  46465. this.referenceCount = 0
  46466. }
  46467. ,
  46468. n.PropertyMixer.prototype = {
  46469. constructor: n.PropertyMixer,
  46470. accumulate: function(e, t) {
  46471. var i = this.buffer
  46472. , n = this.valueSize
  46473. , r = e * n + n
  46474. , o = this.cumulativeWeight;
  46475. if (0 === o) {
  46476. for (var a = 0; a !== n; ++a)
  46477. i[r + a] = i[a];
  46478. o = t
  46479. } else {
  46480. o += t;
  46481. var s = t / o;
  46482. this._mixBufferRegion(i, r, 0, s, n)
  46483. }
  46484. this.cumulativeWeight = o
  46485. },
  46486. apply: function(e) {
  46487. var t = this.valueSize
  46488. , i = this.buffer
  46489. , n = e * t + t
  46490. , r = this.cumulativeWeight
  46491. , o = this.binding;
  46492. if (this.cumulativeWeight = 0,
  46493. r < 1) {
  46494. var a = 3 * t;
  46495. this._mixBufferRegion(i, n, a, 1 - r, t)
  46496. }
  46497. for (var s = t, l = t + t; s !== l; ++s)
  46498. if (i[s] !== i[s + t]) {
  46499. o.setValue(i, n);
  46500. break
  46501. }
  46502. },
  46503. saveOriginalState: function() {
  46504. var e = this.binding
  46505. , t = this.buffer
  46506. , i = this.valueSize
  46507. , n = 3 * i;
  46508. e.getValue(t, n);
  46509. for (var r = i, o = n; r !== o; ++r)
  46510. t[r] = t[n + r % i];
  46511. this.cumulativeWeight = 0
  46512. },
  46513. restoreOriginalState: function() {
  46514. var e = 3 * this.valueSize;
  46515. this.binding.setValue(this.buffer, e)
  46516. },
  46517. _select: function(e, t, i, n, r) {
  46518. if (n >= .5)
  46519. for (var o = 0; o !== r; ++o)
  46520. e[t + o] = e[i + o]
  46521. },
  46522. _slerp: function(e, t, i, r, o) {
  46523. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  46524. },
  46525. _lerp: function(e, t, i, n, r) {
  46526. for (var o = 1 - n, a = 0; a !== r; ++a) {
  46527. var s = t + a;
  46528. e[s] = e[s] * o + e[i + a] * n
  46529. }
  46530. }
  46531. },
  46532. n.BooleanKeyframeTrack = function(e, t, i) {
  46533. n.KeyframeTrack.call(this, e, t, i)
  46534. }
  46535. ,
  46536. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46537. constructor: n.BooleanKeyframeTrack,
  46538. ValueTypeName: "bool",
  46539. ValueBufferType: Array,
  46540. DefaultInterpolation: n.IntepolateDiscrete,
  46541. InterpolantFactoryMethodLinear: void 0,
  46542. InterpolantFactoryMethodSmooth: void 0
  46543. }),
  46544. n.NumberKeyframeTrack = function(e, t, i, r) {
  46545. n.KeyframeTrack.call(this, e, t, i, r)
  46546. }
  46547. ,
  46548. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46549. constructor: n.NumberKeyframeTrack,
  46550. ValueTypeName: "number"
  46551. }),
  46552. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  46553. n.KeyframeTrack.call(this, e, t, i, r)
  46554. }
  46555. ,
  46556. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46557. constructor: n.QuaternionKeyframeTrack,
  46558. ValueTypeName: "quaternion",
  46559. DefaultInterpolation: n.InterpolateLinear,
  46560. InterpolantFactoryMethodLinear: function(e) {
  46561. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46562. },
  46563. InterpolantFactoryMethodSmooth: void 0
  46564. }),
  46565. n.StringKeyframeTrack = function(e, t, i, r) {
  46566. n.KeyframeTrack.call(this, e, t, i, r)
  46567. }
  46568. ,
  46569. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46570. constructor: n.StringKeyframeTrack,
  46571. ValueTypeName: "string",
  46572. ValueBufferType: Array,
  46573. DefaultInterpolation: n.IntepolateDiscrete,
  46574. InterpolantFactoryMethodLinear: void 0,
  46575. InterpolantFactoryMethodSmooth: void 0
  46576. }),
  46577. n.VectorKeyframeTrack = function(e, t, i, r) {
  46578. n.KeyframeTrack.call(this, e, t, i, r)
  46579. }
  46580. ,
  46581. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46582. constructor: n.VectorKeyframeTrack,
  46583. ValueTypeName: "vector"
  46584. }),
  46585. n.Audio = function(e) {
  46586. n.Object3D.call(this),
  46587. this.type = "Audio",
  46588. this.context = e.context,
  46589. this.source = this.context.createBufferSource(),
  46590. this.source.onended = this.onEnded.bind(this),
  46591. this.gain = this.context.createGain(),
  46592. this.gain.connect(e.getInput()),
  46593. this.autoplay = !1,
  46594. this.startTime = 0,
  46595. this.playbackRate = 1,
  46596. this.isPlaying = !1,
  46597. this.hasPlaybackControl = !0,
  46598. this.sourceType = "empty",
  46599. this.filter = null
  46600. }
  46601. ,
  46602. n.Audio.prototype = Object.create(n.Object3D.prototype),
  46603. n.Audio.prototype.constructor = n.Audio,
  46604. n.Audio.prototype.getOutput = function() {
  46605. return this.gain
  46606. }
  46607. ,
  46608. n.Audio.prototype.load = function(e) {
  46609. var t = new n.AudioBuffer(this.context);
  46610. return t.load(e),
  46611. this.setBuffer(t),
  46612. this
  46613. }
  46614. ,
  46615. n.Audio.prototype.setNodeSource = function(e) {
  46616. return this.hasPlaybackControl = !1,
  46617. this.sourceType = "audioNode",
  46618. this.source = e,
  46619. this.connect(),
  46620. this
  46621. }
  46622. ,
  46623. n.Audio.prototype.setBuffer = function(e) {
  46624. var t = this;
  46625. return e.onReady(function(e) {
  46626. t.source.buffer = e,
  46627. t.sourceType = "buffer",
  46628. t.autoplay && t.play()
  46629. }),
  46630. this
  46631. }
  46632. ,
  46633. n.Audio.prototype.play = function() {
  46634. if (this.isPlaying === !0)
  46635. return void console.warn("THREE.Audio: Audio is already playing.");
  46636. if (this.hasPlaybackControl === !1)
  46637. return void console.warn("THREE.Audio: this Audio has no playback control.");
  46638. var e = this.context.createBufferSource();
  46639. e.buffer = this.source.buffer,
  46640. e.loop = this.source.loop,
  46641. e.onended = this.source.onended,
  46642. e.start(0, this.startTime),
  46643. e.playbackRate.value = this.playbackRate,
  46644. this.isPlaying = !0,
  46645. this.source = e,
  46646. this.connect()
  46647. }
  46648. ,
  46649. n.Audio.prototype.pause = function() {
  46650. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46651. void (this.startTime = this.context.currentTime))
  46652. }
  46653. ,
  46654. n.Audio.prototype.stop = function() {
  46655. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46656. void (this.startTime = 0))
  46657. }
  46658. ,
  46659. n.Audio.prototype.connect = function() {
  46660. null !== this.filter ? (this.source.connect(this.filter),
  46661. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  46662. }
  46663. ,
  46664. n.Audio.prototype.disconnect = function() {
  46665. null !== this.filter ? (this.source.disconnect(this.filter),
  46666. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  46667. }
  46668. ,
  46669. n.Audio.prototype.getFilter = function() {
  46670. return this.filter
  46671. }
  46672. ,
  46673. n.Audio.prototype.setFilter = function(e) {
  46674. void 0 === e && (e = null),
  46675. this.isPlaying === !0 ? (this.disconnect(),
  46676. this.filter = e,
  46677. this.connect()) : this.filter = e
  46678. }
  46679. ,
  46680. n.Audio.prototype.setPlaybackRate = function(e) {
  46681. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  46682. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  46683. }
  46684. ,
  46685. n.Audio.prototype.getPlaybackRate = function() {
  46686. return this.playbackRate
  46687. }
  46688. ,
  46689. n.Audio.prototype.onEnded = function() {
  46690. this.isPlaying = !1
  46691. }
  46692. ,
  46693. n.Audio.prototype.setLoop = function(e) {
  46694. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  46695. }
  46696. ,
  46697. n.Audio.prototype.getLoop = function() {
  46698. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  46699. !1) : this.source.loop
  46700. }
  46701. ,
  46702. n.Audio.prototype.setVolume = function(e) {
  46703. this.gain.gain.value = e
  46704. }
  46705. ,
  46706. n.Audio.prototype.getVolume = function() {
  46707. return this.gain.gain.value
  46708. }
  46709. ,
  46710. n.AudioAnalyser = function(e, t) {
  46711. this.analyser = e.context.createAnalyser(),
  46712. this.analyser.fftSize = void 0 !== t ? t : 2048,
  46713. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  46714. e.getOutput().connect(this.analyser)
  46715. }
  46716. ,
  46717. n.AudioAnalyser.prototype = {
  46718. constructor: n.AudioAnalyser,
  46719. getData: function() {
  46720. return this.analyser.getByteFrequencyData(this.data),
  46721. this.data
  46722. }
  46723. },
  46724. n.AudioBuffer = function(e) {
  46725. this.context = e,
  46726. this.ready = !1,
  46727. this.readyCallbacks = []
  46728. }
  46729. ,
  46730. n.AudioBuffer.prototype.load = function(e) {
  46731. var t = this
  46732. , i = new XMLHttpRequest;
  46733. return i.open("GET", e, !0),
  46734. i.responseType = "arraybuffer",
  46735. i.onload = function(e) {
  46736. t.context.decodeAudioData(this.response, function(e) {
  46737. t.buffer = e,
  46738. t.ready = !0;
  46739. for (var i = 0; i < t.readyCallbacks.length; i++)
  46740. t.readyCallbacks[i](t.buffer);
  46741. t.readyCallbacks = []
  46742. })
  46743. }
  46744. ,
  46745. i.send(),
  46746. this
  46747. }
  46748. ,
  46749. n.AudioBuffer.prototype.onReady = function(e) {
  46750. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  46751. }
  46752. ,
  46753. n.PositionalAudio = function(e) {
  46754. n.Audio.call(this, e),
  46755. this.panner = this.context.createPanner(),
  46756. this.panner.connect(this.gain)
  46757. }
  46758. ,
  46759. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  46760. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  46761. n.PositionalAudio.prototype.getOutput = function() {
  46762. return this.panner
  46763. }
  46764. ,
  46765. n.PositionalAudio.prototype.setRefDistance = function(e) {
  46766. this.panner.refDistance = e
  46767. }
  46768. ,
  46769. n.PositionalAudio.prototype.getRefDistance = function() {
  46770. return this.panner.refDistance
  46771. }
  46772. ,
  46773. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  46774. this.panner.rolloffFactor = e
  46775. }
  46776. ,
  46777. n.PositionalAudio.prototype.getRolloffFactor = function() {
  46778. return this.panner.rolloffFactor
  46779. }
  46780. ,
  46781. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  46782. this.panner.distanceModel = e
  46783. }
  46784. ,
  46785. n.PositionalAudio.prototype.getDistanceModel = function() {
  46786. return this.panner.distanceModel
  46787. }
  46788. ,
  46789. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  46790. this.panner.maxDistance = e
  46791. }
  46792. ,
  46793. n.PositionalAudio.prototype.getMaxDistance = function() {
  46794. return this.panner.maxDistance
  46795. }
  46796. ,
  46797. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  46798. var e = new n.Vector3;
  46799. return function(t) {
  46800. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  46801. e.setFromMatrixPosition(this.matrixWorld),
  46802. this.panner.setPosition(e.x, e.y, e.z)
  46803. }
  46804. }(),
  46805. n.AudioListener = function() {
  46806. n.Object3D.call(this),
  46807. this.type = "AudioListener",
  46808. this.context = new (window.AudioContext || window.webkitAudioContext),
  46809. this.gain = this.context.createGain(),
  46810. this.gain.connect(this.context.destination),
  46811. this.filter = null
  46812. }
  46813. ,
  46814. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  46815. n.AudioListener.prototype.constructor = n.AudioListener,
  46816. n.AudioListener.prototype.getInput = function() {
  46817. return this.gain
  46818. }
  46819. ,
  46820. n.AudioListener.prototype.removeFilter = function() {
  46821. null !== this.filter && (this.gain.disconnect(this.filter),
  46822. this.filter.disconnect(this.context.destination),
  46823. this.gain.connect(this.context.destination),
  46824. this.filter = null)
  46825. }
  46826. ,
  46827. n.AudioListener.prototype.setFilter = function(e) {
  46828. null !== this.filter ? (this.gain.disconnect(this.filter),
  46829. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  46830. this.filter = e,
  46831. this.gain.connect(this.filter),
  46832. this.filter.connect(this.context.destination)
  46833. }
  46834. ,
  46835. n.AudioListener.prototype.getFilter = function() {
  46836. return this.filter
  46837. }
  46838. ,
  46839. n.AudioListener.prototype.setMasterVolume = function(e) {
  46840. this.gain.gain.value = e
  46841. }
  46842. ,
  46843. n.AudioListener.prototype.getMasterVolume = function() {
  46844. return this.gain.gain.value
  46845. }
  46846. ,
  46847. n.AudioListener.prototype.updateMatrixWorld = function() {
  46848. var e = new n.Vector3
  46849. , t = new n.Quaternion
  46850. , i = new n.Vector3
  46851. , r = new n.Vector3;
  46852. return function(o) {
  46853. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  46854. var a = this.context.listener
  46855. , s = this.up;
  46856. this.matrixWorld.decompose(e, t, i),
  46857. r.set(0, 0, -1).applyQuaternion(t),
  46858. a.setPosition(e.x, e.y, e.z),
  46859. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  46860. }
  46861. }(),
  46862. n.Camera = function() {
  46863. n.Object3D.call(this),
  46864. this.type = "Camera",
  46865. this.matrixWorldInverse = new n.Matrix4,
  46866. this.projectionMatrix = new n.Matrix4
  46867. }
  46868. ,
  46869. n.Camera.prototype = Object.create(n.Object3D.prototype),
  46870. n.Camera.prototype.constructor = n.Camera,
  46871. n.Camera.prototype.getWorldDirection = function() {
  46872. var e = new n.Quaternion;
  46873. return function(t) {
  46874. var i = t || new n.Vector3;
  46875. return this.getWorldQuaternion(e),
  46876. i.set(0, 0, -1).applyQuaternion(e)
  46877. }
  46878. }(),
  46879. n.Camera.prototype.lookAt = function() {
  46880. var e = new n.Matrix4;
  46881. return function(t) {
  46882. e.lookAt(this.position, t, this.up),
  46883. this.quaternion.setFromRotationMatrix(e)
  46884. }
  46885. }(),
  46886. n.Camera.prototype.clone = function() {
  46887. return (new this.constructor).copy(this)
  46888. }
  46889. ,
  46890. n.Camera.prototype.copy = function(e) {
  46891. return n.Object3D.prototype.copy.call(this, e),
  46892. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  46893. this.projectionMatrix.copy(e.projectionMatrix),
  46894. this
  46895. }
  46896. ,
  46897. n.CubeCamera = function(e, t, i) {
  46898. n.Object3D.call(this),
  46899. this.type = "CubeCamera";
  46900. var r = 90
  46901. , o = 1
  46902. , a = new n.PerspectiveCamera(r,o,e,t);
  46903. a.up.set(0, -1, 0),
  46904. a.lookAt(new n.Vector3(1,0,0)),
  46905. this.add(a);
  46906. var s = new n.PerspectiveCamera(r,o,e,t);
  46907. s.up.set(0, -1, 0),
  46908. s.lookAt(new n.Vector3(-1,0,0)),
  46909. this.add(s);
  46910. var l = new n.PerspectiveCamera(r,o,e,t);
  46911. l.up.set(0, 0, 1),
  46912. l.lookAt(new n.Vector3(0,1,0)),
  46913. this.add(l);
  46914. var c = new n.PerspectiveCamera(r,o,e,t);
  46915. c.up.set(0, 0, -1),
  46916. c.lookAt(new n.Vector3(0,-1,0)),
  46917. this.add(c);
  46918. var h = new n.PerspectiveCamera(r,o,e,t);
  46919. h.up.set(0, -1, 0),
  46920. h.lookAt(new n.Vector3(0,0,1)),
  46921. this.add(h);
  46922. var u = new n.PerspectiveCamera(r,o,e,t);
  46923. u.up.set(0, -1, 0),
  46924. u.lookAt(new n.Vector3(0,0,-1)),
  46925. this.add(u);
  46926. var d = {
  46927. format: n.RGBFormat,
  46928. magFilter: n.LinearFilter,
  46929. minFilter: n.LinearFilter
  46930. };
  46931. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  46932. this.updateCubeMap = function(e, t) {
  46933. null === this.parent && this.updateMatrixWorld();
  46934. var i = this.renderTarget
  46935. , n = i.texture.generateMipmaps;
  46936. i.texture.generateMipmaps = !1,
  46937. i.activeCubeFace = 0,
  46938. e.render(t, a, i),
  46939. i.activeCubeFace = 1,
  46940. e.render(t, s, i),
  46941. i.activeCubeFace = 2,
  46942. e.render(t, l, i),
  46943. i.activeCubeFace = 3,
  46944. e.render(t, c, i),
  46945. i.activeCubeFace = 4,
  46946. e.render(t, h, i),
  46947. i.texture.generateMipmaps = n,
  46948. i.activeCubeFace = 5,
  46949. e.render(t, u, i),
  46950. e.setRenderTarget(null)
  46951. }
  46952. }
  46953. ,
  46954. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  46955. n.CubeCamera.prototype.constructor = n.CubeCamera,
  46956. n.OrthographicCamera = function(e, t, i, r, o, a) {
  46957. n.Camera.call(this),
  46958. this.type = "OrthographicCamera",
  46959. this.zoom = 1,
  46960. this.left = e,
  46961. this.right = t,
  46962. this.top = i,
  46963. this.bottom = r,
  46964. this.near = void 0 !== o ? o : .1,
  46965. this.far = void 0 !== a ? a : 2e3,
  46966. this.updateProjectionMatrix()
  46967. }
  46968. ,
  46969. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  46970. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  46971. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  46972. var e = (this.right - this.left) / (2 * this.zoom)
  46973. , t = (this.top - this.bottom) / (2 * this.zoom)
  46974. , i = (this.right + this.left) / 2
  46975. , n = (this.top + this.bottom) / 2;
  46976. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  46977. }
  46978. ,
  46979. n.OrthographicCamera.prototype.copy = function(e) {
  46980. return n.Camera.prototype.copy.call(this, e),
  46981. this.left = e.left,
  46982. this.right = e.right,
  46983. this.top = e.top,
  46984. this.bottom = e.bottom,
  46985. this.near = e.near,
  46986. this.far = e.far,
  46987. this.zoom = e.zoom,
  46988. this
  46989. }
  46990. ,
  46991. n.OrthographicCamera.prototype.toJSON = function(e) {
  46992. var t = n.Object3D.prototype.toJSON.call(this, e);
  46993. return t.object.zoom = this.zoom,
  46994. t.object.left = this.left,
  46995. t.object.right = this.right,
  46996. t.object.top = this.top,
  46997. t.object.bottom = this.bottom,
  46998. t.object.near = this.near,
  46999. t.object.far = this.far,
  47000. t
  47001. }
  47002. ,
  47003. n.PerspectiveCamera = function(e, t, i, r) {
  47004. n.Camera.call(this),
  47005. this.type = "PerspectiveCamera",
  47006. this.focalLength = 10,
  47007. this.zoom = 1,
  47008. this.fov = void 0 !== e ? e : 50,
  47009. this.aspect = void 0 !== t ? t : 1,
  47010. this.near = void 0 !== i ? i : .1,
  47011. this.far = void 0 !== r ? r : 2e3,
  47012. this.updateProjectionMatrix()
  47013. }
  47014. ,
  47015. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47016. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47017. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47018. void 0 === t && (t = 24),
  47019. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47020. this.updateProjectionMatrix()
  47021. }
  47022. ,
  47023. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47024. this.fullWidth = e,
  47025. this.fullHeight = t,
  47026. this.x = i,
  47027. this.y = n,
  47028. this.width = r,
  47029. this.height = o,
  47030. this.updateProjectionMatrix()
  47031. }
  47032. ,
  47033. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47034. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47035. if (this.fullWidth) {
  47036. var t = this.fullWidth / this.fullHeight
  47037. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47038. , r = -i
  47039. , o = t * r
  47040. , a = t * i
  47041. , s = Math.abs(a - o)
  47042. , l = Math.abs(i - r);
  47043. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  47044. } else
  47045. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47046. }
  47047. ,
  47048. n.PerspectiveCamera.prototype.copy = function(e) {
  47049. return n.Camera.prototype.copy.call(this, e),
  47050. this.focalLength = e.focalLength,
  47051. this.zoom = e.zoom,
  47052. this.fov = e.fov,
  47053. this.aspect = e.aspect,
  47054. this.near = e.near,
  47055. this.far = e.far,
  47056. this
  47057. }
  47058. ,
  47059. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47060. var t = n.Object3D.prototype.toJSON.call(this, e);
  47061. return t.object.focalLength = this.focalLength,
  47062. t.object.zoom = this.zoom,
  47063. t.object.fov = this.fov,
  47064. t.object.aspect = this.aspect,
  47065. t.object.near = this.near,
  47066. t.object.far = this.far,
  47067. t
  47068. }
  47069. ,
  47070. n.StereoCamera = function() {
  47071. this.type = "StereoCamera",
  47072. this.aspect = 1,
  47073. this.cameraL = new n.PerspectiveCamera,
  47074. this.cameraL.layers.enable(1),
  47075. this.cameraL.matrixAutoUpdate = !1,
  47076. this.cameraR = new n.PerspectiveCamera,
  47077. this.cameraR.layers.enable(2),
  47078. this.cameraR.matrixAutoUpdate = !1
  47079. }
  47080. ,
  47081. n.StereoCamera.prototype = {
  47082. constructor: n.StereoCamera,
  47083. update: function() {
  47084. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47085. return function(l) {
  47086. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47087. if (c) {
  47088. e = l.focalLength,
  47089. t = l.fov,
  47090. i = l.aspect * this.aspect,
  47091. r = l.near,
  47092. o = l.far;
  47093. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47094. s.elements[12] = -p,
  47095. a.elements[12] = p,
  47096. h = -g * i + f,
  47097. u = g * i + f,
  47098. d.elements[0] = 2 * r / (u - h),
  47099. d.elements[8] = (u + h) / (u - h),
  47100. this.cameraL.projectionMatrix.copy(d),
  47101. h = -g * i - f,
  47102. u = g * i - f,
  47103. d.elements[0] = 2 * r / (u - h),
  47104. d.elements[8] = (u + h) / (u - h),
  47105. this.cameraR.projectionMatrix.copy(d)
  47106. }
  47107. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47108. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47109. }
  47110. }()
  47111. },
  47112. n.Light = function(e, t) {
  47113. n.Object3D.call(this),
  47114. this.type = "Light",
  47115. this.color = new n.Color(e),
  47116. this.intensity = void 0 !== t ? t : 1,
  47117. this.receiveShadow = void 0
  47118. }
  47119. ,
  47120. n.Light.prototype = Object.create(n.Object3D.prototype),
  47121. n.Light.prototype.constructor = n.Light,
  47122. n.Light.prototype.copy = function(e) {
  47123. return n.Object3D.prototype.copy.call(this, e),
  47124. this.color.copy(e.color),
  47125. this.intensity = e.intensity,
  47126. this
  47127. }
  47128. ,
  47129. n.Light.prototype.toJSON = function(e) {
  47130. var t = n.Object3D.prototype.toJSON.call(this, e);
  47131. return t.object.color = this.color.getHex(),
  47132. t.object.intensity = this.intensity,
  47133. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47134. void 0 !== this.distance && (t.object.distance = this.distance),
  47135. void 0 !== this.angle && (t.object.angle = this.angle),
  47136. void 0 !== this.decay && (t.object.decay = this.decay),
  47137. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47138. t
  47139. }
  47140. ,
  47141. n.LightShadow = function(e) {
  47142. this.camera = e,
  47143. this.bias = 0,
  47144. this.radius = 1,
  47145. this.mapSize = new n.Vector2(512,512),
  47146. this.map = null,
  47147. this.matrix = new n.Matrix4
  47148. }
  47149. ,
  47150. n.LightShadow.prototype = {
  47151. constructor: n.LightShadow,
  47152. copy: function(e) {
  47153. return this.camera = e.camera.clone(),
  47154. this.bias = e.bias,
  47155. this.radius = e.radius,
  47156. this.mapSize.copy(e.mapSize),
  47157. this
  47158. },
  47159. clone: function() {
  47160. return (new this.constructor).copy(this)
  47161. }
  47162. },
  47163. n.AmbientLight = function(e, t) {
  47164. n.Light.call(this, e, t),
  47165. this.type = "AmbientLight",
  47166. this.castShadow = void 0
  47167. }
  47168. ,
  47169. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47170. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47171. n.DirectionalLight = function(e, t) {
  47172. n.Light.call(this, e, t),
  47173. this.type = "DirectionalLight",
  47174. this.position.set(0, 1, 0),
  47175. this.updateMatrix(),
  47176. this.target = new n.Object3D,
  47177. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47178. }
  47179. ,
  47180. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47181. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47182. n.DirectionalLight.prototype.copy = function(e) {
  47183. return n.Light.prototype.copy.call(this, e),
  47184. this.target = e.target.clone(),
  47185. this.shadow = e.shadow.clone(),
  47186. this
  47187. }
  47188. ,
  47189. n.HemisphereLight = function(e, t, i) {
  47190. n.Light.call(this, e, i),
  47191. this.type = "HemisphereLight",
  47192. this.castShadow = void 0,
  47193. this.position.set(0, 1, 0),
  47194. this.updateMatrix(),
  47195. this.groundColor = new n.Color(t)
  47196. }
  47197. ,
  47198. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47199. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47200. n.HemisphereLight.prototype.copy = function(e) {
  47201. return n.Light.prototype.copy.call(this, e),
  47202. this.groundColor.copy(e.groundColor),
  47203. this
  47204. }
  47205. ,
  47206. n.PointLight = function(e, t, i, r) {
  47207. n.Light.call(this, e, t),
  47208. this.type = "PointLight",
  47209. this.distance = void 0 !== i ? i : 0,
  47210. this.decay = void 0 !== r ? r : 1,
  47211. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47212. }
  47213. ,
  47214. n.PointLight.prototype = Object.create(n.Light.prototype),
  47215. n.PointLight.prototype.constructor = n.PointLight,
  47216. Object.defineProperty(n.PointLight.prototype, "power", {
  47217. get: function() {
  47218. return 4 * this.intensity * Math.PI
  47219. },
  47220. set: function(e) {
  47221. this.intensity = e / (4 * Math.PI)
  47222. }
  47223. }),
  47224. n.PointLight.prototype.copy = function(e) {
  47225. return n.Light.prototype.copy.call(this, e),
  47226. this.distance = e.distance,
  47227. this.decay = e.decay,
  47228. this.shadow = e.shadow.clone(),
  47229. this
  47230. }
  47231. ,
  47232. n.SpotLight = function(e, t, i, r, o, a) {
  47233. n.Light.call(this, e, t),
  47234. this.type = "SpotLight",
  47235. this.position.set(0, 1, 0),
  47236. this.updateMatrix(),
  47237. this.target = new n.Object3D,
  47238. this.distance = void 0 !== i ? i : 0,
  47239. this.angle = void 0 !== r ? r : Math.PI / 3,
  47240. this.penumbra = void 0 !== o ? o : 0,
  47241. this.decay = void 0 !== a ? a : 1,
  47242. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47243. }
  47244. ,
  47245. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47246. n.SpotLight.prototype.constructor = n.SpotLight,
  47247. Object.defineProperty(n.SpotLight.prototype, "power", {
  47248. get: function() {
  47249. return this.intensity * Math.PI
  47250. },
  47251. set: function(e) {
  47252. this.intensity = e / Math.PI
  47253. }
  47254. }),
  47255. n.SpotLight.prototype.copy = function(e) {
  47256. return n.Light.prototype.copy.call(this, e),
  47257. this.distance = e.distance,
  47258. this.angle = e.angle,
  47259. this.penumbra = e.penumbra,
  47260. this.decay = e.decay,
  47261. this.target = e.target.clone(),
  47262. this.shadow = e.shadow.clone(),
  47263. this
  47264. }
  47265. ,
  47266. n.Cache = {
  47267. enabled: !1,
  47268. files: {},
  47269. add: function(e, t) {
  47270. this.enabled !== !1 && (this.files[e] = t)
  47271. },
  47272. get: function(e) {
  47273. if (this.enabled !== !1)
  47274. return this.files[e]
  47275. },
  47276. remove: function(e) {
  47277. delete this.files[e]
  47278. },
  47279. clear: function() {
  47280. this.files = {}
  47281. }
  47282. },
  47283. n.Loader = function() {
  47284. this.onLoadStart = function() {}
  47285. ,
  47286. this.onLoadProgress = function() {}
  47287. ,
  47288. this.onLoadComplete = function() {}
  47289. }
  47290. ,
  47291. n.Loader.prototype = {
  47292. constructor: n.Loader,
  47293. crossOrigin: void 0,
  47294. extractUrlBase: function(e) {
  47295. var t = e.split("/");
  47296. return 1 === t.length ? "./" : (t.pop(),
  47297. t.join("/") + "/")
  47298. },
  47299. initMaterials: function(e, t, i) {
  47300. for (var n = [], r = 0; r < e.length; ++r)
  47301. n[r] = this.createMaterial(e[r], t, i);
  47302. return n
  47303. },
  47304. createMaterial: function() {
  47305. var e, t, i;
  47306. return function(r, o, a) {
  47307. function s(e, i, r, s, c) {
  47308. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47309. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47310. h = t.load(u)),
  47311. void 0 !== i && (h.repeat.fromArray(i),
  47312. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47313. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47314. void 0 !== r && h.offset.fromArray(r),
  47315. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47316. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47317. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47318. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47319. void 0 !== c && (h.anisotropy = c);
  47320. var p = n.Math.generateUUID();
  47321. return l[p] = h,
  47322. p
  47323. }
  47324. void 0 === e && (e = new n.Color),
  47325. void 0 === t && (t = new n.TextureLoader),
  47326. void 0 === i && (i = new n.MaterialLoader);
  47327. var l = {}
  47328. , c = {
  47329. uuid: n.Math.generateUUID(),
  47330. type: "MeshLambertMaterial"
  47331. };
  47332. for (var h in r) {
  47333. var u = r[h];
  47334. switch (h) {
  47335. case "DbgColor":
  47336. case "DbgIndex":
  47337. case "opticalDensity":
  47338. case "illumination":
  47339. break;
  47340. case "DbgName":
  47341. c.name = u;
  47342. break;
  47343. case "blending":
  47344. c.blending = n[u];
  47345. break;
  47346. case "colorAmbient":
  47347. case "mapAmbient":
  47348. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47349. break;
  47350. case "colorDiffuse":
  47351. c.color = e.fromArray(u).getHex();
  47352. break;
  47353. case "colorSpecular":
  47354. c.specular = e.fromArray(u).getHex();
  47355. break;
  47356. case "colorEmissive":
  47357. c.emissive = e.fromArray(u).getHex();
  47358. break;
  47359. case "specularCoef":
  47360. c.shininess = u;
  47361. break;
  47362. case "shading":
  47363. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47364. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47365. break;
  47366. case "mapDiffuse":
  47367. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47368. break;
  47369. case "mapDiffuseRepeat":
  47370. case "mapDiffuseOffset":
  47371. case "mapDiffuseWrap":
  47372. case "mapDiffuseAnisotropy":
  47373. break;
  47374. case "mapLight":
  47375. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47376. break;
  47377. case "mapLightRepeat":
  47378. case "mapLightOffset":
  47379. case "mapLightWrap":
  47380. case "mapLightAnisotropy":
  47381. break;
  47382. case "mapAO":
  47383. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47384. break;
  47385. case "mapAORepeat":
  47386. case "mapAOOffset":
  47387. case "mapAOWrap":
  47388. case "mapAOAnisotropy":
  47389. break;
  47390. case "mapBump":
  47391. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47392. break;
  47393. case "mapBumpScale":
  47394. c.bumpScale = u;
  47395. break;
  47396. case "mapBumpRepeat":
  47397. case "mapBumpOffset":
  47398. case "mapBumpWrap":
  47399. case "mapBumpAnisotropy":
  47400. break;
  47401. case "mapNormal":
  47402. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47403. break;
  47404. case "mapNormalFactor":
  47405. c.normalScale = [u, u];
  47406. break;
  47407. case "mapNormalRepeat":
  47408. case "mapNormalOffset":
  47409. case "mapNormalWrap":
  47410. case "mapNormalAnisotropy":
  47411. break;
  47412. case "mapSpecular":
  47413. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47414. break;
  47415. case "mapSpecularRepeat":
  47416. case "mapSpecularOffset":
  47417. case "mapSpecularWrap":
  47418. case "mapSpecularAnisotropy":
  47419. break;
  47420. case "mapAlpha":
  47421. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47422. break;
  47423. case "mapAlphaRepeat":
  47424. case "mapAlphaOffset":
  47425. case "mapAlphaWrap":
  47426. case "mapAlphaAnisotropy":
  47427. break;
  47428. case "flipSided":
  47429. c.side = n.BackSide;
  47430. break;
  47431. case "doubleSided":
  47432. c.side = n.DoubleSide;
  47433. break;
  47434. case "transparency":
  47435. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47436. c.opacity = u;
  47437. break;
  47438. case "depthTest":
  47439. case "depthWrite":
  47440. case "colorWrite":
  47441. case "opacity":
  47442. case "reflectivity":
  47443. case "transparent":
  47444. case "visible":
  47445. case "wireframe":
  47446. c[h] = u;
  47447. break;
  47448. case "vertexColors":
  47449. u === !0 && (c.vertexColors = n.VertexColors),
  47450. "face" === u && (c.vertexColors = n.FaceColors);
  47451. break;
  47452. default:
  47453. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  47454. }
  47455. }
  47456. return "MeshBasicMaterial" === c.type && delete c.emissive,
  47457. "MeshPhongMaterial" !== c.type && delete c.specular,
  47458. c.opacity < 1 && (c.transparent = !0),
  47459. i.setTextures(l),
  47460. i.parse(c)
  47461. }
  47462. }()
  47463. },
  47464. n.Loader.Handlers = {
  47465. handlers: [],
  47466. add: function(e, t) {
  47467. this.handlers.push(e, t)
  47468. },
  47469. get: function(e) {
  47470. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  47471. var r = t[i]
  47472. , o = t[i + 1];
  47473. if (r.test(e))
  47474. return o
  47475. }
  47476. return null
  47477. }
  47478. },
  47479. n.XHRLoader = function(e) {
  47480. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47481. }
  47482. ,
  47483. n.XHRLoader.prototype = {
  47484. constructor: n.XHRLoader,
  47485. load: function(e, t, i, r) {
  47486. void 0 !== this.path && (e = this.path + e);
  47487. var o = this
  47488. , a = n.Cache.get(e);
  47489. if (void 0 !== a)
  47490. return t && setTimeout(function() {
  47491. t(a)
  47492. }, 0),
  47493. a;
  47494. var s = new XMLHttpRequest;
  47495. return s.overrideMimeType("text/plain"),
  47496. s.open("GET", e, !0),
  47497. s.addEventListener("load", function(i) {
  47498. var a = i.target.response;
  47499. n.Cache.add(e, a),
  47500. 200 === this.status ? (t && t(a),
  47501. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  47502. t && t(a),
  47503. o.manager.itemEnd(e)) : (r && r(i),
  47504. o.manager.itemError(e))
  47505. }, !1),
  47506. void 0 !== i && s.addEventListener("progress", function(e) {
  47507. i(e)
  47508. }, !1),
  47509. s.addEventListener("error", function(t) {
  47510. r && r(t),
  47511. o.manager.itemError(e)
  47512. }, !1),
  47513. void 0 !== this.responseType && (s.responseType = this.responseType),
  47514. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  47515. s.send(null),
  47516. o.manager.itemStart(e),
  47517. s
  47518. },
  47519. setPath: function(e) {
  47520. this.path = e
  47521. },
  47522. setResponseType: function(e) {
  47523. this.responseType = e
  47524. },
  47525. setWithCredentials: function(e) {
  47526. this.withCredentials = e
  47527. }
  47528. },
  47529. n.FontLoader = function(e) {
  47530. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47531. }
  47532. ,
  47533. n.FontLoader.prototype = {
  47534. constructor: n.FontLoader,
  47535. load: function(e, t, i, r) {
  47536. var o = new n.XHRLoader(this.manager);
  47537. o.load(e, function(e) {
  47538. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  47539. }, i, r)
  47540. }
  47541. },
  47542. n.ImageLoader = function(e) {
  47543. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47544. }
  47545. ,
  47546. n.ImageLoader.prototype = {
  47547. constructor: n.ImageLoader,
  47548. load: function(e, t, i, r) {
  47549. void 0 !== this.path && (e = this.path + e);
  47550. var o = this
  47551. , a = n.Cache.get(e);
  47552. if (void 0 !== a)
  47553. return o.manager.itemStart(e),
  47554. t ? setTimeout(function() {
  47555. t(a),
  47556. o.manager.itemEnd(e)
  47557. }, 0) : o.manager.itemEnd(e),
  47558. a;
  47559. var s = document.createElement("img");
  47560. return s.addEventListener("load", function(i) {
  47561. n.Cache.add(e, this),
  47562. t && t(this),
  47563. o.manager.itemEnd(e)
  47564. }, !1),
  47565. void 0 !== i && s.addEventListener("progress", function(e) {
  47566. i(e)
  47567. }, !1),
  47568. s.addEventListener("error", function(t) {
  47569. r && r(t),
  47570. o.manager.itemError(e)
  47571. }, !1),
  47572. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  47573. o.manager.itemStart(e),
  47574. s.src = e,
  47575. s
  47576. },
  47577. setCrossOrigin: function(e) {
  47578. this.crossOrigin = e
  47579. },
  47580. setPath: function(e) {
  47581. this.path = e
  47582. }
  47583. },
  47584. n.JSONLoader = function(e) {
  47585. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  47586. e = void 0),
  47587. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47588. this.withCredentials = !1
  47589. }
  47590. ,
  47591. n.JSONLoader.prototype = {
  47592. constructor: n.JSONLoader,
  47593. get statusDomElement() {
  47594. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  47595. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  47596. this._statusDomElement
  47597. },
  47598. load: function(e, t, i, r) {
  47599. var o = this
  47600. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  47601. , s = new n.XHRLoader(this.manager);
  47602. s.setWithCredentials(this.withCredentials),
  47603. s.load(e, function(i) {
  47604. var n = JSON.parse(i)
  47605. , r = n.metadata;
  47606. if (void 0 !== r) {
  47607. var s = r.type;
  47608. if (void 0 !== s) {
  47609. if ("object" === s.toLowerCase())
  47610. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  47611. if ("scene" === s.toLowerCase())
  47612. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  47613. }
  47614. }
  47615. var l = o.parse(n, a);
  47616. t(l.geometry, l.materials)
  47617. }, i, r)
  47618. },
  47619. setTexturePath: function(e) {
  47620. this.texturePath = e
  47621. },
  47622. parse: function(e, t) {
  47623. function i(t) {
  47624. function i(e, t) {
  47625. return e & 1 << t
  47626. }
  47627. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  47628. if (void 0 !== e.uvs) {
  47629. for (r = 0; r < e.uvs.length; r++)
  47630. e.uvs[r].length && B++;
  47631. for (r = 0; r < B; r++)
  47632. s.faceVertexUvs[r] = []
  47633. }
  47634. for (l = 0,
  47635. c = L.length; l < c; )
  47636. E = new n.Vector3,
  47637. E.x = L[l++] * t,
  47638. E.y = L[l++] * t,
  47639. E.z = L[l++] * t,
  47640. s.vertices.push(E);
  47641. for (l = 0,
  47642. c = O.length; l < c; )
  47643. if (f = O[l++],
  47644. g = i(f, 0),
  47645. m = i(f, 1),
  47646. v = i(f, 3),
  47647. A = i(f, 4),
  47648. y = i(f, 5),
  47649. C = i(f, 6),
  47650. I = i(f, 7),
  47651. g) {
  47652. if (w = new n.Face3,
  47653. w.a = O[l],
  47654. w.b = O[l + 1],
  47655. w.c = O[l + 3],
  47656. _ = new n.Face3,
  47657. _.a = O[l + 1],
  47658. _.b = O[l + 2],
  47659. _.c = O[l + 3],
  47660. l += 4,
  47661. m && (p = O[l++],
  47662. w.materialIndex = p,
  47663. _.materialIndex = p),
  47664. a = s.faces.length,
  47665. v)
  47666. for (r = 0; r < B; r++)
  47667. for (S = e.uvs[r],
  47668. s.faceVertexUvs[r][a] = [],
  47669. s.faceVertexUvs[r][a + 1] = [],
  47670. o = 0; o < 4; o++)
  47671. d = O[l++],
  47672. R = S[2 * d],
  47673. P = S[2 * d + 1],
  47674. M = new n.Vector2(R,P),
  47675. 2 !== o && s.faceVertexUvs[r][a].push(M),
  47676. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  47677. if (A && (u = 3 * O[l++],
  47678. w.normal.set(D[u++], D[u++], D[u]),
  47679. _.normal.copy(w.normal)),
  47680. y)
  47681. for (r = 0; r < 4; r++)
  47682. u = 3 * O[l++],
  47683. x = new n.Vector3(D[u++],D[u++],D[u]),
  47684. 2 !== r && w.vertexNormals.push(x),
  47685. 0 !== r && _.vertexNormals.push(x);
  47686. if (C && (h = O[l++],
  47687. T = N[h],
  47688. w.color.setHex(T),
  47689. _.color.setHex(T)),
  47690. I)
  47691. for (r = 0; r < 4; r++)
  47692. h = O[l++],
  47693. T = N[h],
  47694. 2 !== r && w.vertexColors.push(new n.Color(T)),
  47695. 0 !== r && _.vertexColors.push(new n.Color(T));
  47696. s.faces.push(w),
  47697. s.faces.push(_)
  47698. } else {
  47699. if (b = new n.Face3,
  47700. b.a = O[l++],
  47701. b.b = O[l++],
  47702. b.c = O[l++],
  47703. m && (p = O[l++],
  47704. b.materialIndex = p),
  47705. a = s.faces.length,
  47706. v)
  47707. for (r = 0; r < B; r++)
  47708. for (S = e.uvs[r],
  47709. s.faceVertexUvs[r][a] = [],
  47710. o = 0; o < 3; o++)
  47711. d = O[l++],
  47712. R = S[2 * d],
  47713. P = S[2 * d + 1],
  47714. M = new n.Vector2(R,P),
  47715. s.faceVertexUvs[r][a].push(M);
  47716. if (A && (u = 3 * O[l++],
  47717. b.normal.set(D[u++], D[u++], D[u])),
  47718. y)
  47719. for (r = 0; r < 3; r++)
  47720. u = 3 * O[l++],
  47721. x = new n.Vector3(D[u++],D[u++],D[u]),
  47722. b.vertexNormals.push(x);
  47723. if (C && (h = O[l++],
  47724. b.color.setHex(N[h])),
  47725. I)
  47726. for (r = 0; r < 3; r++)
  47727. h = O[l++],
  47728. b.vertexColors.push(new n.Color(N[h]));
  47729. s.faces.push(b)
  47730. }
  47731. }
  47732. function r() {
  47733. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  47734. if (e.skinWeights)
  47735. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  47736. var o = e.skinWeights[i]
  47737. , a = t > 1 ? e.skinWeights[i + 1] : 0
  47738. , l = t > 2 ? e.skinWeights[i + 2] : 0
  47739. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  47740. s.skinWeights.push(new n.Vector4(o,a,l,c))
  47741. }
  47742. if (e.skinIndices)
  47743. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  47744. var h = e.skinIndices[i]
  47745. , u = t > 1 ? e.skinIndices[i + 1] : 0
  47746. , d = t > 2 ? e.skinIndices[i + 2] : 0
  47747. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  47748. s.skinIndices.push(new n.Vector4(h,u,d,p))
  47749. }
  47750. s.bones = e.bones,
  47751. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  47752. }
  47753. function o(t) {
  47754. if (void 0 !== e.morphTargets)
  47755. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  47756. s.morphTargets[i] = {},
  47757. s.morphTargets[i].name = e.morphTargets[i].name,
  47758. s.morphTargets[i].vertices = [];
  47759. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  47760. var h = new n.Vector3;
  47761. h.x = a[l] * t,
  47762. h.y = a[l + 1] * t,
  47763. h.z = a[l + 2] * t,
  47764. o.push(h)
  47765. }
  47766. }
  47767. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  47768. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  47769. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  47770. u[i].color.fromArray(d, 3 * i)
  47771. }
  47772. }
  47773. function a() {
  47774. var t = []
  47775. , i = [];
  47776. void 0 !== e.animation && i.push(e.animation),
  47777. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  47778. for (var r = 0; r < i.length; r++) {
  47779. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  47780. o && t.push(o)
  47781. }
  47782. if (s.morphTargets) {
  47783. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  47784. t = t.concat(a)
  47785. }
  47786. t.length > 0 && (s.animations = t)
  47787. }
  47788. var s = new n.Geometry
  47789. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  47790. if (i(l),
  47791. r(),
  47792. o(l),
  47793. a(),
  47794. s.computeFaceNormals(),
  47795. s.computeBoundingSphere(),
  47796. void 0 === e.materials || 0 === e.materials.length)
  47797. return {
  47798. geometry: s
  47799. };
  47800. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  47801. return {
  47802. geometry: s,
  47803. materials: c
  47804. }
  47805. }
  47806. },
  47807. n.LoadingManager = function(e, t, i) {
  47808. var n = this
  47809. , r = !1
  47810. , o = 0
  47811. , a = 0;
  47812. this.onStart = void 0,
  47813. this.onLoad = e,
  47814. this.onProgress = t,
  47815. this.onError = i,
  47816. this.itemStart = function(e) {
  47817. a++,
  47818. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  47819. r = !0
  47820. }
  47821. ,
  47822. this.itemEnd = function(e) {
  47823. o++,
  47824. void 0 !== n.onProgress && n.onProgress(e, o, a),
  47825. o === a && (r = !1,
  47826. void 0 !== n.onLoad && n.onLoad())
  47827. }
  47828. ,
  47829. this.itemError = function(e) {
  47830. void 0 !== n.onError && n.onError(e)
  47831. }
  47832. }
  47833. ,
  47834. n.DefaultLoadingManager = new n.LoadingManager,
  47835. n.BufferGeometryLoader = function(e) {
  47836. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47837. }
  47838. ,
  47839. n.BufferGeometryLoader.prototype = {
  47840. constructor: n.BufferGeometryLoader,
  47841. load: function(e, t, i, r) {
  47842. var o = this
  47843. , a = new n.XHRLoader(o.manager);
  47844. a.load(e, function(e) {
  47845. t(o.parse(JSON.parse(e)))
  47846. }, i, r)
  47847. },
  47848. parse: function(e) {
  47849. var t = new n.BufferGeometry
  47850. , i = e.data.index
  47851. , r = {
  47852. Int8Array: Int8Array,
  47853. Uint8Array: Uint8Array,
  47854. Uint8ClampedArray: Uint8ClampedArray,
  47855. Int16Array: Int16Array,
  47856. Uint16Array: Uint16Array,
  47857. Int32Array: Int32Array,
  47858. Uint32Array: Uint32Array,
  47859. Float32Array: Float32Array,
  47860. Float64Array: Float64Array
  47861. };
  47862. if (void 0 !== i) {
  47863. var o = new r[i.type](i.array);
  47864. t.setIndex(new n.BufferAttribute(o,1))
  47865. }
  47866. var a = e.data.attributes;
  47867. for (var s in a) {
  47868. var l = a[s]
  47869. , o = new r[l.type](l.array);
  47870. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  47871. }
  47872. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  47873. if (void 0 !== c)
  47874. for (var h = 0, u = c.length; h !== u; ++h) {
  47875. var d = c[h];
  47876. t.addGroup(d.start, d.count, d.materialIndex)
  47877. }
  47878. var p = e.data.boundingSphere;
  47879. if (void 0 !== p) {
  47880. var f = new n.Vector3;
  47881. void 0 !== p.center && f.fromArray(p.center),
  47882. t.boundingSphere = new n.Sphere(f,p.radius)
  47883. }
  47884. return t
  47885. }
  47886. },
  47887. n.MaterialLoader = function(e) {
  47888. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47889. this.textures = {}
  47890. }
  47891. ,
  47892. n.MaterialLoader.prototype = {
  47893. constructor: n.MaterialLoader,
  47894. load: function(e, t, i, r) {
  47895. var o = this
  47896. , a = new n.XHRLoader(o.manager);
  47897. a.load(e, function(e) {
  47898. t(o.parse(JSON.parse(e)))
  47899. }, i, r)
  47900. },
  47901. setTextures: function(e) {
  47902. this.textures = e
  47903. },
  47904. getTexture: function(e) {
  47905. var t = this.textures;
  47906. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  47907. t[e]
  47908. },
  47909. parse: function(e) {
  47910. var t = new n[e.type];
  47911. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  47912. void 0 !== e.name && (t.name = e.name),
  47913. void 0 !== e.color && t.color.setHex(e.color),
  47914. void 0 !== e.roughness && (t.roughness = e.roughness),
  47915. void 0 !== e.metalness && (t.metalness = e.metalness),
  47916. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  47917. void 0 !== e.specular && t.specular.setHex(e.specular),
  47918. void 0 !== e.shininess && (t.shininess = e.shininess),
  47919. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  47920. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  47921. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  47922. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  47923. void 0 !== e.shading && (t.shading = e.shading),
  47924. void 0 !== e.blending && (t.blending = e.blending),
  47925. void 0 !== e.side && (t.side = e.side),
  47926. void 0 !== e.opacity && (t.opacity = e.opacity),
  47927. void 0 !== e.transparent && (t.transparent = e.transparent),
  47928. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  47929. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  47930. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  47931. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  47932. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  47933. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  47934. void 0 !== e.size && (t.size = e.size),
  47935. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  47936. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  47937. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  47938. t.transparent = !0),
  47939. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  47940. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  47941. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  47942. void 0 !== e.normalScale) {
  47943. var i = e.normalScale;
  47944. Array.isArray(i) === !1 && (i = [i, i]),
  47945. t.normalScale = (new n.Vector2).fromArray(i)
  47946. }
  47947. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  47948. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  47949. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  47950. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  47951. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  47952. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  47953. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  47954. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  47955. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  47956. t.combine = n.MultiplyOperation),
  47957. e.reflectivity && (t.reflectivity = e.reflectivity),
  47958. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  47959. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  47960. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  47961. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  47962. void 0 !== e.materials)
  47963. for (var r = 0, o = e.materials.length; r < o; r++)
  47964. t.materials.push(this.parse(e.materials[r]));
  47965. return t
  47966. }
  47967. },
  47968. n.ObjectLoader = function(e) {
  47969. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47970. this.texturePath = ""
  47971. }
  47972. ,
  47973. n.ObjectLoader.prototype = {
  47974. constructor: n.ObjectLoader,
  47975. load: function(e, t, i, r) {
  47976. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  47977. var o = this
  47978. , a = new n.XHRLoader(o.manager);
  47979. a.load(e, function(e) {
  47980. o.parse(JSON.parse(e), t)
  47981. }, i, r)
  47982. },
  47983. setTexturePath: function(e) {
  47984. this.texturePath = e
  47985. },
  47986. setCrossOrigin: function(e) {
  47987. this.crossOrigin = e
  47988. },
  47989. parse: function(e, t) {
  47990. var i = this.parseGeometries(e.geometries)
  47991. , n = this.parseImages(e.images, function() {
  47992. void 0 !== t && t(a)
  47993. })
  47994. , r = this.parseTextures(e.textures, n)
  47995. , o = this.parseMaterials(e.materials, r)
  47996. , a = this.parseObject(e.object, i, o);
  47997. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  47998. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  47999. a
  48000. },
  48001. parseGeometries: function(e) {
  48002. var t = {};
  48003. if (void 0 !== e)
  48004. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48005. var s, l = e[o];
  48006. switch (l.type) {
  48007. case "PlaneGeometry":
  48008. case "PlaneBufferGeometry":
  48009. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48010. break;
  48011. case "BoxGeometry":
  48012. case "BoxBufferGeometry":
  48013. case "CubeGeometry":
  48014. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48015. break;
  48016. case "CircleGeometry":
  48017. case "CircleBufferGeometry":
  48018. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48019. break;
  48020. case "CylinderGeometry":
  48021. case "CylinderBufferGeometry":
  48022. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48023. break;
  48024. case "SphereGeometry":
  48025. case "SphereBufferGeometry":
  48026. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48027. break;
  48028. case "DodecahedronGeometry":
  48029. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48030. break;
  48031. case "IcosahedronGeometry":
  48032. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48033. break;
  48034. case "OctahedronGeometry":
  48035. s = new n.OctahedronGeometry(l.radius,l.detail);
  48036. break;
  48037. case "TetrahedronGeometry":
  48038. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48039. break;
  48040. case "RingGeometry":
  48041. case "RingBufferGeometry":
  48042. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48043. break;
  48044. case "TorusGeometry":
  48045. case "TorusBufferGeometry":
  48046. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48047. break;
  48048. case "TorusKnotGeometry":
  48049. case "TorusKnotBufferGeometry":
  48050. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48051. break;
  48052. case "LatheGeometry":
  48053. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48054. break;
  48055. case "BufferGeometry":
  48056. s = r.parse(l);
  48057. break;
  48058. case "Geometry":
  48059. s = i.parse(l.data, this.texturePath).geometry;
  48060. break;
  48061. default:
  48062. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48063. continue
  48064. }
  48065. s.uuid = l.uuid,
  48066. void 0 !== l.name && (s.name = l.name),
  48067. t[l.uuid] = s
  48068. }
  48069. return t
  48070. },
  48071. parseMaterials: function(e, t) {
  48072. var i = {};
  48073. if (void 0 !== e) {
  48074. var r = new n.MaterialLoader;
  48075. r.setTextures(t);
  48076. for (var o = 0, a = e.length; o < a; o++) {
  48077. var s = r.parse(e[o]);
  48078. i[s.uuid] = s
  48079. }
  48080. }
  48081. return i
  48082. },
  48083. parseAnimations: function(e) {
  48084. for (var t = [], i = 0; i < e.length; i++) {
  48085. var r = n.AnimationClip.parse(e[i]);
  48086. t.push(r)
  48087. }
  48088. return t
  48089. },
  48090. parseImages: function(e, t) {
  48091. function i(e) {
  48092. return r.manager.itemStart(e),
  48093. s.load(e, function() {
  48094. r.manager.itemEnd(e)
  48095. })
  48096. }
  48097. var r = this
  48098. , o = {};
  48099. if (void 0 !== e && e.length > 0) {
  48100. var a = new n.LoadingManager(t)
  48101. , s = new n.ImageLoader(a);
  48102. s.setCrossOrigin(this.crossOrigin);
  48103. for (var l = 0, c = e.length; l < c; l++) {
  48104. var h = e[l]
  48105. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48106. o[h.uuid] = i(u)
  48107. }
  48108. }
  48109. return o
  48110. },
  48111. parseTextures: function(e, t) {
  48112. function i(e) {
  48113. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48114. n[e])
  48115. }
  48116. var r = {};
  48117. if (void 0 !== e)
  48118. for (var o = 0, a = e.length; o < a; o++) {
  48119. var s = e[o];
  48120. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48121. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48122. var l = new n.Texture(t[s.image]);
  48123. l.needsUpdate = !0,
  48124. l.uuid = s.uuid,
  48125. void 0 !== s.name && (l.name = s.name),
  48126. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48127. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48128. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48129. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48130. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48131. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48132. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48133. l.wrapT = i(s.wrap[1])),
  48134. r[s.uuid] = l
  48135. }
  48136. return r
  48137. },
  48138. parseObject: function() {
  48139. var e = new n.Matrix4;
  48140. return function(t, i, r) {
  48141. function o(e) {
  48142. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48143. i[e]
  48144. }
  48145. function a(e) {
  48146. if (void 0 !== e)
  48147. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48148. r[e]
  48149. }
  48150. var s;
  48151. switch (t.type) {
  48152. case "Scene":
  48153. s = new n.Scene;
  48154. break;
  48155. case "PerspectiveCamera":
  48156. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48157. break;
  48158. case "OrthographicCamera":
  48159. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48160. break;
  48161. case "AmbientLight":
  48162. s = new n.AmbientLight(t.color,t.intensity);
  48163. break;
  48164. case "DirectionalLight":
  48165. s = new n.DirectionalLight(t.color,t.intensity);
  48166. break;
  48167. case "PointLight":
  48168. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48169. break;
  48170. case "SpotLight":
  48171. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48172. break;
  48173. case "HemisphereLight":
  48174. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48175. break;
  48176. case "Mesh":
  48177. var l = o(t.geometry)
  48178. , c = a(t.material);
  48179. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48180. break;
  48181. case "LOD":
  48182. s = new n.LOD;
  48183. break;
  48184. case "Line":
  48185. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48186. break;
  48187. case "PointCloud":
  48188. case "Points":
  48189. s = new n.Points(o(t.geometry),a(t.material));
  48190. break;
  48191. case "Sprite":
  48192. s = new n.Sprite(a(t.material));
  48193. break;
  48194. case "Group":
  48195. s = new n.Group;
  48196. break;
  48197. default:
  48198. s = new n.Object3D
  48199. }
  48200. if (s.uuid = t.uuid,
  48201. void 0 !== t.name && (s.name = t.name),
  48202. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48203. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48204. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48205. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48206. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48207. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48208. void 0 !== t.visible && (s.visible = t.visible),
  48209. void 0 !== t.userData && (s.userData = t.userData),
  48210. void 0 !== t.children)
  48211. for (var h in t.children)
  48212. s.add(this.parseObject(t.children[h], i, r));
  48213. if ("LOD" === t.type)
  48214. for (var u = t.levels, d = 0; d < u.length; d++) {
  48215. var p = u[d]
  48216. , h = s.getObjectByProperty("uuid", p.object);
  48217. void 0 !== h && s.addLevel(h, p.distance)
  48218. }
  48219. return s
  48220. }
  48221. }()
  48222. },
  48223. n.TextureLoader = function(e) {
  48224. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48225. }
  48226. ,
  48227. n.TextureLoader.prototype = {
  48228. constructor: n.TextureLoader,
  48229. load: function(e, t, i, r) {
  48230. var o = new n.Texture
  48231. , a = new n.ImageLoader(this.manager);
  48232. return a.setCrossOrigin(this.crossOrigin),
  48233. a.setPath(this.path),
  48234. a.load(e, function(e) {
  48235. o.image = e,
  48236. o.needsUpdate = !0,
  48237. void 0 !== t && t(o)
  48238. }, i, r),
  48239. o
  48240. },
  48241. setCrossOrigin: function(e) {
  48242. this.crossOrigin = e
  48243. },
  48244. setPath: function(e) {
  48245. this.path = e
  48246. }
  48247. },
  48248. n.CubeTextureLoader = function(e) {
  48249. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48250. }
  48251. ,
  48252. n.CubeTextureLoader.prototype = {
  48253. constructor: n.CubeTextureLoader,
  48254. load: function(e, t, i, r) {
  48255. function o(i) {
  48256. s.load(e[i], function(e) {
  48257. a.images[i] = e,
  48258. l++,
  48259. 6 === l && (a.needsUpdate = !0,
  48260. t && t(a))
  48261. }, void 0, r)
  48262. }
  48263. var a = new n.CubeTexture
  48264. , s = new n.ImageLoader(this.manager);
  48265. s.setCrossOrigin(this.crossOrigin),
  48266. s.setPath(this.path);
  48267. for (var l = 0, c = 0; c < e.length; ++c)
  48268. o(c);
  48269. return a
  48270. },
  48271. setCrossOrigin: function(e) {
  48272. this.crossOrigin = e
  48273. },
  48274. setPath: function(e) {
  48275. this.path = e
  48276. }
  48277. },
  48278. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48279. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48280. this._parser = null
  48281. }
  48282. ,
  48283. n.BinaryTextureLoader.prototype = {
  48284. constructor: n.BinaryTextureLoader,
  48285. load: function(e, t, i, r) {
  48286. var o = this
  48287. , a = new n.DataTexture
  48288. , s = new n.XHRLoader(this.manager);
  48289. return s.setResponseType("arraybuffer"),
  48290. s.load(e, function(e) {
  48291. var i = o._parser(e);
  48292. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48293. a.image.height = i.height,
  48294. a.image.data = i.data),
  48295. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48296. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48297. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48298. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48299. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48300. void 0 !== i.format && (a.format = i.format),
  48301. void 0 !== i.type && (a.type = i.type),
  48302. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48303. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48304. a.needsUpdate = !0,
  48305. t && t(a, i))
  48306. }, i, r),
  48307. a
  48308. }
  48309. },
  48310. n.CompressedTextureLoader = function(e) {
  48311. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48312. this._parser = null
  48313. }
  48314. ;
  48315. n.CompressedTextureLoader.prototype = {
  48316. constructor: n.CompressedTextureLoader,
  48317. load: function(e, t, i, r) {
  48318. function o(o) {
  48319. c.load(e[o], function(e) {
  48320. var i = a._parser(e, !0);
  48321. s[o] = {
  48322. width: i.width,
  48323. height: i.height,
  48324. format: i.format,
  48325. mipmaps: i.mipmaps
  48326. },
  48327. h += 1,
  48328. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48329. l.format = i.format,
  48330. l.needsUpdate = !0,
  48331. t && t(l))
  48332. }, i, r)
  48333. }
  48334. var a = this
  48335. , s = []
  48336. , l = new n.CompressedTexture;
  48337. l.image = s;
  48338. var c = new n.XHRLoader(this.manager);
  48339. if (c.setPath(this.path),
  48340. c.setResponseType("arraybuffer"),
  48341. Array.isArray(e))
  48342. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48343. o(u);
  48344. else
  48345. c.load(e, function(e) {
  48346. var i = a._parser(e, !0);
  48347. if (i.isCubemap)
  48348. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48349. s[o] = {
  48350. mipmaps: []
  48351. };
  48352. for (var c = 0; c < i.mipmapCount; c++)
  48353. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48354. s[o].format = i.format,
  48355. s[o].width = i.width,
  48356. s[o].height = i.height
  48357. }
  48358. else
  48359. l.image.width = i.width,
  48360. l.image.height = i.height,
  48361. l.mipmaps = i.mipmaps;
  48362. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48363. l.format = i.format,
  48364. l.needsUpdate = !0,
  48365. t && t(l)
  48366. }, i, r);
  48367. return l
  48368. },
  48369. setPath: function(e) {
  48370. this.path = e
  48371. }
  48372. };
  48373. n.Material = function() {
  48374. Object.defineProperty(this, "id", {
  48375. value: n.MaterialIdCount++
  48376. }),
  48377. this.uuid = n.Math.generateUUID(),
  48378. this.name = "",
  48379. this.type = "Material",
  48380. this.side = n.FrontSide,
  48381. this.opacity = 1,
  48382. this.transparent = !1,
  48383. this.blending = n.NormalBlending,
  48384. this.blendSrc = n.SrcAlphaFactor,
  48385. this.blendDst = n.OneMinusSrcAlphaFactor,
  48386. this.blendEquation = n.AddEquation,
  48387. this.blendSrcAlpha = null,
  48388. this.blendDstAlpha = null,
  48389. this.blendEquationAlpha = null,
  48390. this.depthFunc = n.LessEqualDepth,
  48391. this.depthTest = !0,
  48392. this.depthWrite = !0,
  48393. this.colorWrite = !0,
  48394. this.precision = null,
  48395. this.polygonOffset = !1,
  48396. this.polygonOffsetFactor = 0,
  48397. this.polygonOffsetUnits = 0,
  48398. this.alphaTest = 0,
  48399. this.premultipliedAlpha = !1,
  48400. this.overdraw = 0,
  48401. this.visible = !0,
  48402. this._needsUpdate = !0
  48403. }
  48404. ,
  48405. n.Material.prototype = {
  48406. constructor: n.Material,
  48407. get needsUpdate() {
  48408. return this._needsUpdate
  48409. },
  48410. set needsUpdate(e) {
  48411. e === !0 && this.update(),
  48412. this._needsUpdate = e
  48413. },
  48414. setValues: function(e) {
  48415. if (void 0 !== e)
  48416. for (var t in e) {
  48417. var i = e[t];
  48418. if (void 0 !== i) {
  48419. var r = this[t];
  48420. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  48421. } else
  48422. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48423. }
  48424. },
  48425. toJSON: function(e) {
  48426. function t(e) {
  48427. var t = [];
  48428. for (var i in e) {
  48429. var n = e[i];
  48430. delete n.metadata,
  48431. t.push(n)
  48432. }
  48433. return t
  48434. }
  48435. var i = void 0 === e;
  48436. i && (e = {
  48437. textures: {},
  48438. images: {}
  48439. });
  48440. var r = {
  48441. metadata: {
  48442. version: 4.4,
  48443. type: "Material",
  48444. generator: "Material.toJSON"
  48445. }
  48446. };
  48447. if (r.uuid = this.uuid,
  48448. r.type = this.type,
  48449. "" !== this.name && (r.name = this.name),
  48450. this.color instanceof n.Color && (r.color = this.color.getHex()),
  48451. .5 !== this.roughness && (r.roughness = this.roughness),
  48452. .5 !== this.metalness && (r.metalness = this.metalness),
  48453. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  48454. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  48455. void 0 !== this.shininess && (r.shininess = this.shininess),
  48456. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  48457. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  48458. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  48459. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  48460. r.bumpScale = this.bumpScale),
  48461. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  48462. r.normalScale = this.normalScale.toArray()),
  48463. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  48464. r.displacementScale = this.displacementScale,
  48465. r.displacementBias = this.displacementBias),
  48466. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  48467. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  48468. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  48469. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  48470. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  48471. r.reflectivity = this.reflectivity),
  48472. void 0 !== this.size && (r.size = this.size),
  48473. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  48474. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  48475. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  48476. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  48477. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  48478. this.opacity < 1 && (r.opacity = this.opacity),
  48479. this.transparent === !0 && (r.transparent = this.transparent),
  48480. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  48481. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  48482. this.wireframe === !0 && (r.wireframe = this.wireframe),
  48483. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  48484. i) {
  48485. var o = t(e.textures)
  48486. , a = t(e.images);
  48487. o.length > 0 && (r.textures = o),
  48488. a.length > 0 && (r.images = a)
  48489. }
  48490. return r
  48491. },
  48492. clone: function() {
  48493. return (new this.constructor).copy(this)
  48494. },
  48495. copy: function(e) {
  48496. return this.name = e.name,
  48497. this.side = e.side,
  48498. this.opacity = e.opacity,
  48499. this.transparent = e.transparent,
  48500. this.blending = e.blending,
  48501. this.blendSrc = e.blendSrc,
  48502. this.blendDst = e.blendDst,
  48503. this.blendEquation = e.blendEquation,
  48504. this.blendSrcAlpha = e.blendSrcAlpha,
  48505. this.blendDstAlpha = e.blendDstAlpha,
  48506. this.blendEquationAlpha = e.blendEquationAlpha,
  48507. this.depthFunc = e.depthFunc,
  48508. this.depthTest = e.depthTest,
  48509. this.depthWrite = e.depthWrite,
  48510. this.colorWrite = e.colorWrite,
  48511. this.precision = e.precision,
  48512. this.polygonOffset = e.polygonOffset,
  48513. this.polygonOffsetFactor = e.polygonOffsetFactor,
  48514. this.polygonOffsetUnits = e.polygonOffsetUnits,
  48515. this.alphaTest = e.alphaTest,
  48516. this.premultipliedAlpha = e.premultipliedAlpha,
  48517. this.overdraw = e.overdraw,
  48518. this.visible = e.visible,
  48519. this
  48520. },
  48521. update: function() {
  48522. this.dispatchEvent({
  48523. type: "update"
  48524. })
  48525. },
  48526. dispose: function() {
  48527. this.dispatchEvent({
  48528. type: "dispose"
  48529. })
  48530. }
  48531. },
  48532. n.EventDispatcher.prototype.apply(n.Material.prototype),
  48533. n.MaterialIdCount = 0,
  48534. n.LineBasicMaterial = function(e) {
  48535. n.Material.call(this),
  48536. this.type = "LineBasicMaterial",
  48537. this.color = new n.Color(16777215),
  48538. this.linewidth = 1,
  48539. this.linecap = "round",
  48540. this.linejoin = "round",
  48541. this.blending = n.NormalBlending,
  48542. this.vertexColors = n.NoColors,
  48543. this.fog = !0,
  48544. this.setValues(e)
  48545. }
  48546. ,
  48547. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  48548. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  48549. n.LineBasicMaterial.prototype.copy = function(e) {
  48550. return n.Material.prototype.copy.call(this, e),
  48551. this.color.copy(e.color),
  48552. this.linewidth = e.linewidth,
  48553. this.linecap = e.linecap,
  48554. this.linejoin = e.linejoin,
  48555. this.vertexColors = e.vertexColors,
  48556. this.fog = e.fog,
  48557. this
  48558. }
  48559. ,
  48560. n.LineDashedMaterial = function(e) {
  48561. n.Material.call(this),
  48562. this.type = "LineDashedMaterial",
  48563. this.color = new n.Color(16777215),
  48564. this.linewidth = 1,
  48565. this.scale = 1,
  48566. this.dashSize = 3,
  48567. this.gapSize = 1,
  48568. this.blending = n.NormalBlending,
  48569. this.vertexColors = n.NoColors,
  48570. this.fog = !0,
  48571. this.setValues(e)
  48572. }
  48573. ,
  48574. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  48575. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  48576. n.LineDashedMaterial.prototype.copy = function(e) {
  48577. return n.Material.prototype.copy.call(this, e),
  48578. this.color.copy(e.color),
  48579. this.linewidth = e.linewidth,
  48580. this.scale = e.scale,
  48581. this.dashSize = e.dashSize,
  48582. this.gapSize = e.gapSize,
  48583. this.vertexColors = e.vertexColors,
  48584. this.fog = e.fog,
  48585. this
  48586. }
  48587. ,
  48588. n.MeshBasicMaterial = function(e) {
  48589. n.Material.call(this),
  48590. this.type = "MeshBasicMaterial",
  48591. this.color = new n.Color(16777215),
  48592. this.map = null,
  48593. this.aoMap = null,
  48594. this.aoMapIntensity = 1,
  48595. this.specularMap = null,
  48596. this.alphaMap = null,
  48597. this.envMap = null,
  48598. this.combine = n.MultiplyOperation,
  48599. this.reflectivity = 1,
  48600. this.refractionRatio = .98,
  48601. this.fog = !0,
  48602. this.shading = n.SmoothShading,
  48603. this.blending = n.NormalBlending,
  48604. this.wireframe = !1,
  48605. this.wireframeLinewidth = 1,
  48606. this.wireframeLinecap = "round",
  48607. this.wireframeLinejoin = "round",
  48608. this.vertexColors = n.NoColors,
  48609. this.skinning = !1,
  48610. this.morphTargets = !1,
  48611. this.setValues(e)
  48612. }
  48613. ,
  48614. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  48615. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  48616. n.MeshBasicMaterial.prototype.copy = function(e) {
  48617. return n.Material.prototype.copy.call(this, e),
  48618. this.color.copy(e.color),
  48619. this.map = e.map,
  48620. this.aoMap = e.aoMap,
  48621. this.aoMapIntensity = e.aoMapIntensity,
  48622. this.specularMap = e.specularMap,
  48623. this.alphaMap = e.alphaMap,
  48624. this.envMap = e.envMap,
  48625. this.combine = e.combine,
  48626. this.reflectivity = e.reflectivity,
  48627. this.refractionRatio = e.refractionRatio,
  48628. this.fog = e.fog,
  48629. this.shading = e.shading,
  48630. this.wireframe = e.wireframe,
  48631. this.wireframeLinewidth = e.wireframeLinewidth,
  48632. this.wireframeLinecap = e.wireframeLinecap,
  48633. this.wireframeLinejoin = e.wireframeLinejoin,
  48634. this.vertexColors = e.vertexColors,
  48635. this.skinning = e.skinning,
  48636. this.morphTargets = e.morphTargets,
  48637. this
  48638. }
  48639. ,
  48640. n.MeshLambertMaterial = function(e) {
  48641. n.Material.call(this),
  48642. this.type = "MeshLambertMaterial",
  48643. this.color = new n.Color(16777215),
  48644. this.map = null,
  48645. this.lightMap = null,
  48646. this.lightMapIntensity = 1,
  48647. this.aoMap = null,
  48648. this.aoMapIntensity = 1,
  48649. this.emissive = new n.Color(0),
  48650. this.emissiveIntensity = 1,
  48651. this.emissiveMap = null,
  48652. this.specularMap = null,
  48653. this.alphaMap = null,
  48654. this.envMap = null,
  48655. this.combine = n.MultiplyOperation,
  48656. this.reflectivity = 1,
  48657. this.refractionRatio = .98,
  48658. this.fog = !0,
  48659. this.blending = n.NormalBlending,
  48660. this.wireframe = !1,
  48661. this.wireframeLinewidth = 1,
  48662. this.wireframeLinecap = "round",
  48663. this.wireframeLinejoin = "round",
  48664. this.vertexColors = n.NoColors,
  48665. this.skinning = !1,
  48666. this.morphTargets = !1,
  48667. this.morphNormals = !1,
  48668. this.setValues(e)
  48669. }
  48670. ,
  48671. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  48672. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  48673. n.MeshLambertMaterial.prototype.copy = function(e) {
  48674. return n.Material.prototype.copy.call(this, e),
  48675. this.color.copy(e.color),
  48676. this.map = e.map,
  48677. this.lightMap = e.lightMap,
  48678. this.lightMapIntensity = e.lightMapIntensity,
  48679. this.aoMap = e.aoMap,
  48680. this.aoMapIntensity = e.aoMapIntensity,
  48681. this.emissive.copy(e.emissive),
  48682. this.emissiveMap = e.emissiveMap,
  48683. this.emissiveIntensity = e.emissiveIntensity,
  48684. this.specularMap = e.specularMap,
  48685. this.alphaMap = e.alphaMap,
  48686. this.envMap = e.envMap,
  48687. this.combine = e.combine,
  48688. this.reflectivity = e.reflectivity,
  48689. this.refractionRatio = e.refractionRatio,
  48690. this.fog = e.fog,
  48691. this.wireframe = e.wireframe,
  48692. this.wireframeLinewidth = e.wireframeLinewidth,
  48693. this.wireframeLinecap = e.wireframeLinecap,
  48694. this.wireframeLinejoin = e.wireframeLinejoin,
  48695. this.vertexColors = e.vertexColors,
  48696. this.skinning = e.skinning,
  48697. this.morphTargets = e.morphTargets,
  48698. this.morphNormals = e.morphNormals,
  48699. this
  48700. }
  48701. ,
  48702. n.MeshPhongMaterial = function(e) {
  48703. n.Material.call(this),
  48704. this.type = "MeshPhongMaterial",
  48705. this.color = new n.Color(16777215),
  48706. this.specular = new n.Color(1118481),
  48707. this.shininess = 30,
  48708. this.map = null,
  48709. this.lightMap = null,
  48710. this.lightMapIntensity = 1,
  48711. this.aoMap = null,
  48712. this.aoMapIntensity = 1,
  48713. this.emissive = new n.Color(0),
  48714. this.emissiveIntensity = 1,
  48715. this.emissiveMap = null,
  48716. this.bumpMap = null,
  48717. this.bumpScale = 1,
  48718. this.normalMap = null,
  48719. this.normalScale = new n.Vector2(1,1),
  48720. this.displacementMap = null,
  48721. this.displacementScale = 1,
  48722. this.displacementBias = 0,
  48723. this.specularMap = null,
  48724. this.alphaMap = null,
  48725. this.envMap = null,
  48726. this.combine = n.MultiplyOperation,
  48727. this.reflectivity = 1,
  48728. this.refractionRatio = .98,
  48729. this.fog = !0,
  48730. this.shading = n.SmoothShading,
  48731. this.blending = n.NormalBlending,
  48732. this.wireframe = !1,
  48733. this.wireframeLinewidth = 1,
  48734. this.wireframeLinecap = "round",
  48735. this.wireframeLinejoin = "round",
  48736. this.vertexColors = n.NoColors,
  48737. this.skinning = !1,
  48738. this.morphTargets = !1,
  48739. this.morphNormals = !1,
  48740. this.setValues(e)
  48741. }
  48742. ,
  48743. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  48744. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  48745. n.MeshPhongMaterial.prototype.copy = function(e) {
  48746. return n.Material.prototype.copy.call(this, e),
  48747. this.color.copy(e.color),
  48748. this.specular.copy(e.specular),
  48749. this.shininess = e.shininess,
  48750. this.map = e.map,
  48751. this.lightMap = e.lightMap,
  48752. this.lightMapIntensity = e.lightMapIntensity,
  48753. this.aoMap = e.aoMap,
  48754. this.aoMapIntensity = e.aoMapIntensity,
  48755. this.emissive.copy(e.emissive),
  48756. this.emissiveMap = e.emissiveMap,
  48757. this.emissiveIntensity = e.emissiveIntensity,
  48758. this.bumpMap = e.bumpMap,
  48759. this.bumpScale = e.bumpScale,
  48760. this.normalMap = e.normalMap,
  48761. this.normalScale.copy(e.normalScale),
  48762. this.displacementMap = e.displacementMap,
  48763. this.displacementScale = e.displacementScale,
  48764. this.displacementBias = e.displacementBias,
  48765. this.specularMap = e.specularMap,
  48766. this.alphaMap = e.alphaMap,
  48767. this.envMap = e.envMap,
  48768. this.combine = e.combine,
  48769. this.reflectivity = e.reflectivity,
  48770. this.refractionRatio = e.refractionRatio,
  48771. this.fog = e.fog,
  48772. this.shading = e.shading,
  48773. this.wireframe = e.wireframe,
  48774. this.wireframeLinewidth = e.wireframeLinewidth,
  48775. this.wireframeLinecap = e.wireframeLinecap,
  48776. this.wireframeLinejoin = e.wireframeLinejoin,
  48777. this.vertexColors = e.vertexColors,
  48778. this.skinning = e.skinning,
  48779. this.morphTargets = e.morphTargets,
  48780. this.morphNormals = e.morphNormals,
  48781. this
  48782. }
  48783. ,
  48784. n.MeshStandardMaterial = function(e) {
  48785. n.Material.call(this),
  48786. this.type = "MeshStandardMaterial",
  48787. this.color = new n.Color(16777215),
  48788. this.roughness = .5,
  48789. this.metalness = .5,
  48790. this.map = null,
  48791. this.lightMap = null,
  48792. this.lightMapIntensity = 1,
  48793. this.aoMap = null,
  48794. this.aoMapIntensity = 1,
  48795. this.emissive = new n.Color(0),
  48796. this.emissiveIntensity = 1,
  48797. this.emissiveMap = null,
  48798. this.bumpMap = null,
  48799. this.bumpScale = 1,
  48800. this.normalMap = null,
  48801. this.normalScale = new n.Vector2(1,1),
  48802. this.displacementMap = null,
  48803. this.displacementScale = 1,
  48804. this.displacementBias = 0,
  48805. this.roughnessMap = null,
  48806. this.metalnessMap = null,
  48807. this.alphaMap = null,
  48808. this.envMap = null,
  48809. this.envMapIntensity = 1,
  48810. this.refractionRatio = .98,
  48811. this.fog = !0,
  48812. this.shading = n.SmoothShading,
  48813. this.blending = n.NormalBlending,
  48814. this.wireframe = !1,
  48815. this.wireframeLinewidth = 1,
  48816. this.wireframeLinecap = "round",
  48817. this.wireframeLinejoin = "round",
  48818. this.vertexColors = n.NoColors,
  48819. this.skinning = !1,
  48820. this.morphTargets = !1,
  48821. this.morphNormals = !1,
  48822. this.setValues(e)
  48823. }
  48824. ,
  48825. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  48826. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  48827. n.MeshStandardMaterial.prototype.copy = function(e) {
  48828. return n.Material.prototype.copy.call(this, e),
  48829. this.color.copy(e.color),
  48830. this.roughness = e.roughness,
  48831. this.metalness = e.metalness,
  48832. this.map = e.map,
  48833. this.lightMap = e.lightMap,
  48834. this.lightMapIntensity = e.lightMapIntensity,
  48835. this.aoMap = e.aoMap,
  48836. this.aoMapIntensity = e.aoMapIntensity,
  48837. this.emissive.copy(e.emissive),
  48838. this.emissiveMap = e.emissiveMap,
  48839. this.emissiveIntensity = e.emissiveIntensity,
  48840. this.bumpMap = e.bumpMap,
  48841. this.bumpScale = e.bumpScale,
  48842. this.normalMap = e.normalMap,
  48843. this.normalScale.copy(e.normalScale),
  48844. this.displacementMap = e.displacementMap,
  48845. this.displacementScale = e.displacementScale,
  48846. this.displacementBias = e.displacementBias,
  48847. this.roughnessMap = e.roughnessMap,
  48848. this.metalnessMap = e.metalnessMap,
  48849. this.alphaMap = e.alphaMap,
  48850. this.envMap = e.envMap,
  48851. this.envMapIntensity = e.envMapIntensity,
  48852. this.refractionRatio = e.refractionRatio,
  48853. this.fog = e.fog,
  48854. this.shading = e.shading,
  48855. this.wireframe = e.wireframe,
  48856. this.wireframeLinewidth = e.wireframeLinewidth,
  48857. this.wireframeLinecap = e.wireframeLinecap,
  48858. this.wireframeLinejoin = e.wireframeLinejoin,
  48859. this.vertexColors = e.vertexColors,
  48860. this.skinning = e.skinning,
  48861. this.morphTargets = e.morphTargets,
  48862. this.morphNormals = e.morphNormals,
  48863. this
  48864. }
  48865. ,
  48866. n.MeshDepthMaterial = function(e) {
  48867. n.Material.call(this),
  48868. this.type = "MeshDepthMaterial",
  48869. this.morphTargets = !1,
  48870. this.wireframe = !1,
  48871. this.wireframeLinewidth = 1,
  48872. this.setValues(e)
  48873. }
  48874. ,
  48875. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  48876. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  48877. n.MeshDepthMaterial.prototype.copy = function(e) {
  48878. return n.Material.prototype.copy.call(this, e),
  48879. this.wireframe = e.wireframe,
  48880. this.wireframeLinewidth = e.wireframeLinewidth,
  48881. this
  48882. }
  48883. ,
  48884. n.MeshNormalMaterial = function(e) {
  48885. n.Material.call(this, e),
  48886. this.type = "MeshNormalMaterial",
  48887. this.wireframe = !1,
  48888. this.wireframeLinewidth = 1,
  48889. this.morphTargets = !1,
  48890. this.setValues(e)
  48891. }
  48892. ,
  48893. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  48894. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  48895. n.MeshNormalMaterial.prototype.copy = function(e) {
  48896. return n.Material.prototype.copy.call(this, e),
  48897. this.wireframe = e.wireframe,
  48898. this.wireframeLinewidth = e.wireframeLinewidth,
  48899. this
  48900. }
  48901. ,
  48902. n.MultiMaterial = function(e) {
  48903. this.uuid = n.Math.generateUUID(),
  48904. this.type = "MultiMaterial",
  48905. this.materials = e instanceof Array ? e : [],
  48906. this.visible = !0
  48907. }
  48908. ,
  48909. n.MultiMaterial.prototype = {
  48910. constructor: n.MultiMaterial,
  48911. toJSON: function(e) {
  48912. for (var t = {
  48913. metadata: {
  48914. version: 4.2,
  48915. type: "material",
  48916. generator: "MaterialExporter"
  48917. },
  48918. uuid: this.uuid,
  48919. type: this.type,
  48920. materials: []
  48921. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  48922. var o = i[n].toJSON(e);
  48923. delete o.metadata,
  48924. t.materials.push(o)
  48925. }
  48926. return t.visible = this.visible,
  48927. t
  48928. },
  48929. clone: function() {
  48930. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  48931. e.materials.push(this.materials[t].clone());
  48932. return e.visible = this.visible,
  48933. e
  48934. }
  48935. },
  48936. n.PointsMaterial = function(e) {
  48937. n.Material.call(this),
  48938. this.type = "PointsMaterial",
  48939. this.color = new n.Color(16777215),
  48940. this.map = null,
  48941. this.size = 1,
  48942. this.sizeAttenuation = !0,
  48943. this.blending = n.NormalBlending,
  48944. this.vertexColors = n.NoColors,
  48945. this.fog = !0,
  48946. this.setValues(e)
  48947. }
  48948. ,
  48949. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  48950. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  48951. n.PointsMaterial.prototype.copy = function(e) {
  48952. return n.Material.prototype.copy.call(this, e),
  48953. this.color.copy(e.color),
  48954. this.map = e.map,
  48955. this.size = e.size,
  48956. this.sizeAttenuation = e.sizeAttenuation,
  48957. this.vertexColors = e.vertexColors,
  48958. this.fog = e.fog,
  48959. this
  48960. }
  48961. ,
  48962. n.ShaderMaterial = function(e) {
  48963. n.Material.call(this),
  48964. this.type = "ShaderMaterial",
  48965. this.defines = {},
  48966. this.uniforms = {},
  48967. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  48968. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  48969. this.shading = n.SmoothShading,
  48970. this.linewidth = 1,
  48971. this.wireframe = !1,
  48972. this.wireframeLinewidth = 1,
  48973. this.fog = !1,
  48974. this.lights = !1,
  48975. this.vertexColors = n.NoColors,
  48976. this.skinning = !1,
  48977. this.morphTargets = !1,
  48978. this.morphNormals = !1,
  48979. this.extensions = {
  48980. derivatives: !1,
  48981. fragDepth: !1,
  48982. drawBuffers: !1,
  48983. shaderTextureLOD: !1
  48984. },
  48985. this.defaultAttributeValues = {
  48986. color: [1, 1, 1],
  48987. uv: [0, 0],
  48988. uv2: [0, 0]
  48989. },
  48990. this.index0AttributeName = void 0,
  48991. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  48992. this.setValues(e))
  48993. }
  48994. ,
  48995. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  48996. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  48997. n.ShaderMaterial.prototype.copy = function(e) {
  48998. return n.Material.prototype.copy.call(this, e),
  48999. this.fragmentShader = e.fragmentShader,
  49000. this.vertexShader = e.vertexShader,
  49001. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49002. this.defines = e.defines,
  49003. this.shading = e.shading,
  49004. this.wireframe = e.wireframe,
  49005. this.wireframeLinewidth = e.wireframeLinewidth,
  49006. this.fog = e.fog,
  49007. this.lights = e.lights,
  49008. this.vertexColors = e.vertexColors,
  49009. this.skinning = e.skinning,
  49010. this.morphTargets = e.morphTargets,
  49011. this.morphNormals = e.morphNormals,
  49012. this.extensions = e.extensions,
  49013. this
  49014. }
  49015. ,
  49016. n.ShaderMaterial.prototype.toJSON = function(e) {
  49017. var t = n.Material.prototype.toJSON.call(this, e);
  49018. return t.uniforms = this.uniforms,
  49019. t.vertexShader = this.vertexShader,
  49020. t.fragmentShader = this.fragmentShader,
  49021. t
  49022. }
  49023. ,
  49024. n.RawShaderMaterial = function(e) {
  49025. n.ShaderMaterial.call(this, e),
  49026. this.type = "RawShaderMaterial"
  49027. }
  49028. ,
  49029. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49030. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49031. n.SpriteMaterial = function(e) {
  49032. n.Material.call(this),
  49033. this.type = "SpriteMaterial",
  49034. this.color = new n.Color(16777215),
  49035. this.map = null,
  49036. this.rotation = 0,
  49037. this.fog = !1,
  49038. this.setValues(e)
  49039. }
  49040. ,
  49041. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49042. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49043. n.SpriteMaterial.prototype.copy = function(e) {
  49044. return n.Material.prototype.copy.call(this, e),
  49045. this.color.copy(e.color),
  49046. this.map = e.map,
  49047. this.rotation = e.rotation,
  49048. this.fog = e.fog,
  49049. this
  49050. }
  49051. ,
  49052. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49053. Object.defineProperty(this, "id", {
  49054. value: n.TextureIdCount++
  49055. }),
  49056. this.uuid = n.Math.generateUUID(),
  49057. this.name = "",
  49058. this.sourceFile = "",
  49059. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49060. this.mipmaps = [],
  49061. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49062. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49063. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49064. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49065. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49066. this.anisotropy = void 0 !== c ? c : 1,
  49067. this.format = void 0 !== s ? s : n.RGBAFormat,
  49068. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49069. this.offset = new n.Vector2(0,0),
  49070. this.repeat = new n.Vector2(1,1),
  49071. this.generateMipmaps = !0,
  49072. this.premultiplyAlpha = !1,
  49073. this.flipY = !0,
  49074. this.unpackAlignment = 4,
  49075. this.encoding = n.LinearEncoding,
  49076. this.version = 0,
  49077. this.onUpdate = null
  49078. }
  49079. ,
  49080. n.Texture.DEFAULT_IMAGE = void 0,
  49081. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49082. n.Texture.prototype = {
  49083. constructor: n.Texture,
  49084. set needsUpdate(e) {
  49085. e === !0 && this.version++
  49086. },
  49087. clone: function() {
  49088. return (new this.constructor).copy(this)
  49089. },
  49090. copy: function(e) {
  49091. return this.image = e.image,
  49092. this.mipmaps = e.mipmaps.slice(0),
  49093. this.mapping = e.mapping,
  49094. this.wrapS = e.wrapS,
  49095. this.wrapT = e.wrapT,
  49096. this.magFilter = e.magFilter,
  49097. this.minFilter = e.minFilter,
  49098. this.anisotropy = e.anisotropy,
  49099. this.format = e.format,
  49100. this.type = e.type,
  49101. this.offset.copy(e.offset),
  49102. this.repeat.copy(e.repeat),
  49103. this.generateMipmaps = e.generateMipmaps,
  49104. this.premultiplyAlpha = e.premultiplyAlpha,
  49105. this.flipY = e.flipY,
  49106. this.unpackAlignment = e.unpackAlignment,
  49107. this.encoding = e.encoding,
  49108. this
  49109. },
  49110. toJSON: function(e) {
  49111. function t(e) {
  49112. var t;
  49113. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49114. t.width = e.width,
  49115. t.height = e.height,
  49116. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49117. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49118. }
  49119. if (void 0 !== e.textures[this.uuid])
  49120. return e.textures[this.uuid];
  49121. var i = {
  49122. metadata: {
  49123. version: 4.4,
  49124. type: "Texture",
  49125. generator: "Texture.toJSON"
  49126. },
  49127. uuid: this.uuid,
  49128. name: this.name,
  49129. mapping: this.mapping,
  49130. repeat: [this.repeat.x, this.repeat.y],
  49131. offset: [this.offset.x, this.offset.y],
  49132. wrap: [this.wrapS, this.wrapT],
  49133. minFilter: this.minFilter,
  49134. magFilter: this.magFilter,
  49135. anisotropy: this.anisotropy
  49136. };
  49137. if (void 0 !== this.image) {
  49138. var r = this.image;
  49139. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49140. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49141. uuid: r.uuid,
  49142. url: t(r)
  49143. }),
  49144. i.image = r.uuid
  49145. }
  49146. return e.textures[this.uuid] = i,
  49147. i
  49148. },
  49149. dispose: function() {
  49150. this.dispatchEvent({
  49151. type: "dispose"
  49152. })
  49153. },
  49154. transformUv: function(e) {
  49155. if (this.mapping === n.UVMapping) {
  49156. if (e.multiply(this.repeat),
  49157. e.add(this.offset),
  49158. e.x < 0 || e.x > 1)
  49159. switch (this.wrapS) {
  49160. case n.RepeatWrapping:
  49161. e.x = e.x - Math.floor(e.x);
  49162. break;
  49163. case n.ClampToEdgeWrapping:
  49164. e.x = e.x < 0 ? 0 : 1;
  49165. break;
  49166. case n.MirroredRepeatWrapping:
  49167. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49168. }
  49169. if (e.y < 0 || e.y > 1)
  49170. switch (this.wrapT) {
  49171. case n.RepeatWrapping:
  49172. e.y = e.y - Math.floor(e.y);
  49173. break;
  49174. case n.ClampToEdgeWrapping:
  49175. e.y = e.y < 0 ? 0 : 1;
  49176. break;
  49177. case n.MirroredRepeatWrapping:
  49178. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49179. }
  49180. this.flipY && (e.y = 1 - e.y)
  49181. }
  49182. }
  49183. },
  49184. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49185. n.TextureIdCount = 0,
  49186. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49187. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49188. this.needsUpdate = !0
  49189. }
  49190. ,
  49191. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49192. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49193. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49194. e = void 0 !== e ? e : [],
  49195. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49196. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49197. this.flipY = !1
  49198. }
  49199. ,
  49200. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49201. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49202. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49203. get: function() {
  49204. return this.image
  49205. },
  49206. set: function(e) {
  49207. this.image = e
  49208. }
  49209. }),
  49210. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49211. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49212. this.image = {
  49213. width: t,
  49214. height: i
  49215. },
  49216. this.mipmaps = e,
  49217. this.flipY = !1,
  49218. this.generateMipmaps = !1
  49219. }
  49220. ,
  49221. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49222. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49223. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49224. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49225. this.image = {
  49226. data: e,
  49227. width: t,
  49228. height: i
  49229. },
  49230. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49231. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49232. this.flipY = !1,
  49233. this.generateMipmaps = !1
  49234. }
  49235. ,
  49236. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49237. n.DataTexture.prototype.constructor = n.DataTexture,
  49238. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49239. function h() {
  49240. requestAnimationFrame(h),
  49241. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  49242. }
  49243. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49244. this.generateMipmaps = !1;
  49245. var u = this;
  49246. h()
  49247. }
  49248. ,
  49249. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49250. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49251. n.Group = function() {
  49252. n.Object3D.call(this),
  49253. this.type = "Group"
  49254. }
  49255. ,
  49256. n.Group.prototype = Object.create(n.Object3D.prototype),
  49257. n.Group.prototype.constructor = n.Group,
  49258. n.Points = function(e, t) {
  49259. n.Object3D.call(this),
  49260. this.type = "Points",
  49261. this.geometry = void 0 !== e ? e : new n.Geometry,
  49262. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49263. color: 16777215 * Math.random()
  49264. })
  49265. }
  49266. ,
  49267. n.Points.prototype = Object.create(n.Object3D.prototype),
  49268. n.Points.prototype.constructor = n.Points,
  49269. n.Points.prototype.raycast = function() {
  49270. var e = new n.Matrix4
  49271. , t = new n.Ray
  49272. , i = new n.Sphere;
  49273. return function(r, o) {
  49274. function a(e, i) {
  49275. var n = t.distanceSqToPoint(e);
  49276. if (n < d) {
  49277. var a = t.closestPointToPoint(e);
  49278. a.applyMatrix4(c);
  49279. var l = r.ray.origin.distanceTo(a);
  49280. if (l < r.near || l > r.far)
  49281. return;
  49282. o.push({
  49283. distance: l,
  49284. distanceToRay: Math.sqrt(n),
  49285. point: a.clone(),
  49286. index: i,
  49287. face: null,
  49288. object: s
  49289. })
  49290. }
  49291. }
  49292. var s = this
  49293. , l = this.geometry
  49294. , c = this.matrixWorld
  49295. , h = r.params.Points.threshold;
  49296. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49297. i.copy(l.boundingSphere),
  49298. i.applyMatrix4(c),
  49299. r.ray.intersectsSphere(i) !== !1) {
  49300. e.getInverse(c),
  49301. t.copy(r.ray).applyMatrix4(e);
  49302. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49303. , d = u * u
  49304. , p = new n.Vector3;
  49305. if (l instanceof n.BufferGeometry) {
  49306. var f = l.index
  49307. , g = l.attributes
  49308. , m = g.position.array;
  49309. if (null !== f)
  49310. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49311. var C = v[A];
  49312. p.fromArray(m, 3 * C),
  49313. a(p, C)
  49314. }
  49315. else
  49316. for (var A = 0, I = m.length / 3; A < I; A++)
  49317. p.fromArray(m, 3 * A),
  49318. a(p, A)
  49319. } else
  49320. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49321. a(E[A], A)
  49322. }
  49323. }
  49324. }(),
  49325. n.Points.prototype.clone = function() {
  49326. return new this.constructor(this.geometry,this.material).copy(this)
  49327. }
  49328. ,
  49329. n.Line = function(e, t, i) {
  49330. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49331. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49332. this.type = "Line",
  49333. this.geometry = void 0 !== e ? e : new n.Geometry,
  49334. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49335. color: 16777215 * Math.random()
  49336. })))
  49337. }
  49338. ,
  49339. n.Line.prototype = Object.create(n.Object3D.prototype),
  49340. n.Line.prototype.constructor = n.Line,
  49341. n.Line.prototype.raycast = function() {
  49342. var e = new n.Matrix4
  49343. , t = new n.Ray
  49344. , i = new n.Sphere;
  49345. return function(r, o) {
  49346. var a = r.linePrecision
  49347. , s = a * a
  49348. , l = this.geometry
  49349. , c = this.matrixWorld;
  49350. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49351. i.copy(l.boundingSphere),
  49352. i.applyMatrix4(c),
  49353. r.ray.intersectsSphere(i) !== !1) {
  49354. e.getInverse(c),
  49355. t.copy(r.ray).applyMatrix4(e);
  49356. var h = new n.Vector3
  49357. , u = new n.Vector3
  49358. , d = new n.Vector3
  49359. , p = new n.Vector3
  49360. , f = this instanceof n.LineSegments ? 2 : 1;
  49361. if (l instanceof n.BufferGeometry) {
  49362. var g = l.index
  49363. , m = l.attributes
  49364. , v = m.position.array;
  49365. if (null !== g)
  49366. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49367. var I = A[y]
  49368. , E = A[y + 1];
  49369. h.fromArray(v, 3 * I),
  49370. u.fromArray(v, 3 * E);
  49371. var b = t.distanceSqToSegment(h, u, p, d);
  49372. if (!(b > s)) {
  49373. p.applyMatrix4(this.matrixWorld);
  49374. var w = r.ray.origin.distanceTo(p);
  49375. w < r.near || w > r.far || o.push({
  49376. distance: w,
  49377. point: d.clone().applyMatrix4(this.matrixWorld),
  49378. index: y,
  49379. face: null,
  49380. faceIndex: null,
  49381. object: this
  49382. })
  49383. }
  49384. }
  49385. else
  49386. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49387. h.fromArray(v, 3 * y),
  49388. u.fromArray(v, 3 * y + 3);
  49389. var b = t.distanceSqToSegment(h, u, p, d);
  49390. if (!(b > s)) {
  49391. p.applyMatrix4(this.matrixWorld);
  49392. var w = r.ray.origin.distanceTo(p);
  49393. w < r.near || w > r.far || o.push({
  49394. distance: w,
  49395. point: d.clone().applyMatrix4(this.matrixWorld),
  49396. index: y,
  49397. face: null,
  49398. faceIndex: null,
  49399. object: this
  49400. })
  49401. }
  49402. }
  49403. } else if (l instanceof n.Geometry)
  49404. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49405. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49406. if (!(b > s)) {
  49407. p.applyMatrix4(this.matrixWorld);
  49408. var w = r.ray.origin.distanceTo(p);
  49409. w < r.near || w > r.far || o.push({
  49410. distance: w,
  49411. point: d.clone().applyMatrix4(this.matrixWorld),
  49412. index: y,
  49413. face: null,
  49414. faceIndex: null,
  49415. object: this
  49416. })
  49417. }
  49418. }
  49419. }
  49420. }
  49421. }(),
  49422. n.Line.prototype.clone = function() {
  49423. return new this.constructor(this.geometry,this.material).copy(this)
  49424. }
  49425. ,
  49426. n.LineStrip = 0,
  49427. n.LinePieces = 1,
  49428. n.LineSegments = function(e, t) {
  49429. n.Line.call(this, e, t),
  49430. this.type = "LineSegments"
  49431. }
  49432. ,
  49433. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49434. n.LineSegments.prototype.constructor = n.LineSegments,
  49435. n.Mesh = function(e, t) {
  49436. n.Object3D.call(this),
  49437. this.type = "Mesh",
  49438. this.geometry = void 0 !== e ? e : new n.Geometry,
  49439. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49440. color: 16777215 * Math.random()
  49441. }),
  49442. this.drawMode = n.TrianglesDrawMode,
  49443. this.updateMorphTargets()
  49444. }
  49445. ,
  49446. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  49447. n.Mesh.prototype.constructor = n.Mesh,
  49448. n.Mesh.prototype.setDrawMode = function(e) {
  49449. this.drawMode = e
  49450. }
  49451. ,
  49452. n.Mesh.prototype.updateMorphTargets = function() {
  49453. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  49454. this.morphTargetBase = -1,
  49455. this.morphTargetInfluences = [],
  49456. this.morphTargetDictionary = {};
  49457. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  49458. this.morphTargetInfluences.push(0),
  49459. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  49460. }
  49461. }
  49462. ,
  49463. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  49464. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  49465. 0)
  49466. }
  49467. ,
  49468. n.Mesh.prototype.raycast = function() {
  49469. function e(e, t, i, r, o, a, s) {
  49470. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  49471. o.multiplyScalar(m.x),
  49472. a.multiplyScalar(m.y),
  49473. s.multiplyScalar(m.z),
  49474. o.add(a).add(s),
  49475. o.clone()
  49476. }
  49477. function t(e, t, i, r, o, a, s) {
  49478. var l, c = e.material;
  49479. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  49480. null === l)
  49481. return null;
  49482. A.copy(s),
  49483. A.applyMatrix4(e.matrixWorld);
  49484. var h = t.ray.origin.distanceTo(A);
  49485. return h < t.near || h > t.far ? null : {
  49486. distance: h,
  49487. point: A.clone(),
  49488. object: e
  49489. }
  49490. }
  49491. function i(i, r, o, a, h, u, d, m) {
  49492. s.fromArray(a, 3 * u),
  49493. l.fromArray(a, 3 * d),
  49494. c.fromArray(a, 3 * m);
  49495. var A = t(i, r, o, s, l, c, v);
  49496. return A && (h && (p.fromArray(h, 2 * u),
  49497. f.fromArray(h, 2 * d),
  49498. g.fromArray(h, 2 * m),
  49499. A.uv = e(v, s, l, c, p, f, g)),
  49500. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  49501. A.faceIndex = u),
  49502. A
  49503. }
  49504. var r = new n.Matrix4
  49505. , o = new n.Ray
  49506. , a = new n.Sphere
  49507. , s = new n.Vector3
  49508. , l = new n.Vector3
  49509. , c = new n.Vector3
  49510. , h = new n.Vector3
  49511. , u = new n.Vector3
  49512. , d = new n.Vector3
  49513. , p = new n.Vector2
  49514. , f = new n.Vector2
  49515. , g = new n.Vector2
  49516. , m = new n.Vector3
  49517. , v = new n.Vector3
  49518. , A = new n.Vector3;
  49519. return function(m, A) {
  49520. var y = this.geometry
  49521. , C = this.material
  49522. , I = this.matrixWorld;
  49523. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  49524. a.copy(y.boundingSphere),
  49525. a.applyMatrix4(I),
  49526. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  49527. o.copy(m.ray).applyMatrix4(r),
  49528. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  49529. var E, b;
  49530. if (y instanceof n.BufferGeometry) {
  49531. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  49532. if (void 0 !== S.uv && (E = S.uv.array),
  49533. null !== x)
  49534. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  49535. w = R[P],
  49536. _ = R[P + 1],
  49537. T = R[P + 2],
  49538. b = i(this, m, o, M, E, w, _, T),
  49539. b && (b.faceIndex = Math.floor(P / 3),
  49540. A.push(b));
  49541. else
  49542. for (var P = 0, O = M.length; P < O; P += 9)
  49543. w = P / 3,
  49544. _ = w + 1,
  49545. T = w + 2,
  49546. b = i(this, m, o, M, E, w, _, T),
  49547. b && (b.index = w,
  49548. A.push(b))
  49549. } else if (y instanceof n.Geometry) {
  49550. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  49551. k.length > 0 && (E = k);
  49552. for (var H = 0, G = U.length; H < G; H++) {
  49553. var z = U[H]
  49554. , W = B === !0 ? F[z.materialIndex] : C;
  49555. if (void 0 !== W) {
  49556. if (L = V[z.a],
  49557. D = V[z.b],
  49558. N = V[z.c],
  49559. W.morphTargets === !0) {
  49560. var j = y.morphTargets
  49561. , Y = this.morphTargetInfluences;
  49562. s.set(0, 0, 0),
  49563. l.set(0, 0, 0),
  49564. c.set(0, 0, 0);
  49565. for (var X = 0, Z = j.length; X < Z; X++) {
  49566. var q = Y[X];
  49567. if (0 !== q) {
  49568. var K = j[X].vertices;
  49569. s.addScaledVector(h.subVectors(K[z.a], L), q),
  49570. l.addScaledVector(u.subVectors(K[z.b], D), q),
  49571. c.addScaledVector(d.subVectors(K[z.c], N), q)
  49572. }
  49573. }
  49574. s.add(L),
  49575. l.add(D),
  49576. c.add(N),
  49577. L = s,
  49578. D = l,
  49579. N = c
  49580. }
  49581. if (b = t(this, m, o, L, D, N, v)) {
  49582. if (E) {
  49583. var Q = E[H];
  49584. p.copy(Q[0]),
  49585. f.copy(Q[1]),
  49586. g.copy(Q[2]),
  49587. b.uv = e(v, L, D, N, p, f, g)
  49588. }
  49589. b.face = z,
  49590. b.faceIndex = H,
  49591. A.push(b)
  49592. }
  49593. }
  49594. }
  49595. }
  49596. }
  49597. }
  49598. }(),
  49599. n.Mesh.prototype.clone = function() {
  49600. return new this.constructor(this.geometry,this.material).copy(this)
  49601. }
  49602. ,
  49603. n.Bone = function(e) {
  49604. n.Object3D.call(this),
  49605. this.type = "Bone",
  49606. this.skin = e
  49607. }
  49608. ,
  49609. n.Bone.prototype = Object.create(n.Object3D.prototype),
  49610. n.Bone.prototype.constructor = n.Bone,
  49611. n.Bone.prototype.copy = function(e) {
  49612. return n.Object3D.prototype.copy.call(this, e),
  49613. this.skin = e.skin,
  49614. this
  49615. }
  49616. ,
  49617. n.Skeleton = function(e, t, i) {
  49618. if (this.useVertexTexture = void 0 === i || i,
  49619. this.identityMatrix = new n.Matrix4,
  49620. e = e || [],
  49621. this.bones = e.slice(0),
  49622. this.useVertexTexture) {
  49623. var r = Math.sqrt(4 * this.bones.length);
  49624. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  49625. r = Math.max(r, 4),
  49626. this.boneTextureWidth = r,
  49627. this.boneTextureHeight = r,
  49628. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  49629. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  49630. } else
  49631. this.boneMatrices = new Float32Array(16 * this.bones.length);
  49632. if (void 0 === t)
  49633. this.calculateInverses();
  49634. else if (this.bones.length === t.length)
  49635. this.boneInverses = t.slice(0);
  49636. else {
  49637. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  49638. this.boneInverses = [];
  49639. for (var o = 0, a = this.bones.length; o < a; o++)
  49640. this.boneInverses.push(new n.Matrix4)
  49641. }
  49642. }
  49643. ,
  49644. n.Skeleton.prototype.calculateInverses = function() {
  49645. this.boneInverses = [];
  49646. for (var e = 0, t = this.bones.length; e < t; e++) {
  49647. var i = new n.Matrix4;
  49648. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  49649. this.boneInverses.push(i)
  49650. }
  49651. }
  49652. ,
  49653. n.Skeleton.prototype.pose = function() {
  49654. for (var e, t = 0, i = this.bones.length; t < i; t++)
  49655. e = this.bones[t],
  49656. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  49657. for (var t = 0, i = this.bones.length; t < i; t++)
  49658. e = this.bones[t],
  49659. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  49660. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  49661. e.matrix.decompose(e.position, e.quaternion, e.scale));
  49662. }
  49663. ,
  49664. n.Skeleton.prototype.update = function() {
  49665. var e = new n.Matrix4;
  49666. return function() {
  49667. for (var t = 0, i = this.bones.length; t < i; t++) {
  49668. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  49669. e.multiplyMatrices(n, this.boneInverses[t]),
  49670. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  49671. }
  49672. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  49673. }
  49674. }(),
  49675. n.Skeleton.prototype.clone = function() {
  49676. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  49677. }
  49678. ,
  49679. n.SkinnedMesh = function(e, t, i) {
  49680. n.Mesh.call(this, e, t),
  49681. this.type = "SkinnedMesh",
  49682. this.bindMode = "attached",
  49683. this.bindMatrix = new n.Matrix4,
  49684. this.bindMatrixInverse = new n.Matrix4;
  49685. var r = [];
  49686. if (this.geometry && void 0 !== this.geometry.bones) {
  49687. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  49688. a = this.geometry.bones[s],
  49689. o = new n.Bone(this),
  49690. r.push(o),
  49691. o.name = a.name,
  49692. o.position.fromArray(a.pos),
  49693. o.quaternion.fromArray(a.rotq),
  49694. void 0 !== a.scl && o.scale.fromArray(a.scl);
  49695. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  49696. a = this.geometry.bones[s],
  49697. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  49698. }
  49699. this.normalizeSkinWeights(),
  49700. this.updateMatrixWorld(!0),
  49701. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  49702. }
  49703. ,
  49704. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  49705. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  49706. n.SkinnedMesh.prototype.bind = function(e, t) {
  49707. this.skeleton = e,
  49708. void 0 === t && (this.updateMatrixWorld(!0),
  49709. this.skeleton.calculateInverses(),
  49710. t = this.matrixWorld),
  49711. this.bindMatrix.copy(t),
  49712. this.bindMatrixInverse.getInverse(t)
  49713. }
  49714. ,
  49715. n.SkinnedMesh.prototype.pose = function() {
  49716. this.skeleton.pose()
  49717. }
  49718. ,
  49719. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  49720. if (this.geometry instanceof n.Geometry)
  49721. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  49722. var t = this.geometry.skinWeights[e]
  49723. , i = 1 / t.lengthManhattan();
  49724. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  49725. }
  49726. else if (this.geometry instanceof n.BufferGeometry)
  49727. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  49728. r.x = o.getX(e),
  49729. r.y = o.getY(e),
  49730. r.z = o.getZ(e),
  49731. r.w = o.getW(e);
  49732. var i = 1 / r.lengthManhattan();
  49733. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  49734. o.setXYZW(e, r.x, r.y, r.z, r.w)
  49735. }
  49736. }
  49737. ,
  49738. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  49739. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  49740. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  49741. }
  49742. ,
  49743. n.SkinnedMesh.prototype.clone = function() {
  49744. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  49745. }
  49746. ,
  49747. n.LOD = function() {
  49748. n.Object3D.call(this),
  49749. this.type = "LOD",
  49750. Object.defineProperties(this, {
  49751. levels: {
  49752. enumerable: !0,
  49753. value: []
  49754. },
  49755. objects: {
  49756. get: function() {
  49757. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  49758. this.levels
  49759. }
  49760. }
  49761. })
  49762. }
  49763. ,
  49764. n.LOD.prototype = Object.create(n.Object3D.prototype),
  49765. n.LOD.prototype.constructor = n.LOD,
  49766. n.LOD.prototype.addLevel = function(e, t) {
  49767. void 0 === t && (t = 0),
  49768. t = Math.abs(t);
  49769. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  49770. ;
  49771. i.splice(n, 0, {
  49772. distance: t,
  49773. object: e
  49774. }),
  49775. this.add(e)
  49776. }
  49777. ,
  49778. n.LOD.prototype.getObjectForDistance = function(e) {
  49779. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  49780. ;
  49781. return t[i - 1].object
  49782. }
  49783. ,
  49784. n.LOD.prototype.raycast = function() {
  49785. var e = new n.Vector3;
  49786. return function(t, i) {
  49787. e.setFromMatrixPosition(this.matrixWorld);
  49788. var n = t.ray.origin.distanceTo(e);
  49789. this.getObjectForDistance(n).raycast(t, i)
  49790. }
  49791. }(),
  49792. n.LOD.prototype.update = function() {
  49793. var e = new n.Vector3
  49794. , t = new n.Vector3;
  49795. return function(i) {
  49796. var n = this.levels;
  49797. if (n.length > 1) {
  49798. e.setFromMatrixPosition(i.matrixWorld),
  49799. t.setFromMatrixPosition(this.matrixWorld);
  49800. var r = e.distanceTo(t);
  49801. n[0].object.visible = !0;
  49802. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  49803. n[o - 1].object.visible = !1,
  49804. n[o].object.visible = !0;
  49805. for (; o < a; o++)
  49806. n[o].object.visible = !1
  49807. }
  49808. }
  49809. }(),
  49810. n.LOD.prototype.copy = function(e) {
  49811. n.Object3D.prototype.copy.call(this, e, !1);
  49812. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  49813. var o = t[i];
  49814. this.addLevel(o.object.clone(), o.distance)
  49815. }
  49816. return this
  49817. }
  49818. ,
  49819. n.LOD.prototype.toJSON = function(e) {
  49820. var t = n.Object3D.prototype.toJSON.call(this, e);
  49821. t.object.levels = [];
  49822. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  49823. var a = i[r];
  49824. t.object.levels.push({
  49825. object: a.object.uuid,
  49826. distance: a.distance
  49827. })
  49828. }
  49829. return t
  49830. }
  49831. ,
  49832. n.Sprite = function() {
  49833. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  49834. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  49835. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  49836. , r = new n.BufferGeometry;
  49837. return r.setIndex(new n.BufferAttribute(e,1)),
  49838. r.addAttribute("position", new n.BufferAttribute(t,3)),
  49839. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  49840. function(e) {
  49841. n.Object3D.call(this),
  49842. this.type = "Sprite",
  49843. this.geometry = r,
  49844. this.material = void 0 !== e ? e : new n.SpriteMaterial
  49845. }
  49846. }(),
  49847. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  49848. n.Sprite.prototype.constructor = n.Sprite,
  49849. n.Sprite.prototype.raycast = function() {
  49850. var e = new n.Vector3;
  49851. return function(t, i) {
  49852. e.setFromMatrixPosition(this.matrixWorld);
  49853. var n = t.ray.distanceSqToPoint(e)
  49854. , r = this.scale.x * this.scale.y;
  49855. n > r || i.push({
  49856. distance: Math.sqrt(n),
  49857. point: this.position,
  49858. face: null,
  49859. object: this
  49860. })
  49861. }
  49862. }(),
  49863. n.Sprite.prototype.clone = function() {
  49864. return new this.constructor(this.material).copy(this)
  49865. }
  49866. ,
  49867. n.Particle = n.Sprite,
  49868. n.LensFlare = function(e, t, i, r, o) {
  49869. n.Object3D.call(this),
  49870. this.lensFlares = [],
  49871. this.positionScreen = new n.Vector3,
  49872. this.customUpdateCallback = void 0,
  49873. void 0 !== e && this.add(e, t, i, r, o)
  49874. }
  49875. ,
  49876. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  49877. n.LensFlare.prototype.constructor = n.LensFlare,
  49878. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  49879. void 0 === t && (t = -1),
  49880. void 0 === i && (i = 0),
  49881. void 0 === a && (a = 1),
  49882. void 0 === o && (o = new n.Color(16777215)),
  49883. void 0 === r && (r = n.NormalBlending),
  49884. i = Math.min(i, Math.max(0, i)),
  49885. this.lensFlares.push({
  49886. texture: e,
  49887. size: t,
  49888. distance: i,
  49889. x: 0,
  49890. y: 0,
  49891. z: 0,
  49892. scale: 1,
  49893. rotation: 0,
  49894. opacity: a,
  49895. color: o,
  49896. blending: r
  49897. })
  49898. }
  49899. ,
  49900. n.LensFlare.prototype.updateLensFlares = function() {
  49901. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  49902. for (e = 0; e < i; e++)
  49903. t = this.lensFlares[e],
  49904. t.x = this.positionScreen.x + n * t.distance,
  49905. t.y = this.positionScreen.y + r * t.distance,
  49906. t.wantedRotation = t.x * Math.PI * .25,
  49907. t.rotation += .25 * (t.wantedRotation - t.rotation)
  49908. }
  49909. ,
  49910. n.LensFlare.prototype.copy = function(e) {
  49911. n.Object3D.prototype.copy.call(this, e),
  49912. this.positionScreen.copy(e.positionScreen),
  49913. this.customUpdateCallback = e.customUpdateCallback;
  49914. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  49915. this.lensFlares.push(e.lensFlares[t]);
  49916. return this
  49917. }
  49918. ,
  49919. n.Scene = function() {
  49920. n.Object3D.call(this),
  49921. this.type = "Scene",
  49922. this.fog = null,
  49923. this.overrideMaterial = null,
  49924. this.autoUpdate = !0
  49925. }
  49926. ,
  49927. n.Scene.prototype = Object.create(n.Object3D.prototype),
  49928. n.Scene.prototype.constructor = n.Scene,
  49929. n.Scene.prototype.copy = function(e, t) {
  49930. return n.Object3D.prototype.copy.call(this, e, t),
  49931. null !== e.fog && (this.fog = e.fog.clone()),
  49932. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  49933. this.autoUpdate = e.autoUpdate,
  49934. this.matrixAutoUpdate = e.matrixAutoUpdate,
  49935. this
  49936. }
  49937. ,
  49938. n.Fog = function(e, t, i) {
  49939. this.name = "",
  49940. this.color = new n.Color(e),
  49941. this.near = void 0 !== t ? t : 1,
  49942. this.far = void 0 !== i ? i : 1e3
  49943. }
  49944. ,
  49945. n.Fog.prototype.clone = function() {
  49946. return new n.Fog(this.color.getHex(),this.near,this.far)
  49947. }
  49948. ,
  49949. n.FogExp2 = function(e, t) {
  49950. this.name = "",
  49951. this.color = new n.Color(e),
  49952. this.density = void 0 !== t ? t : 25e-5
  49953. }
  49954. ,
  49955. n.FogExp2.prototype.clone = function() {
  49956. return new n.FogExp2(this.color.getHex(),this.density)
  49957. }
  49958. ,
  49959. n.ShaderChunk = {},
  49960. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  49961. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  49962. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  49963. n.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",
  49964. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  49965. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  49966. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  49967. n.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",
  49968. n.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",
  49969. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  49970. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  49971. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  49972. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  49973. n.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",
  49974. n.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",
  49975. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  49976. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  49977. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  49978. n.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",
  49979. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  49980. n.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",
  49981. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  49982. n.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",
  49983. n.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",
  49984. n.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",
  49985. n.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",
  49986. n.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",
  49987. n.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",
  49988. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  49989. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  49990. n.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",
  49991. n.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",
  49992. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  49993. n.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",
  49994. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  49995. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  49996. n.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",
  49997. n.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",
  49998. n.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",
  49999. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50000. n.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",
  50001. n.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",
  50002. n.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",
  50003. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50004. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50005. n.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",
  50006. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50007. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50008. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50009. n.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",
  50010. n.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";
  50011. n.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";
  50012. n.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",
  50013. n.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",
  50014. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50015. n.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",
  50016. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50017. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50018. n.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",
  50019. n.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",
  50020. n.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",
  50021. n.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",
  50022. n.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",
  50023. n.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",
  50024. n.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",
  50025. n.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",
  50026. n.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",
  50027. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50028. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50029. n.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",
  50030. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50031. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50032. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50033. n.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",
  50034. n.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",
  50035. n.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",
  50036. n.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",
  50037. n.UniformsUtils = {
  50038. merge: function(e) {
  50039. for (var t = {}, i = 0; i < e.length; i++) {
  50040. var n = this.clone(e[i]);
  50041. for (var r in n)
  50042. t[r] = n[r]
  50043. }
  50044. return t
  50045. },
  50046. clone: function(e) {
  50047. var t = {};
  50048. for (var i in e) {
  50049. t[i] = {};
  50050. for (var r in e[i]) {
  50051. var o = e[i][r];
  50052. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  50053. }
  50054. }
  50055. return t
  50056. }
  50057. },
  50058. n.UniformsLib = {
  50059. common: {
  50060. diffuse: {
  50061. type: "c",
  50062. value: new n.Color(15658734)
  50063. },
  50064. opacity: {
  50065. type: "f",
  50066. value: 1
  50067. },
  50068. map: {
  50069. type: "t",
  50070. value: null
  50071. },
  50072. offsetRepeat: {
  50073. type: "v4",
  50074. value: new n.Vector4(0,0,1,1)
  50075. },
  50076. specularMap: {
  50077. type: "t",
  50078. value: null
  50079. },
  50080. alphaMap: {
  50081. type: "t",
  50082. value: null
  50083. },
  50084. envMap: {
  50085. type: "t",
  50086. value: null
  50087. },
  50088. flipEnvMap: {
  50089. type: "f",
  50090. value: -1
  50091. },
  50092. reflectivity: {
  50093. type: "f",
  50094. value: 1
  50095. },
  50096. refractionRatio: {
  50097. type: "f",
  50098. value: .98
  50099. }
  50100. },
  50101. aomap: {
  50102. aoMap: {
  50103. type: "t",
  50104. value: null
  50105. },
  50106. aoMapIntensity: {
  50107. type: "f",
  50108. value: 1
  50109. }
  50110. },
  50111. lightmap: {
  50112. lightMap: {
  50113. type: "t",
  50114. value: null
  50115. },
  50116. lightMapIntensity: {
  50117. type: "f",
  50118. value: 1
  50119. }
  50120. },
  50121. emissivemap: {
  50122. emissiveMap: {
  50123. type: "t",
  50124. value: null
  50125. }
  50126. },
  50127. bumpmap: {
  50128. bumpMap: {
  50129. type: "t",
  50130. value: null
  50131. },
  50132. bumpScale: {
  50133. type: "f",
  50134. value: 1
  50135. }
  50136. },
  50137. normalmap: {
  50138. normalMap: {
  50139. type: "t",
  50140. value: null
  50141. },
  50142. normalScale: {
  50143. type: "v2",
  50144. value: new n.Vector2(1,1)
  50145. }
  50146. },
  50147. displacementmap: {
  50148. displacementMap: {
  50149. type: "t",
  50150. value: null
  50151. },
  50152. displacementScale: {
  50153. type: "f",
  50154. value: 1
  50155. },
  50156. displacementBias: {
  50157. type: "f",
  50158. value: 0
  50159. }
  50160. },
  50161. roughnessmap: {
  50162. roughnessMap: {
  50163. type: "t",
  50164. value: null
  50165. }
  50166. },
  50167. metalnessmap: {
  50168. metalnessMap: {
  50169. type: "t",
  50170. value: null
  50171. }
  50172. },
  50173. fog: {
  50174. fogDensity: {
  50175. type: "f",
  50176. value: 25e-5
  50177. },
  50178. fogNear: {
  50179. type: "f",
  50180. value: 1
  50181. },
  50182. fogFar: {
  50183. type: "f",
  50184. value: 2e3
  50185. },
  50186. fogColor: {
  50187. type: "c",
  50188. value: new n.Color(16777215)
  50189. }
  50190. },
  50191. lights: {
  50192. ambientLightColor: {
  50193. type: "fv",
  50194. value: []
  50195. },
  50196. directionalLights: {
  50197. type: "sa",
  50198. value: [],
  50199. properties: {
  50200. direction: {
  50201. type: "v3"
  50202. },
  50203. color: {
  50204. type: "c"
  50205. },
  50206. shadow: {
  50207. type: "i"
  50208. },
  50209. shadowBias: {
  50210. type: "f"
  50211. },
  50212. shadowRadius: {
  50213. type: "f"
  50214. },
  50215. shadowMapSize: {
  50216. type: "v2"
  50217. }
  50218. }
  50219. },
  50220. directionalShadowMap: {
  50221. type: "tv",
  50222. value: []
  50223. },
  50224. directionalShadowMatrix: {
  50225. type: "m4v",
  50226. value: []
  50227. },
  50228. spotLights: {
  50229. type: "sa",
  50230. value: [],
  50231. properties: {
  50232. color: {
  50233. type: "c"
  50234. },
  50235. position: {
  50236. type: "v3"
  50237. },
  50238. direction: {
  50239. type: "v3"
  50240. },
  50241. distance: {
  50242. type: "f"
  50243. },
  50244. coneCos: {
  50245. type: "f"
  50246. },
  50247. penumbraCos: {
  50248. type: "f"
  50249. },
  50250. decay: {
  50251. type: "f"
  50252. },
  50253. shadow: {
  50254. type: "i"
  50255. },
  50256. shadowBias: {
  50257. type: "f"
  50258. },
  50259. shadowRadius: {
  50260. type: "f"
  50261. },
  50262. shadowMapSize: {
  50263. type: "v2"
  50264. }
  50265. }
  50266. },
  50267. spotShadowMap: {
  50268. type: "tv",
  50269. value: []
  50270. },
  50271. spotShadowMatrix: {
  50272. type: "m4v",
  50273. value: []
  50274. },
  50275. pointLights: {
  50276. type: "sa",
  50277. value: [],
  50278. properties: {
  50279. color: {
  50280. type: "c"
  50281. },
  50282. position: {
  50283. type: "v3"
  50284. },
  50285. decay: {
  50286. type: "f"
  50287. },
  50288. distance: {
  50289. type: "f"
  50290. },
  50291. shadow: {
  50292. type: "i"
  50293. },
  50294. shadowBias: {
  50295. type: "f"
  50296. },
  50297. shadowRadius: {
  50298. type: "f"
  50299. },
  50300. shadowMapSize: {
  50301. type: "v2"
  50302. }
  50303. }
  50304. },
  50305. pointShadowMap: {
  50306. type: "tv",
  50307. value: []
  50308. },
  50309. pointShadowMatrix: {
  50310. type: "m4v",
  50311. value: []
  50312. },
  50313. hemisphereLights: {
  50314. type: "sa",
  50315. value: [],
  50316. properties: {
  50317. direction: {
  50318. type: "v3"
  50319. },
  50320. skyColor: {
  50321. type: "c"
  50322. },
  50323. groundColor: {
  50324. type: "c"
  50325. }
  50326. }
  50327. }
  50328. },
  50329. points: {
  50330. diffuse: {
  50331. type: "c",
  50332. value: new n.Color(15658734)
  50333. },
  50334. opacity: {
  50335. type: "f",
  50336. value: 1
  50337. },
  50338. size: {
  50339. type: "f",
  50340. value: 1
  50341. },
  50342. scale: {
  50343. type: "f",
  50344. value: 1
  50345. },
  50346. map: {
  50347. type: "t",
  50348. value: null
  50349. },
  50350. offsetRepeat: {
  50351. type: "v4",
  50352. value: new n.Vector4(0,0,1,1)
  50353. }
  50354. }
  50355. },
  50356. n.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",
  50357. n.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",
  50358. n.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",
  50359. n.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",
  50360. n.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",
  50361. n.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",
  50362. n.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",
  50363. n.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",
  50364. n.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",
  50365. n.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",
  50366. n.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",
  50367. n.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",
  50368. n.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",
  50369. n.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",
  50370. n.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",
  50371. n.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",
  50372. n.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",
  50373. n.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",
  50374. n.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",
  50375. n.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",
  50376. n.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",
  50377. n.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",
  50378. n.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",
  50379. n.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",
  50380. n.ShaderLib = {
  50381. basic: {
  50382. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50383. vertexShader: n.ShaderChunk.meshbasic_vert,
  50384. fragmentShader: n.ShaderChunk.meshbasic_frag
  50385. },
  50386. lambert: {
  50387. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50388. emissive: {
  50389. type: "c",
  50390. value: new n.Color(0)
  50391. }
  50392. }]),
  50393. vertexShader: n.ShaderChunk.meshlambert_vert,
  50394. fragmentShader: n.ShaderChunk.meshlambert_frag
  50395. },
  50396. phong: {
  50397. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50398. emissive: {
  50399. type: "c",
  50400. value: new n.Color(0)
  50401. },
  50402. specular: {
  50403. type: "c",
  50404. value: new n.Color(1118481)
  50405. },
  50406. shininess: {
  50407. type: "f",
  50408. value: 30
  50409. }
  50410. }]),
  50411. vertexShader: n.ShaderChunk.meshphong_vert,
  50412. fragmentShader: n.ShaderChunk.meshphong_frag
  50413. },
  50414. standard: {
  50415. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50416. emissive: {
  50417. type: "c",
  50418. value: new n.Color(0)
  50419. },
  50420. roughness: {
  50421. type: "f",
  50422. value: .5
  50423. },
  50424. metalness: {
  50425. type: "f",
  50426. value: 0
  50427. },
  50428. envMapIntensity: {
  50429. type: "f",
  50430. value: 1
  50431. }
  50432. }]),
  50433. vertexShader: n.ShaderChunk.meshstandard_vert,
  50434. fragmentShader: n.ShaderChunk.meshstandard_frag
  50435. },
  50436. points: {
  50437. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50438. vertexShader: n.ShaderChunk.points_vert,
  50439. fragmentShader: n.ShaderChunk.points_frag
  50440. },
  50441. dashed: {
  50442. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50443. scale: {
  50444. type: "f",
  50445. value: 1
  50446. },
  50447. dashSize: {
  50448. type: "f",
  50449. value: 1
  50450. },
  50451. totalSize: {
  50452. type: "f",
  50453. value: 2
  50454. }
  50455. }]),
  50456. vertexShader: n.ShaderChunk.linedashed_vert,
  50457. fragmentShader: n.ShaderChunk.linedashed_frag
  50458. },
  50459. depth: {
  50460. uniforms: {
  50461. mNear: {
  50462. type: "f",
  50463. value: 1
  50464. },
  50465. mFar: {
  50466. type: "f",
  50467. value: 2e3
  50468. },
  50469. opacity: {
  50470. type: "f",
  50471. value: 1
  50472. }
  50473. },
  50474. vertexShader: n.ShaderChunk.depth_vert,
  50475. fragmentShader: n.ShaderChunk.depth_frag
  50476. },
  50477. normal: {
  50478. uniforms: {
  50479. opacity: {
  50480. type: "f",
  50481. value: 1
  50482. }
  50483. },
  50484. vertexShader: n.ShaderChunk.normal_vert,
  50485. fragmentShader: n.ShaderChunk.normal_frag
  50486. },
  50487. cube: {
  50488. uniforms: {
  50489. tCube: {
  50490. type: "t",
  50491. value: null
  50492. },
  50493. tFlip: {
  50494. type: "f",
  50495. value: -1
  50496. }
  50497. },
  50498. vertexShader: n.ShaderChunk.cube_vert,
  50499. fragmentShader: n.ShaderChunk.cube_frag
  50500. },
  50501. equirect: {
  50502. uniforms: {
  50503. tEquirect: {
  50504. type: "t",
  50505. value: null
  50506. },
  50507. tFlip: {
  50508. type: "f",
  50509. value: -1
  50510. }
  50511. },
  50512. vertexShader: n.ShaderChunk.equirect_vert,
  50513. fragmentShader: n.ShaderChunk.equirect_frag
  50514. },
  50515. depthRGBA: {
  50516. uniforms: {},
  50517. vertexShader: n.ShaderChunk.depthRGBA_vert,
  50518. fragmentShader: n.ShaderChunk.depthRGBA_frag
  50519. },
  50520. distanceRGBA: {
  50521. uniforms: {
  50522. lightPos: {
  50523. type: "v3",
  50524. value: new n.Vector3(0,0,0)
  50525. }
  50526. },
  50527. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  50528. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  50529. }
  50530. },
  50531. n.WebGLRenderer = function(e) {
  50532. function t() {
  50533. return null === ye ? Oe : 1
  50534. }
  50535. function i(e, t, i, n) {
  50536. se === !0 && (e *= n,
  50537. t *= n,
  50538. i *= n),
  50539. Ye.clearColor(e, t, i, n)
  50540. }
  50541. function r() {
  50542. Ye.init(),
  50543. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  50544. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  50545. i(Se.r, Se.g, Se.b, Me)
  50546. }
  50547. function o() {
  50548. Ae = null,
  50549. be = null,
  50550. Ee = "",
  50551. Ie = -1,
  50552. Ye.reset()
  50553. }
  50554. function a(e) {
  50555. e.preventDefault(),
  50556. o(),
  50557. r(),
  50558. Xe.clear()
  50559. }
  50560. function s(e) {
  50561. var t = e.target;
  50562. t.removeEventListener("dispose", s),
  50563. h(t),
  50564. ke.textures--
  50565. }
  50566. function l(e) {
  50567. var t = e.target;
  50568. t.removeEventListener("dispose", l),
  50569. u(t),
  50570. ke.textures--
  50571. }
  50572. function c(e) {
  50573. var t = e.target;
  50574. t.removeEventListener("dispose", c),
  50575. d(t)
  50576. }
  50577. function h(e) {
  50578. var t = Xe.get(e);
  50579. if (e.image && t.__image__webglTextureCube)
  50580. Ge.deleteTexture(t.__image__webglTextureCube);
  50581. else {
  50582. if (void 0 === t.__webglInit)
  50583. return;
  50584. Ge.deleteTexture(t.__webglTexture)
  50585. }
  50586. Xe.delete(e)
  50587. }
  50588. function u(e) {
  50589. var t = Xe.get(e)
  50590. , i = Xe.get(e.texture);
  50591. if (e && void 0 !== i.__webglTexture) {
  50592. if (Ge.deleteTexture(i.__webglTexture),
  50593. e instanceof n.WebGLRenderTargetCube)
  50594. for (var r = 0; r < 6; r++)
  50595. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  50596. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  50597. else
  50598. Ge.deleteFramebuffer(t.__webglFramebuffer),
  50599. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  50600. Xe.delete(e.texture),
  50601. Xe.delete(e)
  50602. }
  50603. }
  50604. function d(e) {
  50605. p(e),
  50606. Xe.delete(e)
  50607. }
  50608. function p(e) {
  50609. var t = Xe.get(e).program;
  50610. e.program = void 0,
  50611. void 0 !== t && qe.releaseProgram(t)
  50612. }
  50613. function f(e, t, i, r) {
  50614. var o;
  50615. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  50616. null === o))
  50617. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50618. void 0 === r && (r = 0),
  50619. Ye.initAttributes();
  50620. var a = i.attributes
  50621. , s = t.getAttributes()
  50622. , l = e.defaultAttributeValues;
  50623. for (var c in s) {
  50624. var h = s[c];
  50625. if (h >= 0) {
  50626. var u = a[c];
  50627. if (void 0 !== u) {
  50628. var d = u.itemSize
  50629. , p = Ze.getAttributeBuffer(u);
  50630. if (u instanceof n.InterleavedBufferAttribute) {
  50631. var f = u.data
  50632. , g = f.stride
  50633. , m = u.offset;
  50634. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  50635. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  50636. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50637. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  50638. } else
  50639. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  50640. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  50641. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50642. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  50643. } else if (void 0 !== l) {
  50644. var v = l[c];
  50645. if (void 0 !== v)
  50646. switch (v.length) {
  50647. case 2:
  50648. Ge.vertexAttrib2fv(h, v);
  50649. break;
  50650. case 3:
  50651. Ge.vertexAttrib3fv(h, v);
  50652. break;
  50653. case 4:
  50654. Ge.vertexAttrib4fv(h, v);
  50655. break;
  50656. default:
  50657. Ge.vertexAttrib1fv(h, v)
  50658. }
  50659. }
  50660. }
  50661. }
  50662. Ye.disableUnusedAttributes()
  50663. }
  50664. function g(e, t) {
  50665. return Math.abs(t[0]) - Math.abs(e[0])
  50666. }
  50667. function m(e, t) {
  50668. 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
  50669. }
  50670. function v(e, t) {
  50671. 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
  50672. }
  50673. function A(e, t, i, n, r) {
  50674. var o, a;
  50675. i.transparent ? (o = de,
  50676. a = ++pe) : (o = he,
  50677. a = ++ue);
  50678. var s = o[a];
  50679. void 0 !== s ? (s.id = e.id,
  50680. s.object = e,
  50681. s.geometry = t,
  50682. s.material = i,
  50683. s.z = Ve.z,
  50684. s.group = r) : (s = {
  50685. id: e.id,
  50686. object: e,
  50687. geometry: t,
  50688. material: i,
  50689. z: Ve.z,
  50690. group: r
  50691. },
  50692. o.push(s))
  50693. }
  50694. function y(e, t) {
  50695. if (e.visible !== !1) {
  50696. if (e.layers.test(t.layers))
  50697. if (e instanceof n.Light)
  50698. ce.push(e);
  50699. else if (e instanceof n.Sprite)
  50700. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  50701. else if (e instanceof n.LensFlare)
  50702. me.push(e);
  50703. else if (e instanceof n.ImmediateRenderObject)
  50704. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50705. Ve.applyProjection(Fe)),
  50706. A(e, null, e.material, Ve.z, null);
  50707. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  50708. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  50709. var i = e.material;
  50710. if (i.visible === !0) {
  50711. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50712. Ve.applyProjection(Fe));
  50713. var r = Ze.update(e);
  50714. if (i instanceof n.MultiMaterial)
  50715. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  50716. var c = o[s]
  50717. , h = a[c.materialIndex];
  50718. h.visible === !0 && A(e, r, h, Ve.z, c)
  50719. }
  50720. else
  50721. A(e, r, i, Ve.z, null)
  50722. }
  50723. }
  50724. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  50725. y(u[s], t)
  50726. }
  50727. }
  50728. function C(e, t, i, r) {
  50729. for (var o = 0, a = e.length; o < a; o++) {
  50730. var s = e[o]
  50731. , l = s.object
  50732. , c = s.geometry
  50733. , h = void 0 === r ? s.material : r
  50734. , u = s.group;
  50735. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50736. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  50737. l instanceof n.ImmediateRenderObject) {
  50738. E(h);
  50739. var d = w(t, i, h, l);
  50740. Ee = "",
  50741. l.render(function(e) {
  50742. ve.renderBufferImmediate(e, d, h)
  50743. })
  50744. } else
  50745. ve.renderBufferDirect(t, i, c, h, l, u)
  50746. }
  50747. }
  50748. function I(e, t, i) {
  50749. var r = Xe.get(e)
  50750. , o = qe.getParameters(e, Ue, t, i)
  50751. , a = qe.getProgramCode(e, o)
  50752. , s = r.program
  50753. , l = !0;
  50754. if (void 0 === s)
  50755. e.addEventListener("dispose", c);
  50756. else if (s.code !== a)
  50757. p(e);
  50758. else {
  50759. if (void 0 !== o.shaderID)
  50760. return;
  50761. l = !1
  50762. }
  50763. if (l) {
  50764. if (o.shaderID) {
  50765. var h = n.ShaderLib[o.shaderID];
  50766. r.__webglShader = {
  50767. name: e.type,
  50768. uniforms: n.UniformsUtils.clone(h.uniforms),
  50769. vertexShader: h.vertexShader,
  50770. fragmentShader: h.fragmentShader
  50771. }
  50772. } else
  50773. r.__webglShader = {
  50774. name: e.type,
  50775. uniforms: e.uniforms,
  50776. vertexShader: e.vertexShader,
  50777. fragmentShader: e.fragmentShader
  50778. };
  50779. e.__webglShader = r.__webglShader,
  50780. s = qe.acquireProgram(e, o, a),
  50781. r.program = s,
  50782. e.program = s
  50783. }
  50784. var u = s.getAttributes();
  50785. if (e.morphTargets) {
  50786. e.numSupportedMorphTargets = 0;
  50787. for (var d = 0; d < ve.maxMorphTargets; d++)
  50788. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  50789. }
  50790. if (e.morphNormals) {
  50791. e.numSupportedMorphNormals = 0;
  50792. for (var d = 0; d < ve.maxMorphNormals; d++)
  50793. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  50794. }
  50795. r.uniformsList = [];
  50796. var f = r.__webglShader.uniforms
  50797. , g = r.program.getUniforms();
  50798. for (var m in f) {
  50799. var v = g[m];
  50800. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  50801. }
  50802. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  50803. f.ambientLightColor.value = Ue.ambient,
  50804. f.directionalLights.value = Ue.directional,
  50805. f.spotLights.value = Ue.spot,
  50806. f.pointLights.value = Ue.point,
  50807. f.hemisphereLights.value = Ue.hemi,
  50808. f.directionalShadowMap.value = Ue.directionalShadowMap,
  50809. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  50810. f.spotShadowMap.value = Ue.spotShadowMap,
  50811. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  50812. f.pointShadowMap.value = Ue.pointShadowMap,
  50813. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  50814. r.hasDynamicUniforms = !1;
  50815. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  50816. var C = r.uniformsList[A][0];
  50817. if (C.dynamic === !0) {
  50818. r.hasDynamicUniforms = !0;
  50819. break
  50820. }
  50821. }
  50822. }
  50823. function E(e) {
  50824. b(e),
  50825. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  50826. Ye.setDepthFunc(e.depthFunc),
  50827. Ye.setDepthTest(e.depthTest),
  50828. Ye.setDepthWrite(e.depthWrite),
  50829. Ye.setColorWrite(e.colorWrite),
  50830. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  50831. }
  50832. function b(e) {
  50833. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  50834. Ye.setFlipSided(e.side === n.BackSide)
  50835. }
  50836. function w(e, t, i, r) {
  50837. xe = 0;
  50838. var o = Xe.get(i);
  50839. void 0 === o.program && (i.needsUpdate = !0),
  50840. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  50841. i.needsUpdate && (I(i, t, r),
  50842. i.needsUpdate = !1);
  50843. var a = !1
  50844. , s = !1
  50845. , l = !1
  50846. , c = o.program
  50847. , h = c.getUniforms()
  50848. , u = o.__webglShader.uniforms;
  50849. if (c.id !== Ae && (Ge.useProgram(c.program),
  50850. Ae = c.id,
  50851. a = !0,
  50852. s = !0,
  50853. l = !0),
  50854. i.id !== Ie && (Ie = i.id,
  50855. s = !0),
  50856. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  50857. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  50858. e !== be && (be = e,
  50859. s = !0,
  50860. l = !0),
  50861. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  50862. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  50863. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  50864. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  50865. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  50866. i.skinning)
  50867. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  50868. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  50869. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  50870. if (void 0 !== h.boneTexture) {
  50871. var d = B();
  50872. Ge.uniform1i(h.boneTexture, d),
  50873. ve.setTexture(r.skeleton.boneTexture, d)
  50874. }
  50875. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  50876. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  50877. } else
  50878. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  50879. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  50880. t && i.fog && R(u, t),
  50881. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  50882. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  50883. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  50884. u.mFar.value = e.far,
  50885. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  50886. V(o.uniformsList)),
  50887. N(h, r),
  50888. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  50889. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  50890. c
  50891. }
  50892. function _(e, t, i) {
  50893. for (var n = [], r = 0, o = e.length; r < o; r++) {
  50894. var a = e[r][0]
  50895. , s = a.onUpdateCallback;
  50896. void 0 !== s && (s.bind(a)(t, i),
  50897. n.push(e[r]))
  50898. }
  50899. V(n)
  50900. }
  50901. function T(e, t) {
  50902. e.opacity.value = t.opacity,
  50903. e.diffuse.value = t.color,
  50904. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  50905. e.map.value = t.map,
  50906. e.specularMap.value = t.specularMap,
  50907. e.alphaMap.value = t.alphaMap,
  50908. t.aoMap && (e.aoMap.value = t.aoMap,
  50909. e.aoMapIntensity.value = t.aoMapIntensity);
  50910. var i;
  50911. if (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),
  50912. void 0 !== i) {
  50913. i instanceof n.WebGLRenderTarget && (i = i.texture);
  50914. var r = i.offset
  50915. , o = i.repeat;
  50916. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  50917. }
  50918. e.envMap.value = t.envMap,
  50919. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  50920. e.reflectivity.value = t.reflectivity,
  50921. e.refractionRatio.value = t.refractionRatio
  50922. }
  50923. function x(e, t) {
  50924. e.diffuse.value = t.color,
  50925. e.opacity.value = t.opacity
  50926. }
  50927. function S(e, t) {
  50928. e.dashSize.value = t.dashSize,
  50929. e.totalSize.value = t.dashSize + t.gapSize,
  50930. e.scale.value = t.scale
  50931. }
  50932. function M(e, t) {
  50933. if (e.diffuse.value = t.color,
  50934. e.opacity.value = t.opacity,
  50935. e.size.value = t.size * Oe,
  50936. e.scale.value = te.clientHeight / 2,
  50937. e.map.value = t.map,
  50938. null !== t.map) {
  50939. var i = t.map.offset
  50940. , n = t.map.repeat;
  50941. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  50942. }
  50943. }
  50944. function R(e, t) {
  50945. e.fogColor.value = t.color,
  50946. t instanceof n.Fog ? (e.fogNear.value = t.near,
  50947. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  50948. }
  50949. function P(e, t) {
  50950. t.lightMap && (e.lightMap.value = t.lightMap,
  50951. e.lightMapIntensity.value = t.lightMapIntensity),
  50952. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  50953. }
  50954. function O(e, t) {
  50955. e.specular.value = t.specular,
  50956. e.shininess.value = Math.max(t.shininess, 1e-4),
  50957. t.lightMap && (e.lightMap.value = t.lightMap,
  50958. e.lightMapIntensity.value = t.lightMapIntensity),
  50959. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50960. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50961. e.bumpScale.value = t.bumpScale),
  50962. t.normalMap && (e.normalMap.value = t.normalMap,
  50963. e.normalScale.value.copy(t.normalScale)),
  50964. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50965. e.displacementScale.value = t.displacementScale,
  50966. e.displacementBias.value = t.displacementBias)
  50967. }
  50968. function L(e, t) {
  50969. e.roughness.value = t.roughness,
  50970. e.metalness.value = t.metalness,
  50971. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  50972. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  50973. t.lightMap && (e.lightMap.value = t.lightMap,
  50974. e.lightMapIntensity.value = t.lightMapIntensity),
  50975. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50976. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50977. e.bumpScale.value = t.bumpScale),
  50978. t.normalMap && (e.normalMap.value = t.normalMap,
  50979. e.normalScale.value.copy(t.normalScale)),
  50980. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50981. e.displacementScale.value = t.displacementScale,
  50982. e.displacementBias.value = t.displacementBias),
  50983. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  50984. }
  50985. function D(e, t) {
  50986. e.ambientLightColor.needsUpdate = t,
  50987. e.directionalLights.needsUpdate = t,
  50988. e.pointLights.needsUpdate = t,
  50989. e.spotLights.needsUpdate = t,
  50990. e.hemisphereLights.needsUpdate = t
  50991. }
  50992. function N(e, t) {
  50993. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  50994. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  50995. }
  50996. function B() {
  50997. var e = xe;
  50998. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  50999. xe += 1,
  51000. e
  51001. }
  51002. function F(e, t, i, r) {
  51003. var o, a;
  51004. if ("1i" === t)
  51005. Ge.uniform1i(i, r);
  51006. else if ("1f" === t)
  51007. Ge.uniform1f(i, r);
  51008. else if ("2f" === t)
  51009. Ge.uniform2f(i, r[0], r[1]);
  51010. else if ("3f" === t)
  51011. Ge.uniform3f(i, r[0], r[1], r[2]);
  51012. else if ("4f" === t)
  51013. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51014. else if ("1iv" === t)
  51015. Ge.uniform1iv(i, r);
  51016. else if ("3iv" === t)
  51017. Ge.uniform3iv(i, r);
  51018. else if ("1fv" === t)
  51019. Ge.uniform1fv(i, r);
  51020. else if ("2fv" === t)
  51021. Ge.uniform2fv(i, r);
  51022. else if ("3fv" === t)
  51023. Ge.uniform3fv(i, r);
  51024. else if ("4fv" === t)
  51025. Ge.uniform4fv(i, r);
  51026. else if ("Matrix2fv" === t)
  51027. Ge.uniformMatrix2fv(i, !1, r);
  51028. else if ("Matrix3fv" === t)
  51029. Ge.uniformMatrix3fv(i, !1, r);
  51030. else if ("Matrix4fv" === t)
  51031. Ge.uniformMatrix4fv(i, !1, r);
  51032. else if ("i" === t)
  51033. Ge.uniform1i(i, r);
  51034. else if ("f" === t)
  51035. Ge.uniform1f(i, r);
  51036. else if ("v2" === t)
  51037. Ge.uniform2f(i, r.x, r.y);
  51038. else if ("v3" === t)
  51039. Ge.uniform3f(i, r.x, r.y, r.z);
  51040. else if ("v4" === t)
  51041. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51042. else if ("c" === t)
  51043. Ge.uniform3f(i, r.r, r.g, r.b);
  51044. else if ("s" === t) {
  51045. var s = e.properties;
  51046. for (var l in s) {
  51047. var c = s[l]
  51048. , h = i[l]
  51049. , u = r[l];
  51050. F(c, c.type, h, u)
  51051. }
  51052. } else if ("sa" === t)
  51053. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51054. for (var l in s) {
  51055. var c = s[l]
  51056. , h = i[d][l]
  51057. , u = r[d][l];
  51058. F(c, c.type, h, u)
  51059. }
  51060. else if ("iv1" === t)
  51061. Ge.uniform1iv(i, r);
  51062. else if ("iv" === t)
  51063. Ge.uniform3iv(i, r);
  51064. else if ("fv1" === t)
  51065. Ge.uniform1fv(i, r);
  51066. else if ("fv" === t)
  51067. Ge.uniform3fv(i, r);
  51068. else if ("v2v" === t) {
  51069. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51070. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51071. f += 2)
  51072. e._array[f + 0] = r[d].x,
  51073. e._array[f + 1] = r[d].y;
  51074. Ge.uniform2fv(i, e._array)
  51075. } else if ("v3v" === t) {
  51076. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51077. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51078. m += 3)
  51079. e._array[m + 0] = r[d].x,
  51080. e._array[m + 1] = r[d].y,
  51081. e._array[m + 2] = r[d].z;
  51082. Ge.uniform3fv(i, e._array)
  51083. } else if ("v4v" === t) {
  51084. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51085. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51086. v += 4)
  51087. e._array[v + 0] = r[d].x,
  51088. e._array[v + 1] = r[d].y,
  51089. e._array[v + 2] = r[d].z,
  51090. e._array[v + 3] = r[d].w;
  51091. Ge.uniform4fv(i, e._array)
  51092. } else if ("m2" === t)
  51093. Ge.uniformMatrix2fv(i, !1, r.elements);
  51094. else if ("m3" === t)
  51095. Ge.uniformMatrix3fv(i, !1, r.elements);
  51096. else if ("m3v" === t) {
  51097. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51098. for (var d = 0, g = r.length; d < g; d++)
  51099. r[d].flattenToArrayOffset(e._array, 9 * d);
  51100. Ge.uniformMatrix3fv(i, !1, e._array)
  51101. } else if ("m4" === t)
  51102. Ge.uniformMatrix4fv(i, !1, r.elements);
  51103. else if ("m4v" === t) {
  51104. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51105. for (var d = 0, g = r.length; d < g; d++)
  51106. r[d].flattenToArrayOffset(e._array, 16 * d);
  51107. Ge.uniformMatrix4fv(i, !1, e._array)
  51108. } else if ("t" === t) {
  51109. if (o = r,
  51110. a = B(),
  51111. Ge.uniform1i(i, a),
  51112. !o)
  51113. return;
  51114. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  51115. } else if ("tv" === t) {
  51116. void 0 === e._array && (e._array = []);
  51117. for (var d = 0, g = e.value.length; d < g; d++)
  51118. e._array[d] = B();
  51119. Ge.uniform1iv(i, e._array);
  51120. for (var d = 0, g = e.value.length; d < g; d++)
  51121. o = e.value[d],
  51122. a = e._array[d],
  51123. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  51124. } else
  51125. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51126. }
  51127. function V(e) {
  51128. for (var t = 0, i = e.length; t < i; t++) {
  51129. var n = e[t][0];
  51130. if (n.needsUpdate !== !1) {
  51131. var r = n.type
  51132. , o = e[t][1]
  51133. , a = n.value;
  51134. F(n, r, o, a)
  51135. }
  51136. }
  51137. }
  51138. function U(e, t) {
  51139. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  51140. for (Ue.shadowsPointLight = 0,
  51141. i = 0,
  51142. r = e.length; i < r; i++)
  51143. if (o = e[i],
  51144. a = o.color,
  51145. s = o.intensity,
  51146. l = o.distance,
  51147. o instanceof n.AmbientLight)
  51148. c += a.r * s,
  51149. h += a.g * s,
  51150. u += a.b * s;
  51151. else if (o instanceof n.DirectionalLight) {
  51152. var A = Ke.get(o);
  51153. A.color.copy(o.color).multiplyScalar(o.intensity),
  51154. A.direction.setFromMatrixPosition(o.matrixWorld),
  51155. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51156. A.direction.sub(Ve),
  51157. A.direction.transformDirection(d),
  51158. A.shadow = o.castShadow,
  51159. o.castShadow && (A.shadowBias = o.shadow.bias,
  51160. A.shadowRadius = o.shadow.radius,
  51161. A.shadowMapSize = o.shadow.mapSize,
  51162. Ue.shadows[v++] = o),
  51163. Ue.directionalShadowMap[p] = o.shadow.map,
  51164. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51165. Ue.directional[p++] = A
  51166. } else if (o instanceof n.SpotLight) {
  51167. var A = Ke.get(o);
  51168. A.position.setFromMatrixPosition(o.matrixWorld),
  51169. A.position.applyMatrix4(d),
  51170. A.color.copy(a).multiplyScalar(s),
  51171. A.distance = l,
  51172. A.direction.setFromMatrixPosition(o.matrixWorld),
  51173. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51174. A.direction.sub(Ve),
  51175. A.direction.transformDirection(d),
  51176. A.coneCos = Math.cos(o.angle),
  51177. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51178. A.decay = 0 === o.distance ? 0 : o.decay,
  51179. A.shadow = o.castShadow,
  51180. o.castShadow && (A.shadowBias = o.shadow.bias,
  51181. A.shadowRadius = o.shadow.radius,
  51182. A.shadowMapSize = o.shadow.mapSize,
  51183. Ue.shadows[v++] = o),
  51184. Ue.spotShadowMap[g] = o.shadow.map,
  51185. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51186. Ue.spot[g++] = A
  51187. } else if (o instanceof n.PointLight) {
  51188. var A = Ke.get(o);
  51189. A.position.setFromMatrixPosition(o.matrixWorld),
  51190. A.position.applyMatrix4(d),
  51191. A.color.copy(o.color).multiplyScalar(o.intensity),
  51192. A.distance = o.distance,
  51193. A.decay = 0 === o.distance ? 0 : o.decay,
  51194. A.shadow = o.castShadow,
  51195. o.castShadow && (A.shadowBias = o.shadow.bias,
  51196. A.shadowRadius = o.shadow.radius,
  51197. A.shadowMapSize = o.shadow.mapSize,
  51198. Ue.shadows[v++] = o),
  51199. Ue.pointShadowMap[f] = o.shadow.map,
  51200. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51201. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51202. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51203. Ue.point[f++] = A
  51204. } else if (o instanceof n.HemisphereLight) {
  51205. var A = Ke.get(o);
  51206. A.direction.setFromMatrixPosition(o.matrixWorld),
  51207. A.direction.transformDirection(d),
  51208. A.direction.normalize(),
  51209. A.skyColor.copy(o.color).multiplyScalar(s),
  51210. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51211. Ue.hemi[m++] = A
  51212. }
  51213. Ue.ambient[0] = c,
  51214. Ue.ambient[1] = h,
  51215. Ue.ambient[2] = u,
  51216. Ue.directional.length = p,
  51217. Ue.spot.length = g,
  51218. Ue.point.length = f,
  51219. Ue.hemi.length = m,
  51220. Ue.shadows.length = v,
  51221. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51222. }
  51223. function k(e, t, i) {
  51224. var r;
  51225. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51226. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51227. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51228. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51229. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51230. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping,
  51231. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51232. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51233. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter),
  51234. r = We.get("EXT_texture_filter_anisotropic")) {
  51235. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51236. return;
  51237. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51238. return;
  51239. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51240. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51241. }
  51242. }
  51243. function H(e, t, i) {
  51244. void 0 === e.__webglInit && (e.__webglInit = !0,
  51245. t.addEventListener("dispose", s),
  51246. e.__webglTexture = Ge.createTexture(),
  51247. ke.textures++),
  51248. Ye.activeTexture(Ge.TEXTURE0 + i),
  51249. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51250. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51251. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51252. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51253. var r = G(t.image, je.maxTextureSize);
  51254. W(t) && z(r) === !1 && (r = j(r));
  51255. var o = z(r)
  51256. , a = ee(t.format)
  51257. , l = ee(t.type);
  51258. k(Ge.TEXTURE_2D, t, o);
  51259. var c, h = t.mipmaps;
  51260. if (t instanceof n.DataTexture)
  51261. if (h.length > 0 && o) {
  51262. for (var u = 0, d = h.length; u < d; u++)
  51263. c = h[u],
  51264. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51265. t.generateMipmaps = !1
  51266. } else
  51267. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51268. else if (t instanceof n.CompressedTexture)
  51269. for (var u = 0, d = h.length; u < d; u++)
  51270. c = h[u],
  51271. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51272. else if (h.length > 0 && o) {
  51273. for (var u = 0, d = h.length; u < d; u++)
  51274. c = h[u],
  51275. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51276. t.generateMipmaps = !1
  51277. } else
  51278. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51279. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51280. e.__version = t.version,
  51281. t.onUpdate && t.onUpdate(t)
  51282. }
  51283. function G(e, t) {
  51284. if (e.width > t || e.height > t) {
  51285. var i = t / Math.max(e.width, e.height)
  51286. , n = document.createElement("canvas");
  51287. n.width = Math.floor(e.width * i),
  51288. n.height = Math.floor(e.height * i);
  51289. var r = n.getContext("2d");
  51290. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51291. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51292. n
  51293. }
  51294. return e
  51295. }
  51296. function z(e) {
  51297. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51298. }
  51299. function W(e) {
  51300. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51301. }
  51302. function j(e) {
  51303. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51304. var t = document.createElement("canvas");
  51305. t.width = n.Math.nearestPowerOfTwo(e.width),
  51306. t.height = n.Math.nearestPowerOfTwo(e.height);
  51307. var i = t.getContext("2d");
  51308. return i.drawImage(e, 0, 0, t.width, t.height),
  51309. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51310. t
  51311. }
  51312. return e
  51313. }
  51314. function Y(e, t) {
  51315. var i = Xe.get(e);
  51316. if (6 === e.image.length)
  51317. if (e.version > 0 && i.__version !== e.version) {
  51318. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51319. i.__image__webglTextureCube = Ge.createTexture(),
  51320. ke.textures++),
  51321. Ye.activeTexture(Ge.TEXTURE0 + t),
  51322. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51323. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51324. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51325. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51326. var c = a[0]
  51327. , h = z(c)
  51328. , u = ee(e.format)
  51329. , d = ee(e.type);
  51330. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51331. for (var l = 0; l < 6; l++)
  51332. if (r)
  51333. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51334. p = f[g],
  51335. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  51336. else
  51337. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  51338. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51339. i.__version = e.version,
  51340. e.onUpdate && e.onUpdate(e)
  51341. } else
  51342. Ye.activeTexture(Ge.TEXTURE0 + t),
  51343. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51344. }
  51345. function X(e, t) {
  51346. Ye.activeTexture(Ge.TEXTURE0 + t),
  51347. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51348. }
  51349. function Z(e, t, i, n) {
  51350. var r = ee(t.texture.format)
  51351. , o = ee(t.texture.type);
  51352. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51353. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51354. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51355. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51356. }
  51357. function q(e, t) {
  51358. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51359. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51360. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  51361. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51362. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51363. }
  51364. function K(e) {
  51365. var t = Xe.get(e)
  51366. , i = e instanceof n.WebGLRenderTargetCube;
  51367. if (i) {
  51368. t.__webglDepthbuffer = [];
  51369. for (var r = 0; r < 6; r++)
  51370. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51371. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51372. q(t.__webglDepthbuffer[r], e)
  51373. } else
  51374. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51375. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51376. q(t.__webglDepthbuffer, e);
  51377. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51378. }
  51379. function Q(e) {
  51380. var t = Xe.get(e)
  51381. , i = Xe.get(e.texture);
  51382. e.addEventListener("dispose", l),
  51383. i.__webglTexture = Ge.createTexture(),
  51384. ke.textures++;
  51385. var r = e instanceof n.WebGLRenderTargetCube
  51386. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51387. if (r) {
  51388. t.__webglFramebuffer = [];
  51389. for (var a = 0; a < 6; a++)
  51390. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51391. } else
  51392. t.__webglFramebuffer = Ge.createFramebuffer();
  51393. if (r) {
  51394. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51395. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51396. for (var a = 0; a < 6; a++)
  51397. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51398. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51399. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51400. } else
  51401. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51402. k(Ge.TEXTURE_2D, e.texture, o),
  51403. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51404. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51405. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51406. e.depthBuffer && K(e)
  51407. }
  51408. function J(e) {
  51409. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51410. , i = Xe.get(e.texture).__webglTexture;
  51411. Ye.bindTexture(t, i),
  51412. Ge.generateMipmap(t),
  51413. Ye.bindTexture(t, null)
  51414. }
  51415. function $(e) {
  51416. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51417. }
  51418. function ee(e) {
  51419. var t;
  51420. if (e === n.RepeatWrapping)
  51421. return Ge.REPEAT;
  51422. if (e === n.ClampToEdgeWrapping)
  51423. return Ge.CLAMP_TO_EDGE;
  51424. if (e === n.MirroredRepeatWrapping)
  51425. return Ge.MIRRORED_REPEAT;
  51426. if (e === n.NearestFilter)
  51427. return Ge.NEAREST;
  51428. if (e === n.NearestMipMapNearestFilter)
  51429. return Ge.NEAREST_MIPMAP_NEAREST;
  51430. if (e === n.NearestMipMapLinearFilter)
  51431. return Ge.NEAREST_MIPMAP_LINEAR;
  51432. if (e === n.LinearFilter)
  51433. return Ge.LINEAR;
  51434. if (e === n.LinearMipMapNearestFilter)
  51435. return Ge.LINEAR_MIPMAP_NEAREST;
  51436. if (e === n.LinearMipMapLinearFilter)
  51437. return Ge.LINEAR_MIPMAP_LINEAR;
  51438. if (e === n.UnsignedByteType)
  51439. return Ge.UNSIGNED_BYTE;
  51440. if (e === n.UnsignedShort4444Type)
  51441. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51442. if (e === n.UnsignedShort5551Type)
  51443. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51444. if (e === n.UnsignedShort565Type)
  51445. return Ge.UNSIGNED_SHORT_5_6_5;
  51446. if (e === n.ByteType)
  51447. return Ge.BYTE;
  51448. if (e === n.ShortType)
  51449. return Ge.SHORT;
  51450. if (e === n.UnsignedShortType)
  51451. return Ge.UNSIGNED_SHORT;
  51452. if (e === n.IntType)
  51453. return Ge.INT;
  51454. if (e === n.UnsignedIntType)
  51455. return Ge.UNSIGNED_INT;
  51456. if (e === n.FloatType)
  51457. return Ge.FLOAT;
  51458. if (t = We.get("OES_texture_half_float"),
  51459. null !== t && e === n.HalfFloatType)
  51460. return t.HALF_FLOAT_OES;
  51461. if (e === n.AlphaFormat)
  51462. return Ge.ALPHA;
  51463. if (e === n.RGBFormat)
  51464. return Ge.RGB;
  51465. if (e === n.RGBAFormat)
  51466. return Ge.RGBA;
  51467. if (e === n.LuminanceFormat)
  51468. return Ge.LUMINANCE;
  51469. if (e === n.LuminanceAlphaFormat)
  51470. return Ge.LUMINANCE_ALPHA;
  51471. if (e === n.AddEquation)
  51472. return Ge.FUNC_ADD;
  51473. if (e === n.SubtractEquation)
  51474. return Ge.FUNC_SUBTRACT;
  51475. if (e === n.ReverseSubtractEquation)
  51476. return Ge.FUNC_REVERSE_SUBTRACT;
  51477. if (e === n.ZeroFactor)
  51478. return Ge.ZERO;
  51479. if (e === n.OneFactor)
  51480. return Ge.ONE;
  51481. if (e === n.SrcColorFactor)
  51482. return Ge.SRC_COLOR;
  51483. if (e === n.OneMinusSrcColorFactor)
  51484. return Ge.ONE_MINUS_SRC_COLOR;
  51485. if (e === n.SrcAlphaFactor)
  51486. return Ge.SRC_ALPHA;
  51487. if (e === n.OneMinusSrcAlphaFactor)
  51488. return Ge.ONE_MINUS_SRC_ALPHA;
  51489. if (e === n.DstAlphaFactor)
  51490. return Ge.DST_ALPHA;
  51491. if (e === n.OneMinusDstAlphaFactor)
  51492. return Ge.ONE_MINUS_DST_ALPHA;
  51493. if (e === n.DstColorFactor)
  51494. return Ge.DST_COLOR;
  51495. if (e === n.OneMinusDstColorFactor)
  51496. return Ge.ONE_MINUS_DST_COLOR;
  51497. if (e === n.SrcAlphaSaturateFactor)
  51498. return Ge.SRC_ALPHA_SATURATE;
  51499. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  51500. null !== t) {
  51501. if (e === n.RGB_S3TC_DXT1_Format)
  51502. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  51503. if (e === n.RGBA_S3TC_DXT1_Format)
  51504. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  51505. if (e === n.RGBA_S3TC_DXT3_Format)
  51506. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  51507. if (e === n.RGBA_S3TC_DXT5_Format)
  51508. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  51509. }
  51510. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  51511. null !== t) {
  51512. if (e === n.RGB_PVRTC_4BPPV1_Format)
  51513. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  51514. if (e === n.RGB_PVRTC_2BPPV1_Format)
  51515. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  51516. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  51517. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  51518. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  51519. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  51520. }
  51521. if (t = We.get("WEBGL_compressed_texture_etc1"),
  51522. null !== t && e === n.RGB_ETC1_Format)
  51523. return t.COMPRESSED_RGB_ETC1_WEBGL;
  51524. if (t = We.get("EXT_blend_minmax"),
  51525. null !== t) {
  51526. if (e === n.MinEquation)
  51527. return t.MIN_EXT;
  51528. if (e === n.MaxEquation)
  51529. return t.MAX_EXT
  51530. }
  51531. return 0
  51532. }
  51533. console.log("THREE.WebGLRenderer", n.REVISION),
  51534. e = e || {};
  51535. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  51536. , ie = void 0 !== e.context ? e.context : null
  51537. , ne = void 0 !== e.alpha && e.alpha
  51538. , re = void 0 === e.depth || e.depth
  51539. , oe = void 0 === e.stencil || e.stencil
  51540. , ae = void 0 !== e.antialias && e.antialias
  51541. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  51542. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  51543. , ce = []
  51544. , he = []
  51545. , ue = -1
  51546. , de = []
  51547. , pe = -1
  51548. , fe = new Float32Array(8)
  51549. , ge = []
  51550. , me = [];
  51551. this.domElement = te,
  51552. this.context = null,
  51553. this.autoClear = !0,
  51554. this.autoClearColor = !0,
  51555. this.autoClearDepth = !0,
  51556. this.autoClearStencil = !0,
  51557. this.sortObjects = !0,
  51558. this.gammaFactor = 2,
  51559. this.gammaInput = !1,
  51560. this.gammaOutput = !1,
  51561. this.physicallyCorrectLights = !1,
  51562. this.toneMapping = n.LinearToneMapping,
  51563. this.toneMappingExposure = 1,
  51564. this.toneMappingWhitePoint = 1,
  51565. this.maxMorphTargets = 8,
  51566. this.maxMorphNormals = 4,
  51567. this.autoScaleCubemaps = !0;
  51568. var ve = this
  51569. , Ae = null
  51570. , ye = null
  51571. , Ce = null
  51572. , Ie = -1
  51573. , Ee = ""
  51574. , be = null
  51575. , we = new n.Vector4
  51576. , _e = null
  51577. , Te = new n.Vector4
  51578. , xe = 0
  51579. , Se = new n.Color(0)
  51580. , Me = 0
  51581. , Re = te.width
  51582. , Pe = te.height
  51583. , Oe = 1
  51584. , Le = new n.Vector4(0,0,Re,Pe)
  51585. , De = !1
  51586. , Ne = new n.Vector4(0,0,Re,Pe)
  51587. , Be = new n.Frustum
  51588. , Fe = new n.Matrix4
  51589. , Ve = new n.Vector3
  51590. , Ue = {
  51591. hash: "",
  51592. ambient: [0, 0, 0],
  51593. directional: [],
  51594. directionalShadowMap: [],
  51595. directionalShadowMatrix: [],
  51596. spot: [],
  51597. spotShadowMap: [],
  51598. spotShadowMatrix: [],
  51599. point: [],
  51600. pointShadowMap: [],
  51601. pointShadowMatrix: [],
  51602. hemi: [],
  51603. shadows: [],
  51604. shadowsPointLight: 0
  51605. }
  51606. , ke = {
  51607. geometries: 0,
  51608. textures: 0
  51609. }
  51610. , He = {
  51611. calls: 0,
  51612. vertices: 0,
  51613. faces: 0,
  51614. points: 0
  51615. };
  51616. this.info = {
  51617. render: He,
  51618. memory: ke,
  51619. programs: null
  51620. };
  51621. var Ge;
  51622. try {
  51623. var ze = {
  51624. alpha: ne,
  51625. depth: re,
  51626. stencil: oe,
  51627. antialias: ae,
  51628. premultipliedAlpha: se,
  51629. preserveDrawingBuffer: le
  51630. };
  51631. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  51632. null === Ge)
  51633. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  51634. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  51635. return {
  51636. rangeMin: 1,
  51637. rangeMax: 1,
  51638. precision: 1
  51639. }
  51640. }
  51641. ),
  51642. te.addEventListener("webglcontextlost", a, !1)
  51643. } catch (e) {
  51644. console.error("THREE.WebGLRenderer: " + e)
  51645. }
  51646. var We = new n.WebGLExtensions(Ge);
  51647. We.get("OES_texture_float"),
  51648. We.get("OES_texture_float_linear"),
  51649. We.get("OES_texture_half_float"),
  51650. We.get("OES_texture_half_float_linear"),
  51651. We.get("OES_standard_derivatives"),
  51652. We.get("ANGLE_instanced_arrays"),
  51653. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  51654. var je = new n.WebGLCapabilities(Ge,We,e)
  51655. , Ye = new n.WebGLState(Ge,We,ee)
  51656. , Xe = new n.WebGLProperties
  51657. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  51658. , qe = new n.WebGLPrograms(this,je)
  51659. , Ke = new n.WebGLLights;
  51660. this.info.programs = qe.programs;
  51661. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  51662. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  51663. r(),
  51664. this.context = Ge,
  51665. this.capabilities = je,
  51666. this.extensions = We,
  51667. this.properties = Xe,
  51668. this.state = Ye;
  51669. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  51670. this.shadowMap = $e;
  51671. var et = new n.SpritePlugin(this,ge)
  51672. , tt = new n.LensFlarePlugin(this,me);
  51673. this.getContext = function() {
  51674. return Ge
  51675. }
  51676. ,
  51677. this.getContextAttributes = function() {
  51678. return Ge.getContextAttributes()
  51679. }
  51680. ,
  51681. this.forceContextLoss = function() {
  51682. We.get("WEBGL_lose_context").loseContext()
  51683. }
  51684. ,
  51685. this.getMaxAnisotropy = function() {
  51686. var e;
  51687. return function() {
  51688. if (void 0 !== e)
  51689. return e;
  51690. var t = We.get("EXT_texture_filter_anisotropic");
  51691. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  51692. }
  51693. }(),
  51694. this.getPrecision = function() {
  51695. return je.precision
  51696. }
  51697. ,
  51698. this.getPixelRatio = function() {
  51699. return Oe
  51700. }
  51701. ,
  51702. this.setPixelRatio = function(e) {
  51703. void 0 !== e && (Oe = e,
  51704. this.setSize(Ne.z, Ne.w, !1))
  51705. }
  51706. ,
  51707. this.getSize = function() {
  51708. return {
  51709. width: Re,
  51710. height: Pe
  51711. }
  51712. }
  51713. ,
  51714. this.setSize = function(e, t, i, devicePixelRatio) {
  51715. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  51716. Re = e,
  51717. Pe = t,
  51718. te.width = e * Oe,
  51719. te.height = t * Oe,
  51720. i !== !1 && (te.style.width = e + "px",
  51721. te.style.height = t + "px"),
  51722. this.setViewport(0, 0, e, t)
  51723. }
  51724. ,
  51725. this.setViewport = function(e, t, i, n) {
  51726. Ye.viewport(Ne.set(e, t, i, n))
  51727. }
  51728. ,
  51729. this.setScissor = function(e, t, i, n) {
  51730. Ye.scissor(Le.set(e, t, i, n))
  51731. }
  51732. ,
  51733. this.setScissorTest = function(e) {
  51734. Ye.setScissorTest(De = e)
  51735. }
  51736. ,
  51737. this.getClearColor = function() {
  51738. return Se
  51739. }
  51740. ,
  51741. this.setClearColor = function(e, t) {
  51742. Se.set(e),
  51743. Me = void 0 !== t ? t : 1,
  51744. i(Se.r, Se.g, Se.b, Me)
  51745. }
  51746. ,
  51747. this.getClearAlpha = function() {
  51748. return Me
  51749. }
  51750. ,
  51751. this.setClearAlpha = function(e) {
  51752. Me = e,
  51753. i(Se.r, Se.g, Se.b, Me)
  51754. }
  51755. ,
  51756. this.clear = function(e, t, i) {
  51757. var n = 0;
  51758. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  51759. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  51760. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  51761. Ge.clear(n)
  51762. }
  51763. ,
  51764. this.clearColor = function() {
  51765. this.clear(!0, !1, !1)
  51766. }
  51767. ,
  51768. this.clearDepth = function() {
  51769. this.clear(!1, !0, !1)
  51770. }
  51771. ,
  51772. this.clearStencil = function() {
  51773. this.clear(!1, !1, !0)
  51774. }
  51775. ,
  51776. this.clearTarget = function(e, t, i, n) {
  51777. this.setRenderTarget(e),
  51778. this.clear(t, i, n)
  51779. }
  51780. ,
  51781. this.resetGLState = o,
  51782. this.dispose = function() {
  51783. te.removeEventListener("webglcontextlost", a, !1)
  51784. }
  51785. ,
  51786. this.renderBufferImmediate = function(e, t, i) {
  51787. Ye.initAttributes();
  51788. var r = Xe.get(e);
  51789. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  51790. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  51791. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  51792. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  51793. var o = t.getAttributes();
  51794. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  51795. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  51796. Ye.enableAttribute(o.position),
  51797. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  51798. e.hasNormals) {
  51799. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  51800. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  51801. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  51802. var l = e.normalArray
  51803. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  51804. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  51805. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  51806. l[a + 0] = c,
  51807. l[a + 1] = h,
  51808. l[a + 2] = u,
  51809. l[a + 3] = c,
  51810. l[a + 4] = h,
  51811. l[a + 5] = u,
  51812. l[a + 6] = c,
  51813. l[a + 7] = h,
  51814. l[a + 8] = u
  51815. }
  51816. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  51817. Ye.enableAttribute(o.normal),
  51818. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  51819. }
  51820. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  51821. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  51822. Ye.enableAttribute(o.uv),
  51823. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  51824. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  51825. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  51826. Ye.enableAttribute(o.color),
  51827. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  51828. Ye.disableUnusedAttributes(),
  51829. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  51830. e.count = 0
  51831. }
  51832. ,
  51833. this.renderBufferDirect = function(e, i, r, o, a, s) {
  51834. E(o);
  51835. var l = w(e, i, o, a)
  51836. , c = !1
  51837. , h = r.id + "_" + l.id + "_" + o.wireframe;
  51838. h !== Ee && (Ee = h,
  51839. c = !0);
  51840. var u = a.morphTargetInfluences;
  51841. if (void 0 !== u) {
  51842. for (var d = [], p = 0, m = u.length; p < m; p++) {
  51843. var v = u[p];
  51844. d.push([v, p])
  51845. }
  51846. d.sort(g),
  51847. d.length > 8 && (d.length = 8);
  51848. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  51849. var v = d[p];
  51850. if (fe[p] = v[0],
  51851. 0 !== v[0]) {
  51852. var y = v[1];
  51853. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  51854. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  51855. } else
  51856. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  51857. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  51858. }
  51859. var C = l.getUniforms();
  51860. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  51861. c = !0
  51862. }
  51863. var y = r.index
  51864. , I = r.attributes.position;
  51865. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  51866. var b;
  51867. null !== y ? (b = Je,
  51868. b.setIndex(y)) : b = Qe,
  51869. c && (f(o, l, r),
  51870. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  51871. var _ = 0
  51872. , T = 1 / 0;
  51873. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  51874. var x = r.drawRange.start
  51875. , S = r.drawRange.count
  51876. , M = null !== s ? s.start : 0
  51877. , R = null !== s ? s.count : 1 / 0
  51878. , P = Math.max(_, x, M)
  51879. , O = Math.min(_ + T, x + S, M + R) - 1
  51880. , L = Math.max(0, O - P + 1);
  51881. if (a instanceof n.Mesh)
  51882. if (o.wireframe === !0)
  51883. Ye.setLineWidth(o.wireframeLinewidth * t()),
  51884. b.setMode(Ge.LINES);
  51885. else
  51886. switch (a.drawMode) {
  51887. case n.TrianglesDrawMode:
  51888. b.setMode(Ge.TRIANGLES);
  51889. break;
  51890. case n.TriangleStripDrawMode:
  51891. b.setMode(Ge.TRIANGLE_STRIP);
  51892. break;
  51893. case n.TriangleFanDrawMode:
  51894. b.setMode(Ge.TRIANGLE_FAN)
  51895. }
  51896. else if (a instanceof n.Line) {
  51897. var D = o.linewidth;
  51898. void 0 === D && (D = 1),
  51899. Ye.setLineWidth(D * t()),
  51900. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  51901. } else
  51902. a instanceof n.Points && b.setMode(Ge.POINTS);
  51903. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  51904. }
  51905. ,
  51906. this.render = function(e, t, i, r) {
  51907. if (t instanceof n.Camera == !1)
  51908. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  51909. var o = e.fog;
  51910. if (Ee = "",
  51911. Ie = -1,
  51912. be = null,
  51913. e.autoUpdate === !0 && e.updateMatrixWorld(),
  51914. null === t.parent && t.updateMatrixWorld(),
  51915. t.matrixWorldInverse.getInverse(t.matrixWorld),
  51916. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  51917. Be.setFromMatrix(Fe),
  51918. ce.length = 0,
  51919. ue = -1,
  51920. pe = -1,
  51921. ge.length = 0,
  51922. me.length = 0,
  51923. y(e, t),
  51924. he.length = ue + 1,
  51925. de.length = pe + 1,
  51926. ve.sortObjects === !0 && (he.sort(m),
  51927. de.sort(v)),
  51928. U(ce, t),
  51929. $e.render(e, t),
  51930. He.calls = 0,
  51931. He.vertices = 0,
  51932. He.faces = 0,
  51933. He.points = 0,
  51934. void 0 === i && (i = null),
  51935. this.setRenderTarget(i),
  51936. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  51937. e.overrideMaterial) {
  51938. var a = e.overrideMaterial;
  51939. C(he, t, o, a),
  51940. C(de, t, o, a)
  51941. } else
  51942. Ye.setBlending(n.NoBlending),
  51943. C(he, t, o),
  51944. C(de, t, o);
  51945. if (et.render(e, t),
  51946. tt.render(e, t, Te),
  51947. i) {
  51948. var s = i.texture;
  51949. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  51950. }
  51951. Ye.setDepthTest(!0),
  51952. Ye.setDepthWrite(!0),
  51953. Ye.setColorWrite(!0)
  51954. }
  51955. ,
  51956. this.setFaceCulling = function(e, t) {
  51957. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  51958. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  51959. Ye.enable(Ge.CULL_FACE))
  51960. }
  51961. ,
  51962. this.setTexture = function(e, t) {
  51963. var i = Xe.get(e);
  51964. if (e.version > 0 && i.__version !== e.version) {
  51965. var n = e.image;
  51966. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  51967. }
  51968. Ye.activeTexture(Ge.TEXTURE0 + t),
  51969. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  51970. }
  51971. ,
  51972. this.getCurrentRenderTarget = function() {
  51973. return ye
  51974. }
  51975. ,
  51976. this.setRenderTarget = function(e) {
  51977. ye = e,
  51978. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  51979. var t, i = e instanceof n.WebGLRenderTargetCube;
  51980. if (e) {
  51981. var r = Xe.get(e);
  51982. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  51983. we.copy(e.scissor),
  51984. _e = e.scissorTest,
  51985. Te.copy(e.viewport)
  51986. } else
  51987. t = null,
  51988. we.copy(Le).multiplyScalar(Oe),
  51989. _e = De,
  51990. Te.copy(Ne).multiplyScalar(Oe);
  51991. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  51992. Ce = t),
  51993. Ye.scissor(we),
  51994. Ye.setScissorTest(_e),
  51995. Ye.viewport(Te),
  51996. i) {
  51997. var o = Xe.get(e.texture);
  51998. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  51999. }
  52000. }
  52001. ,
  52002. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52003. if (e instanceof n.WebGLRenderTarget == !1)
  52004. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52005. var s = Xe.get(e).__webglFramebuffer;
  52006. if (s) {
  52007. var l = !1;
  52008. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52009. l = !0);
  52010. try {
  52011. var c = e.texture;
  52012. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52013. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52014. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  52015. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52016. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  52017. } finally {
  52018. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52019. }
  52020. }
  52021. }
  52022. }
  52023. ,
  52024. n.WebGLRenderTarget = function(e, t, i) {
  52025. this.uuid = n.Math.generateUUID(),
  52026. this.width = e,
  52027. this.height = t,
  52028. this.scissor = new n.Vector4(0,0,e,t),
  52029. this.scissorTest = !1,
  52030. this.viewport = new n.Vector4(0,0,e,t),
  52031. i = i || {},
  52032. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52033. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52034. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52035. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52036. }
  52037. ,
  52038. n.WebGLRenderTarget.prototype = {
  52039. constructor: n.WebGLRenderTarget,
  52040. setSize: function(e, t) {
  52041. this.width === e && this.height === t || (this.width = e,
  52042. this.height = t,
  52043. this.dispose()),
  52044. this.viewport.set(0, 0, e, t),
  52045. this.scissor.set(0, 0, e, t)
  52046. },
  52047. clone: function() {
  52048. return (new this.constructor).copy(this)
  52049. },
  52050. copy: function(e) {
  52051. return this.width = e.width,
  52052. this.height = e.height,
  52053. this.viewport.copy(e.viewport),
  52054. this.texture = e.texture.clone(),
  52055. this.depthBuffer = e.depthBuffer,
  52056. this.stencilBuffer = e.stencilBuffer,
  52057. this
  52058. },
  52059. dispose: function() {
  52060. this.dispatchEvent({
  52061. type: "dispose"
  52062. })
  52063. }
  52064. },
  52065. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52066. n.WebGLRenderTargetCube = function(e, t, i) {
  52067. n.WebGLRenderTarget.call(this, e, t, i),
  52068. this.activeCubeFace = 0,
  52069. this.activeMipMapLevel = 0
  52070. }
  52071. ,
  52072. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52073. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52074. n.WebGLBufferRenderer = function(e, t, i) {
  52075. function r(e) {
  52076. s = e
  52077. }
  52078. function o(t, n) {
  52079. e.drawArrays(s, t, n),
  52080. i.calls++,
  52081. i.vertices += n,
  52082. s === e.TRIANGLES && (i.faces += n / 3)
  52083. }
  52084. function a(r) {
  52085. var o = t.get("ANGLE_instanced_arrays");
  52086. if (null === o)
  52087. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52088. var a = r.attributes.position
  52089. , l = 0;
  52090. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52091. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52092. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52093. i.calls++,
  52094. i.vertices += l * r.maxInstancedCount,
  52095. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52096. }
  52097. var s;
  52098. this.setMode = r,
  52099. this.render = o,
  52100. this.renderInstances = a
  52101. }
  52102. ,
  52103. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52104. function n(e) {
  52105. s = e
  52106. }
  52107. function r(i) {
  52108. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52109. c = 4) : (l = e.UNSIGNED_SHORT,
  52110. c = 2)
  52111. }
  52112. function o(t, n) {
  52113. e.drawElements(s, n, l, t * c),
  52114. i.calls++,
  52115. i.vertices += n,
  52116. s === e.TRIANGLES && (i.faces += n / 3)
  52117. }
  52118. function a(n, r, o) {
  52119. var a = t.get("ANGLE_instanced_arrays");
  52120. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  52121. i.calls++,
  52122. i.vertices += o * n.maxInstancedCount,
  52123. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52124. }
  52125. var s, l, c;
  52126. this.setMode = n,
  52127. this.setIndex = r,
  52128. this.render = o,
  52129. this.renderInstances = a
  52130. }
  52131. ,
  52132. n.WebGLExtensions = function(e) {
  52133. var t = {};
  52134. this.get = function(i) {
  52135. if (void 0 !== t[i])
  52136. return t[i];
  52137. var n;
  52138. switch (i) {
  52139. case "EXT_texture_filter_anisotropic":
  52140. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52141. break;
  52142. case "WEBGL_compressed_texture_s3tc":
  52143. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52144. break;
  52145. case "WEBGL_compressed_texture_pvrtc":
  52146. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52147. break;
  52148. case "WEBGL_compressed_texture_etc1":
  52149. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52150. break;
  52151. default:
  52152. n = e.getExtension(i)
  52153. }
  52154. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52155. t[i] = n,
  52156. n
  52157. }
  52158. }
  52159. ,
  52160. n.WebGLCapabilities = function(e, t, i) {
  52161. function n(t) {
  52162. if ("highp" === t) {
  52163. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52164. return "highp";
  52165. t = "mediump"
  52166. }
  52167. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  52168. }
  52169. this.getMaxPrecision = n,
  52170. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52171. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52172. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52173. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52174. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52175. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52176. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52177. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52178. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52179. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52180. this.vertexTextures = this.maxVertexTextures > 0,
  52181. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52182. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52183. var r = n(this.precision);
  52184. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52185. this.precision = r),
  52186. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52187. }
  52188. ,
  52189. n.WebGLGeometries = function(e, t, i) {
  52190. function r(e) {
  52191. var t = e.geometry;
  52192. if (void 0 !== h[t.id])
  52193. return h[t.id];
  52194. t.addEventListener("dispose", o);
  52195. var r;
  52196. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52197. r = t._bufferGeometry),
  52198. h[t.id] = r,
  52199. i.memory.geometries++,
  52200. r
  52201. }
  52202. function o(e) {
  52203. var n = e.target
  52204. , r = h[n.id];
  52205. null !== r.index && s(r.index),
  52206. l(r.attributes),
  52207. n.removeEventListener("dispose", o),
  52208. delete h[n.id];
  52209. var a = t.get(n);
  52210. a.wireframe && s(a.wireframe),
  52211. t.delete(n);
  52212. var c = t.get(r);
  52213. c.wireframe && s(c.wireframe),
  52214. t.delete(r),
  52215. i.memory.geometries--
  52216. }
  52217. function a(e) {
  52218. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52219. }
  52220. function s(t) {
  52221. var i = a(t);
  52222. void 0 !== i && (e.deleteBuffer(i),
  52223. c(t))
  52224. }
  52225. function l(e) {
  52226. for (var t in e)
  52227. s(e[t])
  52228. }
  52229. function c(e) {
  52230. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52231. }
  52232. var h = {};
  52233. this.get = r
  52234. }
  52235. ,
  52236. n.WebGLLights = function() {
  52237. var e = {};
  52238. this.get = function(t) {
  52239. if (void 0 !== e[t.id])
  52240. return e[t.id];
  52241. var i;
  52242. switch (t.type) {
  52243. case "DirectionalLight":
  52244. i = {
  52245. direction: new n.Vector3,
  52246. color: new n.Color,
  52247. shadow: !1,
  52248. shadowBias: 0,
  52249. shadowRadius: 1,
  52250. shadowMapSize: new n.Vector2
  52251. };
  52252. break;
  52253. case "SpotLight":
  52254. i = {
  52255. position: new n.Vector3,
  52256. direction: new n.Vector3,
  52257. color: new n.Color,
  52258. distance: 0,
  52259. coneCos: 0,
  52260. penumbraCos: 0,
  52261. decay: 0,
  52262. shadow: !1,
  52263. shadowBias: 0,
  52264. shadowRadius: 1,
  52265. shadowMapSize: new n.Vector2
  52266. };
  52267. break;
  52268. case "PointLight":
  52269. i = {
  52270. position: new n.Vector3,
  52271. color: new n.Color,
  52272. distance: 0,
  52273. decay: 0,
  52274. shadow: !1,
  52275. shadowBias: 0,
  52276. shadowRadius: 1,
  52277. shadowMapSize: new n.Vector2
  52278. };
  52279. break;
  52280. case "HemisphereLight":
  52281. i = {
  52282. direction: new n.Vector3,
  52283. skyColor: new n.Color,
  52284. groundColor: new n.Color
  52285. }
  52286. }
  52287. return e[t.id] = i,
  52288. i
  52289. }
  52290. }
  52291. ,
  52292. n.WebGLObjects = function(e, t, i) {
  52293. function r(t) {
  52294. var i = u.get(t);
  52295. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52296. var r = i.index
  52297. , a = i.attributes;
  52298. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52299. for (var s in a)
  52300. o(a[s], e.ARRAY_BUFFER);
  52301. var l = i.morphAttributes;
  52302. for (var s in l)
  52303. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52304. o(c[h], e.ARRAY_BUFFER);
  52305. return i
  52306. }
  52307. function o(e, i) {
  52308. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52309. , o = t.get(r);
  52310. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52311. }
  52312. function a(t, i, n) {
  52313. t.__webglBuffer = e.createBuffer(),
  52314. e.bindBuffer(n, t.__webglBuffer);
  52315. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52316. e.bufferData(n, i.array, r),
  52317. t.version = i.version
  52318. }
  52319. function s(t, i, n) {
  52320. e.bindBuffer(n, t.__webglBuffer),
  52321. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.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.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  52322. i.updateRange.count = 0),
  52323. t.version = i.version
  52324. }
  52325. function l(e) {
  52326. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52327. }
  52328. function c(i) {
  52329. var r = t.get(i);
  52330. if (void 0 !== r.wireframe)
  52331. return r.wireframe;
  52332. var a = []
  52333. , s = i.index
  52334. , l = i.attributes
  52335. , c = l.position;
  52336. if (null !== s)
  52337. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52338. var g = d[p + 0]
  52339. , m = d[p + 1]
  52340. , v = d[p + 2];
  52341. h(u, g, m) && a.push(g, m),
  52342. h(u, m, v) && a.push(m, v),
  52343. h(u, v, g) && a.push(v, g)
  52344. }
  52345. else
  52346. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52347. var g = p + 0
  52348. , m = p + 1
  52349. , v = p + 2;
  52350. a.push(g, m, m, v, v, g)
  52351. }
  52352. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52353. , y = new n.BufferAttribute(new A(a),1);
  52354. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52355. r.wireframe = y,
  52356. y
  52357. }
  52358. function h(e, t, i) {
  52359. if (t > i) {
  52360. var n = t;
  52361. t = i,
  52362. i = n
  52363. }
  52364. var r = e[t];
  52365. return void 0 === r ? (e[t] = [i],
  52366. !0) : r.indexOf(i) === -1 && (r.push(i),
  52367. !0)
  52368. }
  52369. var u = new n.WebGLGeometries(e,t,i);
  52370. this.getAttributeBuffer = l,
  52371. this.getWireframeAttribute = c,
  52372. this.update = r
  52373. }
  52374. ,
  52375. n.WebGLProgram = function() {
  52376. function e(e) {
  52377. switch (e) {
  52378. case n.LinearEncoding:
  52379. return ["Linear", "( value )"];
  52380. case n.sRGBEncoding:
  52381. return ["sRGB", "( value )"];
  52382. case n.RGBEEncoding:
  52383. return ["RGBE", "( value )"];
  52384. case n.RGBM7Encoding:
  52385. return ["RGBM", "( value, 7.0 )"];
  52386. case n.RGBM16Encoding:
  52387. return ["RGBM", "( value, 16.0 )"];
  52388. case n.RGBDEncoding:
  52389. return ["RGBD", "( value, 256.0 )"];
  52390. case n.GammaEncoding:
  52391. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52392. default:
  52393. throw new Error("unsupported encoding: " + e)
  52394. }
  52395. }
  52396. function t(t, i) {
  52397. var n = e(i);
  52398. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52399. }
  52400. function i(t, i) {
  52401. var n = e(i);
  52402. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52403. }
  52404. function r(e, t) {
  52405. var i;
  52406. switch (t) {
  52407. case n.LinearToneMapping:
  52408. i = "Linear";
  52409. break;
  52410. case n.ReinhardToneMapping:
  52411. i = "Reinhard";
  52412. break;
  52413. case n.Uncharted2ToneMapping:
  52414. i = "Uncharted2";
  52415. break;
  52416. case n.CineonToneMapping:
  52417. i = "OptimizedCineon";
  52418. break;
  52419. default:
  52420. throw new Error("unsupported toneMapping: " + t)
  52421. }
  52422. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52423. }
  52424. function o(e, t, i) {
  52425. e = e || {};
  52426. var n = [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" : ""];
  52427. return n.filter(c).join("\n")
  52428. }
  52429. function a(e) {
  52430. var t = [];
  52431. for (var i in e) {
  52432. var n = e[i];
  52433. n !== !1 && t.push("#define " + i + " " + n)
  52434. }
  52435. return t.join("\n")
  52436. }
  52437. function s(e, t, i) {
  52438. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52439. var a = e.getActiveUniform(t, o)
  52440. , s = a.name
  52441. , l = e.getUniformLocation(t, s)
  52442. , c = f.exec(s);
  52443. if (c) {
  52444. var h = c[1]
  52445. , u = c[2]
  52446. , d = n[h];
  52447. d || (d = n[h] = {}),
  52448. d[u] = l
  52449. } else if (c = g.exec(s)) {
  52450. var p = c[1]
  52451. , v = c[2]
  52452. , A = c[3]
  52453. , y = n[p];
  52454. y || (y = n[p] = []);
  52455. var C = y[v];
  52456. C || (C = y[v] = {}),
  52457. C[A] = l
  52458. } else if (c = m.exec(s)) {
  52459. var p = c[1];
  52460. n[p] = l
  52461. } else
  52462. n[s] = l
  52463. }
  52464. return n
  52465. }
  52466. function l(e, t, i) {
  52467. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  52468. var a = e.getActiveAttrib(t, o)
  52469. , s = a.name;
  52470. n[s] = e.getAttribLocation(t, s)
  52471. }
  52472. return n
  52473. }
  52474. function c(e) {
  52475. return "" !== e
  52476. }
  52477. function h(e, t) {
  52478. 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)
  52479. }
  52480. function u(e) {
  52481. function t(e, t) {
  52482. var i = n.ShaderChunk[t];
  52483. if (void 0 === i)
  52484. throw new Error("Can not resolve #include <" + t + ">");
  52485. return u(i)
  52486. }
  52487. var i = /#include +<([\w\d.]+)>/g;
  52488. return e.replace(i, t)
  52489. }
  52490. function d(e) {
  52491. function t(e, t, i, n) {
  52492. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  52493. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  52494. return r
  52495. }
  52496. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  52497. return e.replace(i, t)
  52498. }
  52499. var p = 0
  52500. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  52501. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  52502. , m = /^([\w\d_]+)\[0\]$/;
  52503. return function(e, f, g, m) {
  52504. var v = e.context
  52505. , A = g.extensions
  52506. , y = g.defines
  52507. , C = g.__webglShader.vertexShader
  52508. , I = g.__webglShader.fragmentShader
  52509. , E = "SHADOWMAP_TYPE_BASIC";
  52510. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  52511. var b = "ENVMAP_TYPE_CUBE"
  52512. , w = "ENVMAP_MODE_REFLECTION"
  52513. , _ = "ENVMAP_BLENDING_MULTIPLY";
  52514. if (m.envMap) {
  52515. switch (g.envMap.mapping) {
  52516. case n.CubeReflectionMapping:
  52517. case n.CubeRefractionMapping:
  52518. b = "ENVMAP_TYPE_CUBE";
  52519. break;
  52520. case n.CubeUVReflectionMapping:
  52521. case n.CubeUVRefractionMapping:
  52522. b = "ENVMAP_TYPE_CUBE_UV";
  52523. break;
  52524. case n.EquirectangularReflectionMapping:
  52525. case n.EquirectangularRefractionMapping:
  52526. b = "ENVMAP_TYPE_EQUIREC";
  52527. break;
  52528. case n.SphericalReflectionMapping:
  52529. b = "ENVMAP_TYPE_SPHERE"
  52530. }
  52531. switch (g.envMap.mapping) {
  52532. case n.CubeRefractionMapping:
  52533. case n.EquirectangularRefractionMapping:
  52534. w = "ENVMAP_MODE_REFRACTION"
  52535. }
  52536. switch (g.combine) {
  52537. case n.MultiplyOperation:
  52538. _ = "ENVMAP_BLENDING_MULTIPLY";
  52539. break;
  52540. case n.MixOperation:
  52541. _ = "ENVMAP_BLENDING_MIX";
  52542. break;
  52543. case n.AddOperation:
  52544. _ = "ENVMAP_BLENDING_ADD"
  52545. }
  52546. }
  52547. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  52548. g instanceof n.RawShaderMaterial ? (T = "",
  52549. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.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(c).join("\n"),
  52550. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  52551. C = u(C, m),
  52552. C = h(C, m),
  52553. I = u(I, m),
  52554. I = h(I, m),
  52555. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  52556. I = d(I));
  52557. var O = T + C
  52558. , L = x + I
  52559. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  52560. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  52561. v.attachShader(P, D),
  52562. v.attachShader(P, N),
  52563. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  52564. v.linkProgram(P);
  52565. var B = v.getProgramInfoLog(P)
  52566. , F = v.getShaderInfoLog(D)
  52567. , V = v.getShaderInfoLog(N)
  52568. , U = !0
  52569. , k = !0;
  52570. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  52571. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  52572. k && (this.diagnostics = {
  52573. runnable: U,
  52574. material: g,
  52575. programLog: B,
  52576. vertexShader: {
  52577. log: F,
  52578. prefix: T
  52579. },
  52580. fragmentShader: {
  52581. log: V,
  52582. prefix: x
  52583. }
  52584. }),
  52585. v.deleteShader(D),
  52586. v.deleteShader(N);
  52587. var H;
  52588. this.getUniforms = function() {
  52589. return void 0 === H && (H = s(v, P)),
  52590. H
  52591. }
  52592. ;
  52593. var G;
  52594. return this.getAttributes = function() {
  52595. return void 0 === G && (G = l(v, P)),
  52596. G
  52597. }
  52598. ,
  52599. this.destroy = function() {
  52600. v.deleteProgram(P),
  52601. this.program = void 0
  52602. }
  52603. ,
  52604. Object.defineProperties(this, {
  52605. uniforms: {
  52606. get: function() {
  52607. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  52608. this.getUniforms()
  52609. }
  52610. },
  52611. attributes: {
  52612. get: function() {
  52613. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  52614. this.getAttributes()
  52615. }
  52616. }
  52617. }),
  52618. this.id = p++,
  52619. this.code = f,
  52620. this.usedTimes = 1,
  52621. this.program = P,
  52622. this.vertexShader = D,
  52623. this.fragmentShader = N,
  52624. this
  52625. }
  52626. }(),
  52627. n.WebGLPrograms = function(e, t) {
  52628. function i(e) {
  52629. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  52630. return 1024;
  52631. var i = t.maxVertexUniforms
  52632. , r = Math.floor((i - 20) / 4)
  52633. , o = r;
  52634. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  52635. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  52636. o
  52637. }
  52638. function r(e, t) {
  52639. var i;
  52640. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  52641. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  52642. i
  52643. }
  52644. var o = []
  52645. , a = {
  52646. MeshDepthMaterial: "depth",
  52647. MeshNormalMaterial: "normal",
  52648. MeshBasicMaterial: "basic",
  52649. MeshLambertMaterial: "lambert",
  52650. MeshPhongMaterial: "phong",
  52651. MeshStandardMaterial: "standard",
  52652. LineBasicMaterial: "basic",
  52653. LineDashedMaterial: "dashed",
  52654. PointsMaterial: "points"
  52655. }
  52656. , s = ["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"];
  52657. this.getParameters = function(o, s, l, c) {
  52658. var h = a[o.type]
  52659. , u = i(c)
  52660. , d = e.getPrecision();
  52661. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  52662. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  52663. var p = {
  52664. shaderID: h,
  52665. precision: d,
  52666. supportsVertexTextures: t.vertexTextures,
  52667. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  52668. map: !!o.map,
  52669. mapEncoding: r(o.map, e.gammaInput),
  52670. envMap: !!o.envMap,
  52671. envMapMode: o.envMap && o.envMap.mapping,
  52672. envMapEncoding: r(o.envMap, e.gammaInput),
  52673. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  52674. lightMap: !!o.lightMap,
  52675. aoMap: !!o.aoMap,
  52676. emissiveMap: !!o.emissiveMap,
  52677. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  52678. bumpMap: !!o.bumpMap,
  52679. normalMap: !!o.normalMap,
  52680. displacementMap: !!o.displacementMap,
  52681. roughnessMap: !!o.roughnessMap,
  52682. metalnessMap: !!o.metalnessMap,
  52683. specularMap: !!o.specularMap,
  52684. alphaMap: !!o.alphaMap,
  52685. combine: o.combine,
  52686. vertexColors: o.vertexColors,
  52687. fog: l,
  52688. useFog: o.fog,
  52689. fogExp: l instanceof n.FogExp2,
  52690. flatShading: o.shading === n.FlatShading,
  52691. sizeAttenuation: o.sizeAttenuation,
  52692. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  52693. skinning: o.skinning,
  52694. maxBones: u,
  52695. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  52696. morphTargets: o.morphTargets,
  52697. morphNormals: o.morphNormals,
  52698. maxMorphTargets: e.maxMorphTargets,
  52699. maxMorphNormals: e.maxMorphNormals,
  52700. numDirLights: s.directional.length,
  52701. numPointLights: s.point.length,
  52702. numSpotLights: s.spot.length,
  52703. numHemiLights: s.hemi.length,
  52704. pointLightShadows: s.shadowsPointLight,
  52705. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  52706. shadowMapType: e.shadowMap.type,
  52707. toneMapping: e.toneMapping,
  52708. physicallyCorrectLights: e.physicallyCorrectLights,
  52709. premultipliedAlpha: o.premultipliedAlpha,
  52710. alphaTest: o.alphaTest,
  52711. doubleSided: o.side === n.DoubleSide,
  52712. flipSided: o.side === n.BackSide
  52713. };
  52714. return p
  52715. }
  52716. ,
  52717. this.getProgramCode = function(e, t) {
  52718. var i = [];
  52719. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  52720. i.push(e.vertexShader)),
  52721. void 0 !== e.defines)
  52722. for (var n in e.defines)
  52723. i.push(n),
  52724. i.push(e.defines[n]);
  52725. for (var r = 0; r < s.length; r++) {
  52726. var o = s[r];
  52727. i.push(o),
  52728. i.push(t[o])
  52729. }
  52730. return i.join()
  52731. }
  52732. ,
  52733. this.acquireProgram = function(t, i, r) {
  52734. for (var a, s = 0, l = o.length; s < l; s++) {
  52735. var c = o[s];
  52736. if (c.code === r) {
  52737. a = c,
  52738. ++a.usedTimes;
  52739. break
  52740. }
  52741. }
  52742. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  52743. o.push(a)),
  52744. a
  52745. }
  52746. ,
  52747. this.releaseProgram = function(e) {
  52748. if (0 === --e.usedTimes) {
  52749. var t = o.indexOf(e);
  52750. o[t] = o[o.length - 1],
  52751. o.pop(),
  52752. e.destroy()
  52753. }
  52754. }
  52755. ,
  52756. this.programs = o
  52757. }
  52758. ,
  52759. n.WebGLProperties = function() {
  52760. var e = {};
  52761. this.get = function(t) {
  52762. var i = t.uuid
  52763. , n = e[i];
  52764. return void 0 === n && (n = {},
  52765. e[i] = n),
  52766. n
  52767. }
  52768. ,
  52769. this.delete = function(t) {
  52770. delete e[t.uuid]
  52771. }
  52772. ,
  52773. this.clear = function() {
  52774. e = {}
  52775. }
  52776. }
  52777. ,
  52778. n.WebGLShader = function() {
  52779. function e(e) {
  52780. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  52781. t[i] = i + 1 + ": " + t[i];
  52782. return t.join("\n")
  52783. }
  52784. return function(t, i, n) {
  52785. var r = t.createShader(i);
  52786. return t.shaderSource(r, n),
  52787. t.compileShader(r),
  52788. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  52789. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  52790. r
  52791. }
  52792. }(),
  52793. n.WebGLShadowMap = function(e, t, i) {
  52794. function r(e, t, i, r) {
  52795. var o = e.geometry
  52796. , a = null
  52797. , s = v
  52798. , l = e.customDepthMaterial;
  52799. if (i && (s = A,
  52800. l = e.customDistanceMaterial),
  52801. l)
  52802. a = l;
  52803. else {
  52804. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  52805. , h = e instanceof n.SkinnedMesh && t.skinning
  52806. , u = 0;
  52807. c && (u |= f),
  52808. h && (u |= g),
  52809. a = s[u]
  52810. }
  52811. return a.visible = t.visible,
  52812. a.wireframe = t.wireframe,
  52813. a.wireframeLinewidth = t.wireframeLinewidth,
  52814. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  52815. a
  52816. }
  52817. function o(e, t, i) {
  52818. if (e.visible !== !1) {
  52819. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  52820. var r = e.material;
  52821. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  52822. p.push(e))
  52823. }
  52824. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  52825. o(a[s], t, i)
  52826. }
  52827. }
  52828. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  52829. var x = 0 !== (T & f)
  52830. , S = 0 !== (T & g)
  52831. , M = new n.ShaderMaterial({
  52832. uniforms: b,
  52833. vertexShader: E.vertexShader,
  52834. fragmentShader: E.fragmentShader,
  52835. morphTargets: x,
  52836. skinning: S
  52837. });
  52838. v[T] = M;
  52839. var R = new n.ShaderMaterial({
  52840. defines: {
  52841. USE_SHADOWMAP: ""
  52842. },
  52843. uniforms: _,
  52844. vertexShader: w.vertexShader,
  52845. fragmentShader: w.fragmentShader,
  52846. morphTargets: x,
  52847. skinning: S
  52848. });
  52849. A[T] = R
  52850. }
  52851. var P = this;
  52852. this.enabled = !1,
  52853. this.autoUpdate = !0,
  52854. this.needsUpdate = !1,
  52855. this.type = n.PCFShadowMap,
  52856. this.cullFace = n.CullFaceFront,
  52857. this.render = function(f, g) {
  52858. var m, v, A = t.shadows;
  52859. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  52860. s.clearColor(1, 1, 1, 1),
  52861. s.disable(a.BLEND),
  52862. s.enable(a.CULL_FACE),
  52863. a.frontFace(a.CCW),
  52864. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  52865. s.setDepthTest(!0),
  52866. s.setScissorTest(!1);
  52867. for (var E = 0, b = A.length; E < b; E++) {
  52868. var w = A[E]
  52869. , _ = w.shadow
  52870. , T = _.camera;
  52871. if (h.copy(_.mapSize),
  52872. w instanceof n.PointLight) {
  52873. m = 6,
  52874. v = !0;
  52875. var x = h.x
  52876. , S = h.y;
  52877. I[0].set(2 * x, S, x, S),
  52878. I[1].set(0, S, x, S),
  52879. I[2].set(3 * x, S, x, S),
  52880. I[3].set(x, S, x, S),
  52881. I[4].set(3 * x, 0, x, S),
  52882. I[5].set(x, 0, x, S),
  52883. h.x *= 4,
  52884. h.y *= 2
  52885. } else
  52886. m = 1,
  52887. v = !1;
  52888. if (null === _.map) {
  52889. var M = {
  52890. minFilter: n.NearestFilter,
  52891. magFilter: n.NearestFilter,
  52892. format: n.RGBAFormat
  52893. };
  52894. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  52895. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  52896. T.updateProjectionMatrix()
  52897. }
  52898. var R = _.map
  52899. , O = _.matrix;
  52900. d.setFromMatrixPosition(w.matrixWorld),
  52901. T.position.copy(d),
  52902. e.setRenderTarget(R),
  52903. e.clear();
  52904. for (var L = 0; L < m; L++) {
  52905. if (v) {
  52906. u.copy(T.position),
  52907. u.add(y[L]),
  52908. T.up.copy(C[L]),
  52909. T.lookAt(u);
  52910. var D = I[L];
  52911. s.viewport(D)
  52912. } else
  52913. u.setFromMatrixPosition(w.target.matrixWorld),
  52914. T.lookAt(u);
  52915. T.updateMatrixWorld(),
  52916. T.matrixWorldInverse.getInverse(T.matrixWorld),
  52917. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  52918. O.multiply(T.projectionMatrix),
  52919. O.multiply(T.matrixWorldInverse),
  52920. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  52921. l.setFromMatrix(c),
  52922. p.length = 0,
  52923. o(f, g, T);
  52924. for (var N = 0, B = p.length; N < B; N++) {
  52925. var F = p[N]
  52926. , V = i.update(F)
  52927. , U = F.material;
  52928. if (U instanceof n.MultiMaterial)
  52929. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  52930. var W = k[G]
  52931. , j = H[W.materialIndex];
  52932. if (j.visible === !0) {
  52933. var Y = r(F, j, v, d);
  52934. e.renderBufferDirect(T, null, V, Y, F, W)
  52935. }
  52936. }
  52937. else {
  52938. var Y = r(F, U, v, d);
  52939. e.renderBufferDirect(T, null, V, Y, F, null)
  52940. }
  52941. }
  52942. }
  52943. }
  52944. var X = e.getClearColor()
  52945. , Z = e.getClearAlpha();
  52946. e.setClearColor(X, Z),
  52947. s.enable(a.BLEND),
  52948. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  52949. P.needsUpdate = !1
  52950. }
  52951. }
  52952. }
  52953. ,
  52954. n.WebGLState = function(e, t, i) {
  52955. var r = this
  52956. , o = new n.Vector4
  52957. , a = new Uint8Array(16)
  52958. , s = new Uint8Array(16)
  52959. , l = new Uint8Array(16)
  52960. , c = {}
  52961. , h = null
  52962. , u = null
  52963. , d = null
  52964. , p = null
  52965. , f = null
  52966. , g = null
  52967. , m = null
  52968. , v = null
  52969. , A = !1
  52970. , y = null
  52971. , C = null
  52972. , I = null
  52973. , E = null
  52974. , b = null
  52975. , w = null
  52976. , _ = null
  52977. , T = null
  52978. , x = null
  52979. , S = null
  52980. , M = null
  52981. , R = null
  52982. , P = null
  52983. , O = null
  52984. , L = null
  52985. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  52986. , N = void 0
  52987. , B = {}
  52988. , F = new n.Vector4
  52989. , V = null
  52990. , U = null
  52991. , k = new n.Vector4
  52992. , H = new n.Vector4
  52993. , G = e.createTexture();
  52994. e.bindTexture(e.TEXTURE_2D, G),
  52995. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  52996. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  52997. this.init = function() {
  52998. this.clearColor(0, 0, 0, 1),
  52999. this.clearDepth(1),
  53000. this.clearStencil(0),
  53001. this.enable(e.DEPTH_TEST),
  53002. e.depthFunc(e.LEQUAL),
  53003. e.frontFace(e.CCW),
  53004. e.cullFace(e.BACK),
  53005. this.enable(e.CULL_FACE),
  53006. this.enable(e.BLEND),
  53007. e.blendEquation(e.FUNC_ADD),
  53008. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53009. }
  53010. ,
  53011. this.initAttributes = function() {
  53012. for (var e = 0, t = a.length; e < t; e++)
  53013. a[e] = 0
  53014. }
  53015. ,
  53016. this.enableAttribute = function(i) {
  53017. if (a[i] = 1,
  53018. 0 === s[i] && (e.enableVertexAttribArray(i),
  53019. s[i] = 1),
  53020. 0 !== l[i]) {
  53021. var n = t.get("ANGLE_instanced_arrays");
  53022. n.vertexAttribDivisorANGLE(i, 0),
  53023. l[i] = 0
  53024. }
  53025. }
  53026. ,
  53027. this.enableAttributeAndDivisor = function(t, i, n) {
  53028. a[t] = 1,
  53029. 0 === s[t] && (e.enableVertexAttribArray(t),
  53030. s[t] = 1),
  53031. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53032. l[t] = i)
  53033. }
  53034. ,
  53035. this.disableUnusedAttributes = function() {
  53036. for (var t = 0, i = s.length; t < i; t++)
  53037. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53038. s[t] = 0)
  53039. }
  53040. ,
  53041. this.enable = function(t) {
  53042. c[t] !== !0 && (e.enable(t),
  53043. c[t] = !0)
  53044. }
  53045. ,
  53046. this.disable = function(t) {
  53047. c[t] !== !1 && (e.disable(t),
  53048. c[t] = !1)
  53049. }
  53050. ,
  53051. this.getCompressedTextureFormats = function() {
  53052. if (null === h && (h = [],
  53053. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53054. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53055. h.push(i[n]);
  53056. return h
  53057. }
  53058. ,
  53059. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53060. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53061. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53062. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53063. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53064. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53065. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53066. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53067. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53068. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53069. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53070. u = t,
  53071. A = h),
  53072. t === n.CustomBlending ? (s = s || r,
  53073. l = l || o,
  53074. c = c || a,
  53075. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53076. d = r,
  53077. g = s),
  53078. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53079. p = o,
  53080. f = a,
  53081. m = l,
  53082. v = c)) : (d = null,
  53083. p = null,
  53084. f = null,
  53085. g = null,
  53086. m = null,
  53087. v = null)
  53088. }
  53089. ,
  53090. this.setDepthFunc = function(t) {
  53091. if (y !== t) {
  53092. if (t)
  53093. switch (t) {
  53094. case n.NeverDepth:
  53095. e.depthFunc(e.NEVER);
  53096. break;
  53097. case n.AlwaysDepth:
  53098. e.depthFunc(e.ALWAYS);
  53099. break;
  53100. case n.LessDepth:
  53101. e.depthFunc(e.LESS);
  53102. break;
  53103. case n.LessEqualDepth:
  53104. e.depthFunc(e.LEQUAL);
  53105. break;
  53106. case n.EqualDepth:
  53107. e.depthFunc(e.EQUAL);
  53108. break;
  53109. case n.GreaterEqualDepth:
  53110. e.depthFunc(e.GEQUAL);
  53111. break;
  53112. case n.GreaterDepth:
  53113. e.depthFunc(e.GREATER);
  53114. break;
  53115. case n.NotEqualDepth:
  53116. e.depthFunc(e.NOTEQUAL);
  53117. break;
  53118. default:
  53119. e.depthFunc(e.LEQUAL)
  53120. }
  53121. else
  53122. e.depthFunc(e.LEQUAL);
  53123. y = t
  53124. }
  53125. }
  53126. ,
  53127. this.setDepthTest = function(t) {
  53128. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53129. }
  53130. ,
  53131. this.setDepthWrite = function(t) {
  53132. C !== t && (e.depthMask(t),
  53133. C = t)
  53134. }
  53135. ,
  53136. this.setColorWrite = function(t) {
  53137. I !== t && (e.colorMask(t, t, t, t),
  53138. I = t)
  53139. }
  53140. ,
  53141. this.setStencilFunc = function(t, i, n) {
  53142. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53143. b = t,
  53144. w = i,
  53145. _ = n)
  53146. }
  53147. ,
  53148. this.setStencilOp = function(t, i, n) {
  53149. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53150. T = t,
  53151. x = i,
  53152. S = n)
  53153. }
  53154. ,
  53155. this.setStencilTest = function(t) {
  53156. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53157. }
  53158. ,
  53159. this.setStencilWrite = function(t) {
  53160. E !== t && (e.stencilMask(t),
  53161. E = t)
  53162. }
  53163. ,
  53164. this.setFlipSided = function(t) {
  53165. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53166. M = t)
  53167. }
  53168. ,
  53169. this.setLineWidth = function(t) {
  53170. t !== R && (e.lineWidth(t),
  53171. R = t)
  53172. }
  53173. ,
  53174. this.setPolygonOffset = function(t, i, n) {
  53175. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53176. !t || P === i && O === n || (e.polygonOffset(i, n),
  53177. P = i,
  53178. O = n)
  53179. }
  53180. ,
  53181. this.getScissorTest = function() {
  53182. return L
  53183. }
  53184. ,
  53185. this.setScissorTest = function(t) {
  53186. L = t,
  53187. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53188. }
  53189. ,
  53190. this.activeTexture = function(t) {
  53191. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53192. N !== t && (e.activeTexture(t),
  53193. N = t)
  53194. }
  53195. ,
  53196. this.bindTexture = function(t, i) {
  53197. void 0 === N && r.activeTexture();
  53198. var n = B[N];
  53199. void 0 === n && (n = {
  53200. type: void 0,
  53201. texture: void 0
  53202. },
  53203. B[N] = n),
  53204. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53205. n.type = t,
  53206. n.texture = i)
  53207. }
  53208. ,
  53209. this.compressedTexImage2D = function() {
  53210. try {
  53211. e.compressedTexImage2D.apply(e, arguments)
  53212. } catch (e) {
  53213. console.error(e)
  53214. }
  53215. }
  53216. ,
  53217. this.texImage2D = function() {
  53218. try {
  53219. e.texImage2D.apply(e, arguments)
  53220. } catch (e) {
  53221. console.error(e)
  53222. }
  53223. }
  53224. ,
  53225. this.clearColor = function(t, i, n, r) {
  53226. o.set(t, i, n, r),
  53227. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53228. F.copy(o))
  53229. }
  53230. ,
  53231. this.clearDepth = function(t) {
  53232. V !== t && (e.clearDepth(t),
  53233. V = t)
  53234. }
  53235. ,
  53236. this.clearStencil = function(t) {
  53237. U !== t && (e.clearStencil(t),
  53238. U = t)
  53239. }
  53240. ,
  53241. this.scissor = function(t) {
  53242. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53243. k.copy(t))
  53244. }
  53245. ,
  53246. this.viewport = function(t) {
  53247. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53248. H.copy(t))
  53249. }
  53250. ,
  53251. this.reset = function() {
  53252. for (var t = 0; t < s.length; t++)
  53253. 1 === s[t] && (e.disableVertexAttribArray(t),
  53254. s[t] = 0);
  53255. c = {},
  53256. h = null,
  53257. N = void 0,
  53258. B = {},
  53259. u = null,
  53260. I = null,
  53261. C = null,
  53262. E = null,
  53263. M = null
  53264. }
  53265. }
  53266. ,
  53267. n.LensFlarePlugin = function(e, t) {
  53268. function i() {
  53269. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53270. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53271. o = p.createBuffer(),
  53272. a = p.createBuffer(),
  53273. p.bindBuffer(p.ARRAY_BUFFER, o),
  53274. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53275. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53276. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53277. u = p.createTexture(),
  53278. d = p.createTexture(),
  53279. f.bindTexture(p.TEXTURE_2D, u),
  53280. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53281. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53282. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53283. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53284. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53285. f.bindTexture(p.TEXTURE_2D, d),
  53286. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53287. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53288. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53289. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53290. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53291. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53292. var i;
  53293. i = h ? {
  53294. 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"),
  53295. 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")
  53296. } : {
  53297. 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"),
  53298. 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")
  53299. },
  53300. s = r(i),
  53301. l = {
  53302. vertex: p.getAttribLocation(s, "position"),
  53303. uv: p.getAttribLocation(s, "uv")
  53304. },
  53305. c = {
  53306. renderType: p.getUniformLocation(s, "renderType"),
  53307. map: p.getUniformLocation(s, "map"),
  53308. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53309. opacity: p.getUniformLocation(s, "opacity"),
  53310. color: p.getUniformLocation(s, "color"),
  53311. scale: p.getUniformLocation(s, "scale"),
  53312. rotation: p.getUniformLocation(s, "rotation"),
  53313. screenPosition: p.getUniformLocation(s, "screenPosition")
  53314. }
  53315. }
  53316. function r(t) {
  53317. var i = p.createProgram()
  53318. , n = p.createShader(p.FRAGMENT_SHADER)
  53319. , r = p.createShader(p.VERTEX_SHADER)
  53320. , o = "precision " + e.getPrecision() + " float;\n";
  53321. return p.shaderSource(n, o + t.fragmentShader),
  53322. p.shaderSource(r, o + t.vertexShader),
  53323. p.compileShader(n),
  53324. p.compileShader(r),
  53325. p.attachShader(i, n),
  53326. p.attachShader(i, r),
  53327. p.linkProgram(i),
  53328. i
  53329. }
  53330. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53331. this.render = function(r, g, m) {
  53332. if (0 !== t.length) {
  53333. var v = new n.Vector3
  53334. , A = m.w / m.z
  53335. , y = .5 * m.z
  53336. , C = .5 * m.w
  53337. , I = 16 / m.w
  53338. , E = new n.Vector2(I * A,I)
  53339. , b = new n.Vector3(1,1,0)
  53340. , w = new n.Vector2(1,1);
  53341. void 0 === s && i(),
  53342. p.useProgram(s),
  53343. f.initAttributes(),
  53344. f.enableAttribute(l.vertex),
  53345. f.enableAttribute(l.uv),
  53346. f.disableUnusedAttributes(),
  53347. p.uniform1i(c.occlusionMap, 0),
  53348. p.uniform1i(c.map, 1),
  53349. p.bindBuffer(p.ARRAY_BUFFER, o),
  53350. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53351. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53352. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53353. f.disable(p.CULL_FACE),
  53354. f.setDepthWrite(!1);
  53355. for (var _ = 0, T = t.length; _ < T; _++) {
  53356. I = 16 / m.w,
  53357. E.set(I * A, I);
  53358. var x = t[_];
  53359. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53360. v.applyMatrix4(g.matrixWorldInverse),
  53361. v.applyProjection(g.projectionMatrix),
  53362. b.copy(v),
  53363. w.x = b.x * y + y,
  53364. w.y = b.y * C + C,
  53365. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53366. f.activeTexture(p.TEXTURE0),
  53367. f.bindTexture(p.TEXTURE_2D, null),
  53368. f.activeTexture(p.TEXTURE1),
  53369. f.bindTexture(p.TEXTURE_2D, u),
  53370. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53371. p.uniform1i(c.renderType, 0),
  53372. p.uniform2f(c.scale, E.x, E.y),
  53373. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53374. f.disable(p.BLEND),
  53375. f.enable(p.DEPTH_TEST),
  53376. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53377. f.activeTexture(p.TEXTURE0),
  53378. f.bindTexture(p.TEXTURE_2D, d),
  53379. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53380. p.uniform1i(c.renderType, 1),
  53381. f.disable(p.DEPTH_TEST),
  53382. f.activeTexture(p.TEXTURE1),
  53383. f.bindTexture(p.TEXTURE_2D, u),
  53384. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53385. x.positionScreen.copy(b),
  53386. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53387. p.uniform1i(c.renderType, 2),
  53388. f.enable(p.BLEND);
  53389. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53390. var R = x.lensFlares[S];
  53391. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53392. b.y = R.y,
  53393. b.z = R.z,
  53394. I = R.size * R.scale / m.w,
  53395. E.x = I * A,
  53396. E.y = I,
  53397. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53398. p.uniform2f(c.scale, E.x, E.y),
  53399. p.uniform1f(c.rotation, R.rotation),
  53400. p.uniform1f(c.opacity, R.opacity),
  53401. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53402. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53403. e.setTexture(R.texture, 1),
  53404. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53405. }
  53406. }
  53407. }
  53408. f.enable(p.CULL_FACE),
  53409. f.enable(p.DEPTH_TEST),
  53410. f.setDepthWrite(!0),
  53411. e.resetGLState()
  53412. }
  53413. }
  53414. }
  53415. ,
  53416. n.SpritePlugin = function(e, t) {
  53417. function i() {
  53418. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53419. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53420. a = d.createBuffer(),
  53421. s = d.createBuffer(),
  53422. d.bindBuffer(d.ARRAY_BUFFER, a),
  53423. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53424. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53425. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53426. l = r(),
  53427. c = {
  53428. position: d.getAttribLocation(l, "position"),
  53429. uv: d.getAttribLocation(l, "uv")
  53430. },
  53431. h = {
  53432. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53433. uvScale: d.getUniformLocation(l, "uvScale"),
  53434. rotation: d.getUniformLocation(l, "rotation"),
  53435. scale: d.getUniformLocation(l, "scale"),
  53436. color: d.getUniformLocation(l, "color"),
  53437. map: d.getUniformLocation(l, "map"),
  53438. opacity: d.getUniformLocation(l, "opacity"),
  53439. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53440. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53441. fogType: d.getUniformLocation(l, "fogType"),
  53442. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53443. fogNear: d.getUniformLocation(l, "fogNear"),
  53444. fogFar: d.getUniformLocation(l, "fogFar"),
  53445. fogColor: d.getUniformLocation(l, "fogColor"),
  53446. alphaTest: d.getUniformLocation(l, "alphaTest")
  53447. };
  53448. var i = document.createElement("canvas");
  53449. i.width = 8,
  53450. i.height = 8;
  53451. var o = i.getContext("2d");
  53452. o.fillStyle = "white",
  53453. o.fillRect(0, 0, 8, 8),
  53454. u = new n.Texture(i),
  53455. u.needsUpdate = !0
  53456. }
  53457. function r() {
  53458. var t = d.createProgram()
  53459. , i = d.createShader(d.VERTEX_SHADER)
  53460. , n = d.createShader(d.FRAGMENT_SHADER);
  53461. return d.shaderSource(i, ["precision " + e.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")),
  53462. d.shaderSource(n, ["precision " + e.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")),
  53463. d.compileShader(i),
  53464. d.compileShader(n),
  53465. d.attachShader(t, i),
  53466. d.attachShader(t, n),
  53467. d.linkProgram(t),
  53468. t
  53469. }
  53470. function o(e, t) {
  53471. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  53472. }
  53473. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  53474. this.render = function(r, v) {
  53475. if (0 !== t.length) {
  53476. void 0 === l && i(),
  53477. d.useProgram(l),
  53478. p.initAttributes(),
  53479. p.enableAttribute(c.position),
  53480. p.enableAttribute(c.uv),
  53481. p.disableUnusedAttributes(),
  53482. p.disable(d.CULL_FACE),
  53483. p.enable(d.BLEND),
  53484. d.bindBuffer(d.ARRAY_BUFFER, a),
  53485. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  53486. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  53487. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53488. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  53489. p.activeTexture(d.TEXTURE0),
  53490. d.uniform1i(h.map, 0);
  53491. var A = 0
  53492. , y = 0
  53493. , C = r.fog;
  53494. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  53495. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  53496. d.uniform1f(h.fogFar, C.far),
  53497. d.uniform1i(h.fogType, 1),
  53498. A = 1,
  53499. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  53500. d.uniform1i(h.fogType, 2),
  53501. A = 2,
  53502. y = 2)) : (d.uniform1i(h.fogType, 0),
  53503. A = 0,
  53504. y = 0);
  53505. for (var I = 0, E = t.length; I < E; I++) {
  53506. var b = t[I];
  53507. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  53508. b.z = -b.modelViewMatrix.elements[14]
  53509. }
  53510. t.sort(o);
  53511. for (var w = [], I = 0, E = t.length; I < E; I++) {
  53512. var b = t[I]
  53513. , _ = b.material;
  53514. d.uniform1f(h.alphaTest, _.alphaTest),
  53515. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  53516. b.matrixWorld.decompose(f, g, m),
  53517. w[0] = m.x,
  53518. w[1] = m.y;
  53519. var T = 0;
  53520. r.fog && _.fog && (T = y),
  53521. A !== T && (d.uniform1i(h.fogType, T),
  53522. A = T),
  53523. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  53524. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  53525. d.uniform2f(h.uvScale, 1, 1)),
  53526. d.uniform1f(h.opacity, _.opacity),
  53527. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  53528. d.uniform1f(h.rotation, _.rotation),
  53529. d.uniform2fv(h.scale, w),
  53530. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  53531. p.setDepthTest(_.depthTest),
  53532. p.setDepthWrite(_.depthWrite),
  53533. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  53534. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  53535. }
  53536. p.enable(d.CULL_FACE),
  53537. e.resetGLState()
  53538. }
  53539. }
  53540. }
  53541. ,
  53542. Object.defineProperties(n.Box2.prototype, {
  53543. empty: {
  53544. value: function() {
  53545. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  53546. this.isEmpty()
  53547. }
  53548. },
  53549. isIntersectionBox: {
  53550. value: function(e) {
  53551. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53552. this.intersectsBox(e)
  53553. }
  53554. }
  53555. }),
  53556. Object.defineProperties(n.Box3.prototype, {
  53557. empty: {
  53558. value: function() {
  53559. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  53560. this.isEmpty()
  53561. }
  53562. },
  53563. isIntersectionBox: {
  53564. value: function(e) {
  53565. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53566. this.intersectsBox(e)
  53567. }
  53568. },
  53569. isIntersectionSphere: {
  53570. value: function(e) {
  53571. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53572. this.intersectsSphere(e)
  53573. }
  53574. }
  53575. }),
  53576. Object.defineProperties(n.Matrix3.prototype, {
  53577. multiplyVector3: {
  53578. value: function(e) {
  53579. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  53580. e.applyMatrix3(this)
  53581. }
  53582. },
  53583. multiplyVector3Array: {
  53584. value: function(e) {
  53585. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53586. this.applyToVector3Array(e)
  53587. }
  53588. }
  53589. }),
  53590. Object.defineProperties(n.Matrix4.prototype, {
  53591. extractPosition: {
  53592. value: function(e) {
  53593. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  53594. this.copyPosition(e)
  53595. }
  53596. },
  53597. setRotationFromQuaternion: {
  53598. value: function(e) {
  53599. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  53600. this.makeRotationFromQuaternion(e)
  53601. }
  53602. },
  53603. multiplyVector3: {
  53604. value: function(e) {
  53605. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  53606. e.applyProjection(this)
  53607. }
  53608. },
  53609. multiplyVector4: {
  53610. value: function(e) {
  53611. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53612. e.applyMatrix4(this)
  53613. }
  53614. },
  53615. multiplyVector3Array: {
  53616. value: function(e) {
  53617. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53618. this.applyToVector3Array(e)
  53619. }
  53620. },
  53621. rotateAxis: {
  53622. value: function(e) {
  53623. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  53624. e.transformDirection(this)
  53625. }
  53626. },
  53627. crossVector: {
  53628. value: function(e) {
  53629. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53630. e.applyMatrix4(this)
  53631. }
  53632. },
  53633. translate: {
  53634. value: function(e) {
  53635. console.error("THREE.Matrix4: .translate() has been removed.")
  53636. }
  53637. },
  53638. rotateX: {
  53639. value: function(e) {
  53640. console.error("THREE.Matrix4: .rotateX() has been removed.")
  53641. }
  53642. },
  53643. rotateY: {
  53644. value: function(e) {
  53645. console.error("THREE.Matrix4: .rotateY() has been removed.")
  53646. }
  53647. },
  53648. rotateZ: {
  53649. value: function(e) {
  53650. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  53651. }
  53652. },
  53653. rotateByAxis: {
  53654. value: function(e, t) {
  53655. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  53656. }
  53657. }
  53658. }),
  53659. Object.defineProperties(n.Plane.prototype, {
  53660. isIntersectionLine: {
  53661. value: function(e) {
  53662. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  53663. this.intersectsLine(e)
  53664. }
  53665. }
  53666. }),
  53667. Object.defineProperties(n.Quaternion.prototype, {
  53668. multiplyVector3: {
  53669. value: function(e) {
  53670. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  53671. e.applyQuaternion(this)
  53672. }
  53673. }
  53674. }),
  53675. Object.defineProperties(n.Ray.prototype, {
  53676. isIntersectionBox: {
  53677. value: function(e) {
  53678. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53679. this.intersectsBox(e)
  53680. }
  53681. },
  53682. isIntersectionPlane: {
  53683. value: function(e) {
  53684. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  53685. this.intersectsPlane(e)
  53686. }
  53687. },
  53688. isIntersectionSphere: {
  53689. value: function(e) {
  53690. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53691. this.intersectsSphere(e)
  53692. }
  53693. }
  53694. }),
  53695. Object.defineProperties(n.Vector3.prototype, {
  53696. setEulerFromRotationMatrix: {
  53697. value: function() {
  53698. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  53699. }
  53700. },
  53701. setEulerFromQuaternion: {
  53702. value: function() {
  53703. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  53704. }
  53705. },
  53706. getPositionFromMatrix: {
  53707. value: function(e) {
  53708. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  53709. this.setFromMatrixPosition(e)
  53710. }
  53711. },
  53712. getScaleFromMatrix: {
  53713. value: function(e) {
  53714. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  53715. this.setFromMatrixScale(e)
  53716. }
  53717. },
  53718. getColumnFromMatrix: {
  53719. value: function(e, t) {
  53720. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  53721. this.setFromMatrixColumn(e, t)
  53722. }
  53723. }
  53724. }),
  53725. n.Face4 = function(e, t, i, r, o, a, s) {
  53726. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  53727. new n.Face3(e,t,i,o,a,s)
  53728. }
  53729. ,
  53730. n.Vertex = function(e, t, i) {
  53731. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  53732. new n.Vector3(e,t,i)
  53733. }
  53734. ,
  53735. Object.defineProperties(n.Object3D.prototype, {
  53736. eulerOrder: {
  53737. get: function() {
  53738. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53739. this.rotation.order
  53740. },
  53741. set: function(e) {
  53742. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53743. this.rotation.order = e
  53744. }
  53745. },
  53746. getChildByName: {
  53747. value: function(e) {
  53748. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  53749. this.getObjectByName(e)
  53750. }
  53751. },
  53752. renderDepth: {
  53753. set: function(e) {
  53754. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  53755. }
  53756. },
  53757. translate: {
  53758. value: function(e, t) {
  53759. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  53760. this.translateOnAxis(t, e)
  53761. }
  53762. },
  53763. useQuaternion: {
  53764. get: function() {
  53765. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53766. },
  53767. set: function(e) {
  53768. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53769. }
  53770. }
  53771. }),
  53772. Object.defineProperties(n, {
  53773. PointCloud: {
  53774. value: function(e, t) {
  53775. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  53776. new n.Points(e,t)
  53777. }
  53778. },
  53779. ParticleSystem: {
  53780. value: function(e, t) {
  53781. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  53782. new n.Points(e,t)
  53783. }
  53784. }
  53785. }),
  53786. Object.defineProperties(n.Light.prototype, {
  53787. onlyShadow: {
  53788. set: function(e) {
  53789. console.warn("THREE.Light: .onlyShadow has been removed.")
  53790. }
  53791. },
  53792. shadowCameraFov: {
  53793. set: function(e) {
  53794. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  53795. this.shadow.camera.fov = e
  53796. }
  53797. },
  53798. shadowCameraLeft: {
  53799. set: function(e) {
  53800. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  53801. this.shadow.camera.left = e
  53802. }
  53803. },
  53804. shadowCameraRight: {
  53805. set: function(e) {
  53806. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  53807. this.shadow.camera.right = e
  53808. }
  53809. },
  53810. shadowCameraTop: {
  53811. set: function(e) {
  53812. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  53813. this.shadow.camera.top = e
  53814. }
  53815. },
  53816. shadowCameraBottom: {
  53817. set: function(e) {
  53818. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  53819. this.shadow.camera.bottom = e
  53820. }
  53821. },
  53822. shadowCameraNear: {
  53823. set: function(e) {
  53824. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  53825. this.shadow.camera.near = e
  53826. }
  53827. },
  53828. shadowCameraFar: {
  53829. set: function(e) {
  53830. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  53831. this.shadow.camera.far = e
  53832. }
  53833. },
  53834. shadowCameraVisible: {
  53835. set: function(e) {
  53836. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  53837. }
  53838. },
  53839. shadowBias: {
  53840. set: function(e) {
  53841. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  53842. this.shadow.bias = e
  53843. }
  53844. },
  53845. shadowDarkness: {
  53846. set: function(e) {
  53847. console.warn("THREE.Light: .shadowDarkness has been removed.")
  53848. }
  53849. },
  53850. shadowMapWidth: {
  53851. set: function(e) {
  53852. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  53853. this.shadow.mapSize.width = e
  53854. }
  53855. },
  53856. shadowMapHeight: {
  53857. set: function(e) {
  53858. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  53859. this.shadow.mapSize.height = e
  53860. }
  53861. }
  53862. }),
  53863. Object.defineProperties(n.BufferAttribute.prototype, {
  53864. length: {
  53865. get: function() {
  53866. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  53867. this.array.length
  53868. }
  53869. }
  53870. }),
  53871. Object.defineProperties(n.BufferGeometry.prototype, {
  53872. drawcalls: {
  53873. get: function() {
  53874. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  53875. this.groups
  53876. }
  53877. },
  53878. offsets: {
  53879. get: function() {
  53880. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  53881. this.groups
  53882. }
  53883. },
  53884. addIndex: {
  53885. value: function(e) {
  53886. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  53887. this.setIndex(e)
  53888. }
  53889. },
  53890. addDrawCall: {
  53891. value: function(e, t, i) {
  53892. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  53893. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  53894. this.addGroup(e, t)
  53895. }
  53896. },
  53897. clearDrawCalls: {
  53898. value: function() {
  53899. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  53900. this.clearGroups()
  53901. }
  53902. },
  53903. computeTangents: {
  53904. value: function() {
  53905. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  53906. }
  53907. },
  53908. computeOffsets: {
  53909. value: function() {
  53910. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  53911. }
  53912. }
  53913. }),
  53914. Object.defineProperties(n.Material.prototype, {
  53915. wrapAround: {
  53916. get: function() {
  53917. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53918. },
  53919. set: function(e) {
  53920. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53921. }
  53922. },
  53923. wrapRGB: {
  53924. get: function() {
  53925. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  53926. new n.Color
  53927. }
  53928. }
  53929. }),
  53930. Object.defineProperties(n, {
  53931. PointCloudMaterial: {
  53932. value: function(e) {
  53933. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  53934. new n.PointsMaterial(e)
  53935. }
  53936. },
  53937. ParticleBasicMaterial: {
  53938. value: function(e) {
  53939. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  53940. new n.PointsMaterial(e)
  53941. }
  53942. },
  53943. ParticleSystemMaterial: {
  53944. value: function(e) {
  53945. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  53946. new n.PointsMaterial(e)
  53947. }
  53948. }
  53949. }),
  53950. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  53951. metal: {
  53952. get: function() {
  53953. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  53954. !1
  53955. },
  53956. set: function(e) {
  53957. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  53958. }
  53959. }
  53960. }),
  53961. Object.defineProperties(n.ShaderMaterial.prototype, {
  53962. derivatives: {
  53963. get: function() {
  53964. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53965. this.extensions.derivatives
  53966. },
  53967. set: function(e) {
  53968. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53969. this.extensions.derivatives = e
  53970. }
  53971. }
  53972. }),
  53973. Object.defineProperties(n.WebGLRenderer.prototype, {
  53974. supportsFloatTextures: {
  53975. value: function() {
  53976. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  53977. this.extensions.get("OES_texture_float")
  53978. }
  53979. },
  53980. supportsHalfFloatTextures: {
  53981. value: function() {
  53982. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  53983. this.extensions.get("OES_texture_half_float")
  53984. }
  53985. },
  53986. supportsStandardDerivatives: {
  53987. value: function() {
  53988. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  53989. this.extensions.get("OES_standard_derivatives")
  53990. }
  53991. },
  53992. supportsCompressedTextureS3TC: {
  53993. value: function() {
  53994. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  53995. this.extensions.get("WEBGL_compressed_texture_s3tc")
  53996. }
  53997. },
  53998. supportsCompressedTexturePVRTC: {
  53999. value: function() {
  54000. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54001. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54002. }
  54003. },
  54004. supportsBlendMinMax: {
  54005. value: function() {
  54006. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54007. this.extensions.get("EXT_blend_minmax")
  54008. }
  54009. },
  54010. supportsVertexTextures: {
  54011. value: function() {
  54012. return this.capabilities.vertexTextures
  54013. }
  54014. },
  54015. supportsInstancedArrays: {
  54016. value: function() {
  54017. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54018. this.extensions.get("ANGLE_instanced_arrays")
  54019. }
  54020. },
  54021. enableScissorTest: {
  54022. value: function(e) {
  54023. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54024. this.setScissorTest(e)
  54025. }
  54026. },
  54027. initMaterial: {
  54028. value: function() {
  54029. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54030. }
  54031. },
  54032. addPrePlugin: {
  54033. value: function() {
  54034. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54035. }
  54036. },
  54037. addPostPlugin: {
  54038. value: function() {
  54039. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54040. }
  54041. },
  54042. updateShadowMap: {
  54043. value: function() {
  54044. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54045. }
  54046. },
  54047. shadowMapEnabled: {
  54048. get: function() {
  54049. return this.shadowMap.enabled
  54050. },
  54051. set: function(e) {
  54052. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54053. this.shadowMap.enabled = e
  54054. }
  54055. },
  54056. shadowMapType: {
  54057. get: function() {
  54058. return this.shadowMap.type
  54059. },
  54060. set: function(e) {
  54061. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54062. this.shadowMap.type = e
  54063. }
  54064. },
  54065. shadowMapCullFace: {
  54066. get: function() {
  54067. return this.shadowMap.cullFace
  54068. },
  54069. set: function(e) {
  54070. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54071. this.shadowMap.cullFace = e
  54072. }
  54073. }
  54074. }),
  54075. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54076. wrapS: {
  54077. get: function() {
  54078. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54079. this.texture.wrapS
  54080. },
  54081. set: function(e) {
  54082. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54083. this.texture.wrapS = e
  54084. }
  54085. },
  54086. wrapT: {
  54087. get: function() {
  54088. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54089. this.texture.wrapT
  54090. },
  54091. set: function(e) {
  54092. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54093. this.texture.wrapT = e
  54094. }
  54095. },
  54096. magFilter: {
  54097. get: function() {
  54098. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54099. this.texture.magFilter
  54100. },
  54101. set: function(e) {
  54102. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54103. this.texture.magFilter = e
  54104. }
  54105. },
  54106. minFilter: {
  54107. get: function() {
  54108. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54109. this.texture.minFilter
  54110. },
  54111. set: function(e) {
  54112. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54113. this.texture.minFilter = e
  54114. }
  54115. },
  54116. anisotropy: {
  54117. get: function() {
  54118. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54119. this.texture.anisotropy
  54120. },
  54121. set: function(e) {
  54122. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54123. this.texture.anisotropy = e
  54124. }
  54125. },
  54126. offset: {
  54127. get: function() {
  54128. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54129. this.texture.offset
  54130. },
  54131. set: function(e) {
  54132. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54133. this.texture.offset = e
  54134. }
  54135. },
  54136. repeat: {
  54137. get: function() {
  54138. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54139. this.texture.repeat
  54140. },
  54141. set: function(e) {
  54142. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54143. this.texture.repeat = e
  54144. }
  54145. },
  54146. format: {
  54147. get: function() {
  54148. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54149. this.texture.format
  54150. },
  54151. set: function(e) {
  54152. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54153. this.texture.format = e
  54154. }
  54155. },
  54156. type: {
  54157. get: function() {
  54158. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54159. this.texture.type
  54160. },
  54161. set: function(e) {
  54162. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54163. this.texture.type = e
  54164. }
  54165. },
  54166. generateMipmaps: {
  54167. get: function() {
  54168. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54169. this.texture.generateMipmaps
  54170. },
  54171. set: function(e) {
  54172. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54173. this.texture.generateMipmaps = e
  54174. }
  54175. }
  54176. }),
  54177. n.GeometryUtils = {
  54178. merge: function(e, t, i) {
  54179. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54180. var r;
  54181. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54182. r = t.matrix,
  54183. t = t.geometry),
  54184. e.merge(t, r, i)
  54185. },
  54186. center: function(e) {
  54187. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54188. e.center()
  54189. }
  54190. },
  54191. n.ImageUtils = {
  54192. crossOrigin: void 0,
  54193. loadTexture: function(e, t, i, r) {
  54194. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54195. var o = new n.TextureLoader;
  54196. o.setCrossOrigin(this.crossOrigin);
  54197. var a = o.load(e, i, void 0, r);
  54198. return t && (a.mapping = t),
  54199. a
  54200. },
  54201. loadTextureCube: function(e, t, i, r) {
  54202. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54203. var o = new n.CubeTextureLoader;
  54204. o.setCrossOrigin(this.crossOrigin);
  54205. var a = o.load(e, i, void 0, r);
  54206. return t && (a.mapping = t),
  54207. a
  54208. },
  54209. loadCompressedTexture: function() {
  54210. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54211. },
  54212. loadCompressedTextureCube: function() {
  54213. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54214. }
  54215. },
  54216. n.Projector = function() {
  54217. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54218. this.projectVector = function(e, t) {
  54219. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54220. e.project(t)
  54221. }
  54222. ,
  54223. this.unprojectVector = function(e, t) {
  54224. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54225. e.unproject(t)
  54226. }
  54227. ,
  54228. this.pickingRay = function(e, t) {
  54229. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54230. }
  54231. }
  54232. ,
  54233. n.CanvasRenderer = function() {
  54234. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54235. this.domElement = document.createElement("canvas"),
  54236. this.clear = function() {}
  54237. ,
  54238. this.render = function() {}
  54239. ,
  54240. this.setClearColor = function() {}
  54241. ,
  54242. this.setSize = function() {}
  54243. }
  54244. ,
  54245. n.MeshFaceMaterial = n.MultiMaterial,
  54246. n.CurveUtils = {
  54247. tangentQuadraticBezier: function(e, t, i, n) {
  54248. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54249. },
  54250. tangentCubicBezier: function(e, t, i, n, r) {
  54251. 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
  54252. },
  54253. tangentSpline: function(e, t, i, n, r) {
  54254. var o = 6 * e * e - 6 * e
  54255. , a = 3 * e * e - 4 * e + 1
  54256. , s = -6 * e * e + 6 * e
  54257. , l = 3 * e * e - 2 * e;
  54258. return o + a + s + l
  54259. },
  54260. interpolate: function(e, t, i, n, r) {
  54261. var o = .5 * (i - e)
  54262. , a = .5 * (n - t)
  54263. , s = r * r
  54264. , l = r * s;
  54265. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54266. }
  54267. },
  54268. n.SceneUtils = {
  54269. createMultiMaterialObject: function(e, t) {
  54270. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54271. i.add(new n.Mesh(e,t[r]));
  54272. return i
  54273. },
  54274. detach: function(e, t, i) {
  54275. e.applyMatrix(t.matrixWorld),
  54276. t.remove(e),
  54277. i.add(e)
  54278. },
  54279. attach: function(e, t, i) {
  54280. var r = new n.Matrix4;
  54281. r.getInverse(i.matrixWorld),
  54282. e.applyMatrix(r),
  54283. t.remove(e),
  54284. i.add(e)
  54285. }
  54286. },
  54287. n.ShapeUtils = {
  54288. area: function(e) {
  54289. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54290. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54291. return .5 * i
  54292. },
  54293. triangulate: function() {
  54294. function e(e, t, i, n, r, o) {
  54295. var a, s, l, c, h, u, d, p, f;
  54296. if (s = e[o[t]].x,
  54297. l = e[o[t]].y,
  54298. c = e[o[i]].x,
  54299. h = e[o[i]].y,
  54300. u = e[o[n]].x,
  54301. d = e[o[n]].y,
  54302. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54303. return !1;
  54304. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54305. for (g = u - c,
  54306. m = d - h,
  54307. v = s - u,
  54308. A = l - d,
  54309. y = c - s,
  54310. C = h - l,
  54311. a = 0; a < r; a++)
  54312. if (p = e[o[a]].x,
  54313. f = e[o[a]].y,
  54314. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54315. E = f - l,
  54316. b = p - c,
  54317. w = f - h,
  54318. _ = p - u,
  54319. T = f - d,
  54320. M = g * w - m * b,
  54321. x = y * E - C * I,
  54322. S = v * T - A * _,
  54323. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54324. return !1;
  54325. return !0
  54326. }
  54327. return function(t, i) {
  54328. var r = t.length;
  54329. if (r < 3)
  54330. return null;
  54331. var o, a, s, l = [], c = [], h = [];
  54332. if (n.ShapeUtils.area(t) > 0)
  54333. for (a = 0; a < r; a++)
  54334. c[a] = a;
  54335. else
  54336. for (a = 0; a < r; a++)
  54337. c[a] = r - 1 - a;
  54338. var u = r
  54339. , d = 2 * u;
  54340. for (a = u - 1; u > 2; ) {
  54341. if (d-- <= 0)
  54342. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54343. i ? h : l;
  54344. if (o = a,
  54345. u <= o && (o = 0),
  54346. a = o + 1,
  54347. u <= a && (a = 0),
  54348. s = a + 1,
  54349. u <= s && (s = 0),
  54350. e(t, o, a, s, u, c)) {
  54351. var p, f, g, m, v;
  54352. for (p = c[o],
  54353. f = c[a],
  54354. g = c[s],
  54355. l.push([t[p], t[f], t[g]]),
  54356. h.push([c[o], c[a], c[s]]),
  54357. m = a,
  54358. v = a + 1; v < u; m++,
  54359. v++)
  54360. c[m] = c[v];
  54361. u--,
  54362. d = 2 * u
  54363. }
  54364. }
  54365. return i ? h : l
  54366. }
  54367. }(),
  54368. triangulateShape: function(e, t) {
  54369. function i(e, t, i) {
  54370. 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
  54371. }
  54372. function r(e, t, n, r, o) {
  54373. var a = t.x - e.x
  54374. , s = t.y - e.y
  54375. , l = r.x - n.x
  54376. , c = r.y - n.y
  54377. , h = e.x - n.x
  54378. , u = e.y - n.y
  54379. , d = s * l - a * c
  54380. , p = s * h - a * u;
  54381. if (Math.abs(d) > Number.EPSILON) {
  54382. var f;
  54383. if (d > 0) {
  54384. if (p < 0 || p > d)
  54385. return [];
  54386. if (f = c * h - l * u,
  54387. f < 0 || f > d)
  54388. return []
  54389. } else {
  54390. if (p > 0 || p < d)
  54391. return [];
  54392. if (f = c * h - l * u,
  54393. f > 0 || f < d)
  54394. return []
  54395. }
  54396. if (0 === f)
  54397. return !o || 0 !== p && p !== d ? [e] : [];
  54398. if (f === d)
  54399. return !o || 0 !== p && p !== d ? [t] : [];
  54400. if (0 === p)
  54401. return [n];
  54402. if (p === d)
  54403. return [r];
  54404. var g = f / d;
  54405. return [{
  54406. x: e.x + g * a,
  54407. y: e.y + g * s
  54408. }]
  54409. }
  54410. if (0 !== p || c * h !== l * u)
  54411. return [];
  54412. var m = 0 === a && 0 === s
  54413. , v = 0 === l && 0 === c;
  54414. if (m && v)
  54415. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54416. if (m)
  54417. return i(n, r, e) ? [e] : [];
  54418. if (v)
  54419. return i(e, t, n) ? [n] : [];
  54420. var A, y, C, I, E, b, w, _;
  54421. return 0 !== a ? (e.x < t.x ? (A = e,
  54422. C = e.x,
  54423. y = t,
  54424. I = t.x) : (A = t,
  54425. C = t.x,
  54426. y = e,
  54427. I = e.x),
  54428. n.x < r.x ? (E = n,
  54429. w = n.x,
  54430. b = r,
  54431. _ = r.x) : (E = r,
  54432. w = r.x,
  54433. b = n,
  54434. _ = n.x)) : (e.y < t.y ? (A = e,
  54435. C = e.y,
  54436. y = t,
  54437. I = t.y) : (A = t,
  54438. C = t.y,
  54439. y = e,
  54440. I = e.y),
  54441. n.y < r.y ? (E = n,
  54442. w = n.y,
  54443. b = r,
  54444. _ = r.y) : (E = r,
  54445. w = r.y,
  54446. b = n,
  54447. _ = n.y)),
  54448. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  54449. }
  54450. function o(e, t, i, n) {
  54451. var r = t.x - e.x
  54452. , o = t.y - e.y
  54453. , a = i.x - e.x
  54454. , s = i.y - e.y
  54455. , l = n.x - e.x
  54456. , c = n.y - e.y
  54457. , h = r * s - o * a
  54458. , u = r * c - o * l;
  54459. if (Math.abs(h) > Number.EPSILON) {
  54460. var d = l * s - c * a;
  54461. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  54462. }
  54463. return u > 0
  54464. }
  54465. function a(e, t) {
  54466. function i(e, t) {
  54467. var i = A.length - 1
  54468. , n = e - 1;
  54469. n < 0 && (n = i);
  54470. var r = e + 1;
  54471. r > i && (r = 0);
  54472. var a = o(A[e], A[n], A[r], s[t]);
  54473. if (!a)
  54474. return !1;
  54475. var l = s.length - 1
  54476. , c = t - 1;
  54477. c < 0 && (c = l);
  54478. var h = t + 1;
  54479. return h > l && (h = 0),
  54480. a = o(s[t], s[c], s[h], A[e]),
  54481. !!a
  54482. }
  54483. function n(e, t) {
  54484. var i, n, o;
  54485. for (i = 0; i < A.length; i++)
  54486. if (n = i + 1,
  54487. n %= A.length,
  54488. o = r(e, t, A[i], A[n], !0),
  54489. o.length > 0)
  54490. return !0;
  54491. return !1
  54492. }
  54493. function a(e, i) {
  54494. var n, o, a, s, l;
  54495. for (n = 0; n < y.length; n++)
  54496. for (o = t[y[n]],
  54497. a = 0; a < o.length; a++)
  54498. if (s = a + 1,
  54499. s %= o.length,
  54500. l = r(e, i, o[a], o[s], !0),
  54501. l.length > 0)
  54502. return !0;
  54503. return !1
  54504. }
  54505. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  54506. y.push(I);
  54507. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  54508. if (w--,
  54509. w < 0) {
  54510. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  54511. break
  54512. }
  54513. for (c = b; c < A.length; c++) {
  54514. h = A[c],
  54515. l = -1;
  54516. for (var I = 0; I < y.length; I++)
  54517. if (d = y[I],
  54518. p = h.x + ":" + h.y + ":" + d,
  54519. void 0 === C[p]) {
  54520. s = t[d];
  54521. for (var _ = 0; _ < s.length; _++)
  54522. if (u = s[_],
  54523. i(c, _) && !n(h, u) && !a(h, u)) {
  54524. l = _,
  54525. y.splice(I, 1),
  54526. f = A.slice(0, c + 1),
  54527. g = A.slice(c),
  54528. m = s.slice(l),
  54529. v = s.slice(0, l + 1),
  54530. A = f.concat(m).concat(v).concat(g),
  54531. b = c;
  54532. break
  54533. }
  54534. if (l >= 0)
  54535. break;
  54536. C[p] = !0
  54537. }
  54538. if (l >= 0)
  54539. break
  54540. }
  54541. }
  54542. return A
  54543. }
  54544. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  54545. Array.prototype.push.apply(f, t[g]);
  54546. for (s = 0,
  54547. l = f.length; s < l; s++)
  54548. u = f[s].x + ":" + f[s].y,
  54549. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  54550. p[u] = s;
  54551. var v = a(e, t)
  54552. , A = n.ShapeUtils.triangulate(v, !1);
  54553. for (s = 0,
  54554. l = A.length; s < l; s++)
  54555. for (h = A[s],
  54556. c = 0; c < 3; c++)
  54557. u = h[c].x + ":" + h[c].y,
  54558. d = p[u],
  54559. void 0 !== d && (h[c] = d);
  54560. return A.concat()
  54561. },
  54562. isClockWise: function(e) {
  54563. return n.ShapeUtils.area(e) < 0
  54564. },
  54565. b2: function() {
  54566. function e(e, t) {
  54567. var i = 1 - e;
  54568. return i * i * t
  54569. }
  54570. function t(e, t) {
  54571. return 2 * (1 - e) * e * t
  54572. }
  54573. function i(e, t) {
  54574. return e * e * t
  54575. }
  54576. return function(n, r, o, a) {
  54577. return e(n, r) + t(n, o) + i(n, a)
  54578. }
  54579. }(),
  54580. b3: function() {
  54581. function e(e, t) {
  54582. var i = 1 - e;
  54583. return i * i * i * t
  54584. }
  54585. function t(e, t) {
  54586. var i = 1 - e;
  54587. return 3 * i * i * e * t
  54588. }
  54589. function i(e, t) {
  54590. var i = 1 - e;
  54591. return 3 * i * e * e * t
  54592. }
  54593. function n(e, t) {
  54594. return e * e * e * t
  54595. }
  54596. return function(r, o, a, s, l) {
  54597. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  54598. }
  54599. }()
  54600. },
  54601. n.Curve = function() {}
  54602. ,
  54603. n.Curve.prototype = {
  54604. constructor: n.Curve,
  54605. getPoint: function(e) {
  54606. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  54607. null
  54608. },
  54609. getPointAt: function(e) {
  54610. var t = this.getUtoTmapping(e);
  54611. return this.getPoint(t)
  54612. },
  54613. getPoints: function(e) {
  54614. e || (e = 5);
  54615. var t, i = [];
  54616. for (t = 0; t <= e; t++)
  54617. i.push(this.getPoint(t / e));
  54618. return i
  54619. },
  54620. getSpacedPoints: function(e) {
  54621. e || (e = 5);
  54622. var t, i = [];
  54623. for (t = 0; t <= e; t++)
  54624. i.push(this.getPointAt(t / e));
  54625. return i
  54626. },
  54627. getLength: function() {
  54628. var e = this.getLengths();
  54629. return e[e.length - 1]
  54630. },
  54631. getLengths: function(e) {
  54632. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  54633. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  54634. return this.cacheArcLengths;
  54635. this.needsUpdate = !1;
  54636. var t, i, n = [], r = this.getPoint(0), o = 0;
  54637. for (n.push(0),
  54638. i = 1; i <= e; i++)
  54639. t = this.getPoint(i / e),
  54640. o += t.distanceTo(r),
  54641. n.push(o),
  54642. r = t;
  54643. return this.cacheArcLengths = n,
  54644. n
  54645. },
  54646. updateArcLengths: function() {
  54647. this.needsUpdate = !0,
  54648. this.getLengths()
  54649. },
  54650. getUtoTmapping: function(e, t) {
  54651. var i, n = this.getLengths(), r = 0, o = n.length;
  54652. i = t ? t : e * n[o - 1];
  54653. for (var a, s = 0, l = o - 1; s <= l; )
  54654. if (r = Math.floor(s + (l - s) / 2),
  54655. a = n[r] - i,
  54656. a < 0)
  54657. s = r + 1;
  54658. else {
  54659. if (!(a > 0)) {
  54660. l = r;
  54661. break
  54662. }
  54663. l = r - 1
  54664. }
  54665. if (r = l,
  54666. n[r] === i) {
  54667. var c = r / (o - 1);
  54668. return c
  54669. }
  54670. var h = n[r]
  54671. , u = n[r + 1]
  54672. , d = u - h
  54673. , p = (i - h) / d
  54674. , c = (r + p) / (o - 1);
  54675. return c
  54676. },
  54677. getTangent: function(e) {
  54678. var t = 1e-4
  54679. , i = e - t
  54680. , n = e + t;
  54681. i < 0 && (i = 0),
  54682. n > 1 && (n = 1);
  54683. var r = this.getPoint(i)
  54684. , o = this.getPoint(n)
  54685. , a = o.clone().sub(r);
  54686. return a.normalize()
  54687. },
  54688. getTangentAt: function(e) {
  54689. var t = this.getUtoTmapping(e);
  54690. return this.getTangent(t)
  54691. }
  54692. },
  54693. n.Curve.create = function(e, t) {
  54694. return e.prototype = Object.create(n.Curve.prototype),
  54695. e.prototype.constructor = e,
  54696. e.prototype.getPoint = t,
  54697. e
  54698. }
  54699. ,
  54700. n.CurvePath = function() {
  54701. this.curves = [],
  54702. this.autoClose = !1
  54703. }
  54704. ,
  54705. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  54706. n.CurvePath.prototype.constructor = n.CurvePath,
  54707. n.CurvePath.prototype.add = function(e) {
  54708. this.curves.push(e)
  54709. }
  54710. ,
  54711. n.CurvePath.prototype.closePath = function() {
  54712. var e = this.curves[0].getPoint(0)
  54713. , t = this.curves[this.curves.length - 1].getPoint(1);
  54714. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  54715. }
  54716. ,
  54717. n.CurvePath.prototype.getPoint = function(e) {
  54718. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  54719. if (i[n] >= t) {
  54720. var r = i[n] - t
  54721. , o = this.curves[n]
  54722. , a = 1 - r / o.getLength();
  54723. return o.getPointAt(a)
  54724. }
  54725. n++
  54726. }
  54727. return null
  54728. }
  54729. ,
  54730. n.CurvePath.prototype.getLength = function() {
  54731. var e = this.getCurveLengths();
  54732. return e[e.length - 1]
  54733. }
  54734. ,
  54735. n.CurvePath.prototype.getCurveLengths = function() {
  54736. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  54737. return this.cacheLengths;
  54738. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  54739. t += this.curves[i].getLength(),
  54740. e.push(t);
  54741. return this.cacheLengths = e,
  54742. e
  54743. }
  54744. ,
  54745. n.CurvePath.prototype.createPointsGeometry = function(e) {
  54746. var t = this.getPoints(e);
  54747. return this.createGeometry(t)
  54748. }
  54749. ,
  54750. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  54751. var t = this.getSpacedPoints(e);
  54752. return this.createGeometry(t)
  54753. }
  54754. ,
  54755. n.CurvePath.prototype.createGeometry = function(e) {
  54756. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  54757. var o = e[i];
  54758. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  54759. }
  54760. return t
  54761. }
  54762. ,
  54763. n.Font = function(e) {
  54764. this.data = e
  54765. }
  54766. ,
  54767. n.Font.prototype = {
  54768. constructor: n.Font,
  54769. generateShapes: function(e, t, i) {
  54770. function r(e) {
  54771. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  54772. var c = o(i[l], n, r);
  54773. r += c.offset,
  54774. s.push(c.path)
  54775. }
  54776. return s
  54777. }
  54778. function o(e, t, r) {
  54779. var o = a.glyphs[e] || a.glyphs["?"];
  54780. if (o) {
  54781. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  54782. if (o.o)
  54783. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  54784. var _ = E[b++];
  54785. switch (_) {
  54786. case "m":
  54787. s = E[b++] * t + r,
  54788. l = E[b++] * t,
  54789. A.moveTo(s, l);
  54790. break;
  54791. case "l":
  54792. s = E[b++] * t + r,
  54793. l = E[b++] * t,
  54794. A.lineTo(s, l);
  54795. break;
  54796. case "q":
  54797. if (c = E[b++] * t + r,
  54798. h = E[b++] * t,
  54799. p = E[b++] * t + r,
  54800. f = E[b++] * t,
  54801. A.quadraticCurveTo(p, f, c, h),
  54802. v = y[y.length - 1]) {
  54803. u = v.x,
  54804. d = v.y;
  54805. for (var T = 1; T <= i; T++) {
  54806. var x = T / i;
  54807. C(x, u, p, c),
  54808. C(x, d, f, h)
  54809. }
  54810. }
  54811. break;
  54812. case "b":
  54813. if (c = E[b++] * t + r,
  54814. h = E[b++] * t,
  54815. p = E[b++] * t + r,
  54816. f = E[b++] * t,
  54817. g = E[b++] * t + r,
  54818. m = E[b++] * t,
  54819. A.bezierCurveTo(p, f, g, m, c, h),
  54820. v = y[y.length - 1]) {
  54821. u = v.x,
  54822. d = v.y;
  54823. for (var T = 1; T <= i; T++) {
  54824. var x = T / i;
  54825. I(x, u, p, g, c),
  54826. I(x, d, f, m, h)
  54827. }
  54828. }
  54829. }
  54830. }
  54831. return {
  54832. offset: o.ha * t,
  54833. path: A
  54834. }
  54835. }
  54836. }
  54837. void 0 === t && (t = 100),
  54838. void 0 === i && (i = 4);
  54839. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  54840. Array.prototype.push.apply(l, s[c].toShapes());
  54841. return l
  54842. }
  54843. },
  54844. n.Path = function(e) {
  54845. n.CurvePath.call(this),
  54846. this.actions = [],
  54847. e && this.fromPoints(e)
  54848. }
  54849. ,
  54850. n.Path.prototype = Object.create(n.CurvePath.prototype),
  54851. n.Path.prototype.constructor = n.Path,
  54852. n.Path.prototype.fromPoints = function(e) {
  54853. this.moveTo(e[0].x, e[0].y);
  54854. for (var t = 1, i = e.length; t < i; t++)
  54855. this.lineTo(e[t].x, e[t].y)
  54856. }
  54857. ,
  54858. n.Path.prototype.moveTo = function(e, t) {
  54859. this.actions.push({
  54860. action: "moveTo",
  54861. args: [e, t]
  54862. })
  54863. }
  54864. ,
  54865. n.Path.prototype.lineTo = function(e, t) {
  54866. var i = this.actions[this.actions.length - 1].args
  54867. , r = i[i.length - 2]
  54868. , o = i[i.length - 1]
  54869. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  54870. this.curves.push(a),
  54871. this.actions.push({
  54872. action: "lineTo",
  54873. args: [e, t]
  54874. })
  54875. }
  54876. ,
  54877. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  54878. var o = this.actions[this.actions.length - 1].args
  54879. , a = o[o.length - 2]
  54880. , s = o[o.length - 1]
  54881. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  54882. this.curves.push(l),
  54883. this.actions.push({
  54884. action: "quadraticCurveTo",
  54885. args: [e, t, i, r]
  54886. })
  54887. }
  54888. ,
  54889. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  54890. var s = this.actions[this.actions.length - 1].args
  54891. , l = s[s.length - 2]
  54892. , c = s[s.length - 1]
  54893. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  54894. this.curves.push(h),
  54895. this.actions.push({
  54896. action: "bezierCurveTo",
  54897. args: [e, t, i, r, o, a]
  54898. })
  54899. }
  54900. ,
  54901. n.Path.prototype.splineThru = function(e) {
  54902. var t = Array.prototype.slice.call(arguments)
  54903. , i = this.actions[this.actions.length - 1].args
  54904. , r = i[i.length - 2]
  54905. , o = i[i.length - 1]
  54906. , a = [new n.Vector2(r,o)];
  54907. Array.prototype.push.apply(a, e);
  54908. var s = new n.SplineCurve(a);
  54909. this.curves.push(s),
  54910. this.actions.push({
  54911. action: "splineThru",
  54912. args: t
  54913. })
  54914. }
  54915. ,
  54916. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  54917. var a = this.actions[this.actions.length - 1].args
  54918. , s = a[a.length - 2]
  54919. , l = a[a.length - 1];
  54920. this.absarc(e + s, t + l, i, n, r, o)
  54921. }
  54922. ,
  54923. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  54924. this.absellipse(e, t, i, i, n, r, o)
  54925. }
  54926. ,
  54927. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  54928. var l = this.actions[this.actions.length - 1].args
  54929. , c = l[l.length - 2]
  54930. , h = l[l.length - 1];
  54931. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  54932. }
  54933. ,
  54934. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  54935. var c = [e, t, i, r, o, a, s, l || 0]
  54936. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  54937. this.curves.push(h);
  54938. var u = h.getPoint(1);
  54939. c.push(u.x),
  54940. c.push(u.y),
  54941. this.actions.push({
  54942. action: "ellipse",
  54943. args: c
  54944. })
  54945. }
  54946. ,
  54947. n.Path.prototype.getSpacedPoints = function(e) {
  54948. e || (e = 40);
  54949. for (var t = [], i = 0; i < e; i++)
  54950. t.push(this.getPoint(i / e));
  54951. return this.autoClose && t.push(t[0]),
  54952. t
  54953. }
  54954. ,
  54955. n.Path.prototype.getPoints = function(e) {
  54956. e = e || 12;
  54957. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  54958. var A = this.actions[m]
  54959. , y = A.action
  54960. , C = A.args;
  54961. switch (y) {
  54962. case "moveTo":
  54963. g.push(new n.Vector2(C[0],C[1]));
  54964. break;
  54965. case "lineTo":
  54966. g.push(new n.Vector2(C[0],C[1]));
  54967. break;
  54968. case "quadraticCurveTo":
  54969. t = C[2],
  54970. i = C[3],
  54971. a = C[0],
  54972. s = C[1],
  54973. g.length > 0 ? (h = g[g.length - 1],
  54974. l = h.x,
  54975. c = h.y) : (h = this.actions[m - 1].args,
  54976. l = h[h.length - 2],
  54977. c = h[h.length - 1]);
  54978. for (var I = 1; I <= e; I++) {
  54979. var E = I / e;
  54980. u = p(E, l, a, t),
  54981. d = p(E, c, s, i),
  54982. g.push(new n.Vector2(u,d))
  54983. }
  54984. break;
  54985. case "bezierCurveTo":
  54986. t = C[4],
  54987. i = C[5],
  54988. a = C[0],
  54989. s = C[1],
  54990. r = C[2],
  54991. o = C[3],
  54992. g.length > 0 ? (h = g[g.length - 1],
  54993. l = h.x,
  54994. c = h.y) : (h = this.actions[m - 1].args,
  54995. l = h[h.length - 2],
  54996. c = h[h.length - 1]);
  54997. for (var I = 1; I <= e; I++) {
  54998. var E = I / e;
  54999. u = f(E, l, a, r, t),
  55000. d = f(E, c, s, o, i),
  55001. g.push(new n.Vector2(u,d))
  55002. }
  55003. break;
  55004. case "splineThru":
  55005. h = this.actions[m - 1].args;
  55006. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55007. , w = [b]
  55008. , _ = e * C[0].length;
  55009. w = w.concat(C[0]);
  55010. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55011. g.push(T.getPointAt(I / _));
  55012. break;
  55013. case "arc":
  55014. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  55015. var E = I / N;
  55016. L || (E = 1 - E),
  55017. x = P + E * D,
  55018. u = S + R * Math.cos(x),
  55019. d = M + R * Math.sin(x),
  55020. g.push(new n.Vector2(u,d))
  55021. }
  55022. break;
  55023. case "ellipse":
  55024. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  55025. 0 !== k && (B = Math.cos(k),
  55026. F = Math.sin(k));
  55027. for (var I = 1; I <= N; I++) {
  55028. var E = I / N;
  55029. if (L || (E = 1 - E),
  55030. x = P + E * D,
  55031. u = S + V * Math.cos(x),
  55032. d = M + U * Math.sin(x),
  55033. 0 !== k) {
  55034. var H = u
  55035. , G = d;
  55036. u = (H - S) * B - (G - M) * F + S,
  55037. d = (H - S) * F + (G - M) * B + M
  55038. }
  55039. g.push(new n.Vector2(u,d))
  55040. }
  55041. }
  55042. }
  55043. var z = g[g.length - 1];
  55044. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  55045. this.autoClose && g.push(g[0]),
  55046. g
  55047. }
  55048. ,
  55049. n.Path.prototype.toShapes = function(e, t) {
  55050. function i(e) {
  55051. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55052. var a = e[r]
  55053. , s = a.args
  55054. , l = a.action;
  55055. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55056. i = new n.Path),
  55057. i[l].apply(i, s)
  55058. }
  55059. return 0 !== i.actions.length && t.push(i),
  55060. t
  55061. }
  55062. function r(e) {
  55063. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55064. var o = e[i]
  55065. , a = new n.Shape;
  55066. a.actions = o.actions,
  55067. a.curves = o.curves,
  55068. t.push(a)
  55069. }
  55070. return t
  55071. }
  55072. function o(e, t) {
  55073. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55074. var a = t[r]
  55075. , s = t[o]
  55076. , l = s.x - a.x
  55077. , c = s.y - a.y;
  55078. if (Math.abs(c) > Number.EPSILON) {
  55079. if (c < 0 && (a = t[o],
  55080. l = -l,
  55081. s = t[r],
  55082. c = -c),
  55083. e.y < a.y || e.y > s.y)
  55084. continue;
  55085. if (e.y === a.y) {
  55086. if (e.x === a.x)
  55087. return !0
  55088. } else {
  55089. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55090. if (0 === h)
  55091. return !0;
  55092. if (h < 0)
  55093. continue;
  55094. n = !n
  55095. }
  55096. } else {
  55097. if (e.y !== a.y)
  55098. continue;
  55099. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55100. return !0
  55101. }
  55102. }
  55103. return n
  55104. }
  55105. var a = n.ShapeUtils.isClockWise
  55106. , s = i(this.actions);
  55107. if (0 === s.length)
  55108. return [];
  55109. if (t === !0)
  55110. return r(s);
  55111. var l, c, h, u = [];
  55112. if (1 === s.length)
  55113. return c = s[0],
  55114. h = new n.Shape,
  55115. h.actions = c.actions,
  55116. h.curves = c.curves,
  55117. u.push(h),
  55118. u;
  55119. var d = !a(s[0].getPoints());
  55120. d = e ? !d : d;
  55121. var p, f = [], g = [], m = [], v = 0;
  55122. g[v] = void 0,
  55123. m[v] = [];
  55124. for (var A = 0, y = s.length; A < y; A++)
  55125. c = s[A],
  55126. p = c.getPoints(),
  55127. l = a(p),
  55128. l = e ? !l : l,
  55129. l ? (!d && g[v] && v++,
  55130. g[v] = {
  55131. s: new n.Shape,
  55132. p: p
  55133. },
  55134. g[v].s.actions = c.actions,
  55135. g[v].s.curves = c.curves,
  55136. d && v++,
  55137. m[v] = []) : m[v].push({
  55138. h: c,
  55139. p: p[0]
  55140. });
  55141. if (!g[0])
  55142. return r(s);
  55143. if (g.length > 1) {
  55144. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55145. f[E] = [];
  55146. for (var E = 0, b = g.length; E < b; E++)
  55147. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55148. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55149. o(T.p, g[S].p) && (E !== S && I.push({
  55150. froms: E,
  55151. tos: S,
  55152. hole: _
  55153. }),
  55154. x ? (x = !1,
  55155. f[S].push(T)) : C = !0);
  55156. x && f[E].push(T)
  55157. }
  55158. I.length > 0 && (C || (m = f))
  55159. }
  55160. for (var M, A = 0, R = g.length; A < R; A++) {
  55161. h = g[A].s,
  55162. u.push(h),
  55163. M = m[A];
  55164. for (var P = 0, O = M.length; P < O; P++)
  55165. h.holes.push(M[P].h)
  55166. }
  55167. return u
  55168. }
  55169. ,
  55170. n.Shape = function() {
  55171. n.Path.apply(this, arguments),
  55172. this.holes = []
  55173. }
  55174. ,
  55175. n.Shape.prototype = Object.create(n.Path.prototype),
  55176. n.Shape.prototype.constructor = n.Shape,
  55177. n.Shape.prototype.extrude = function(e) {
  55178. return new n.ExtrudeGeometry(this,e)
  55179. }
  55180. ,
  55181. n.Shape.prototype.makeGeometry = function(e) {
  55182. return new n.ShapeGeometry(this,e)
  55183. }
  55184. ,
  55185. n.Shape.prototype.getPointsHoles = function(e) {
  55186. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55187. t[i] = this.holes[i].getPoints(e);
  55188. return t
  55189. }
  55190. ,
  55191. n.Shape.prototype.extractAllPoints = function(e) {
  55192. return {
  55193. shape: this.getPoints(e),
  55194. holes: this.getPointsHoles(e)
  55195. }
  55196. }
  55197. ,
  55198. n.Shape.prototype.extractPoints = function(e) {
  55199. return this.extractAllPoints(e)
  55200. }
  55201. ,
  55202. n.LineCurve = function(e, t) {
  55203. this.v1 = e,
  55204. this.v2 = t
  55205. }
  55206. ,
  55207. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55208. n.LineCurve.prototype.constructor = n.LineCurve,
  55209. n.LineCurve.prototype.getPoint = function(e) {
  55210. var t = this.v2.clone().sub(this.v1);
  55211. return t.multiplyScalar(e).add(this.v1),
  55212. t
  55213. }
  55214. ,
  55215. n.LineCurve.prototype.getPointAt = function(e) {
  55216. return this.getPoint(e)
  55217. }
  55218. ,
  55219. n.LineCurve.prototype.getTangent = function(e) {
  55220. var t = this.v2.clone().sub(this.v1);
  55221. return t.normalize()
  55222. }
  55223. ,
  55224. n.QuadraticBezierCurve = function(e, t, i) {
  55225. this.v0 = e,
  55226. this.v1 = t,
  55227. this.v2 = i
  55228. }
  55229. ,
  55230. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55231. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55232. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55233. var t = n.ShapeUtils.b2;
  55234. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  55235. }
  55236. ,
  55237. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55238. var t = n.CurveUtils.tangentQuadraticBezier;
  55239. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  55240. }
  55241. ,
  55242. n.CubicBezierCurve = function(e, t, i, n) {
  55243. this.v0 = e,
  55244. this.v1 = t,
  55245. this.v2 = i,
  55246. this.v3 = n
  55247. }
  55248. ,
  55249. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55250. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55251. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55252. var t = n.ShapeUtils.b3;
  55253. return new n.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))
  55254. }
  55255. ,
  55256. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55257. var t = n.CurveUtils.tangentCubicBezier;
  55258. return new n.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()
  55259. }
  55260. ,
  55261. n.SplineCurve = function(e) {
  55262. this.points = void 0 == e ? [] : e
  55263. }
  55264. ,
  55265. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55266. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55267. n.SplineCurve.prototype.getPoint = function(e) {
  55268. var t = this.points
  55269. , i = (t.length - 1) * e
  55270. , r = Math.floor(i)
  55271. , o = i - r
  55272. , a = t[0 === r ? r : r - 1]
  55273. , s = t[r]
  55274. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55275. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55276. , h = n.CurveUtils.interpolate;
  55277. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55278. }
  55279. ,
  55280. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55281. this.aX = e,
  55282. this.aY = t,
  55283. this.xRadius = i,
  55284. this.yRadius = n,
  55285. this.aStartAngle = r,
  55286. this.aEndAngle = o,
  55287. this.aClockwise = a,
  55288. this.aRotation = s || 0
  55289. }
  55290. ,
  55291. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55292. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55293. n.EllipseCurve.prototype.getPoint = function(e) {
  55294. var t = this.aEndAngle - this.aStartAngle;
  55295. t < 0 && (t += 2 * Math.PI),
  55296. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55297. var i;
  55298. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55299. var r = this.aX + this.xRadius * Math.cos(i)
  55300. , o = this.aY + this.yRadius * Math.sin(i);
  55301. if (0 !== this.aRotation) {
  55302. var a = Math.cos(this.aRotation)
  55303. , s = Math.sin(this.aRotation)
  55304. , l = r
  55305. , c = o;
  55306. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55307. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55308. }
  55309. return new n.Vector2(r,o)
  55310. }
  55311. ,
  55312. n.ArcCurve = function(e, t, i, r, o, a) {
  55313. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55314. }
  55315. ,
  55316. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55317. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55318. n.LineCurve3 = n.Curve.create(function(e, t) {
  55319. this.v1 = e,
  55320. this.v2 = t
  55321. }, function(e) {
  55322. var t = new n.Vector3;
  55323. return t.subVectors(this.v2, this.v1),
  55324. t.multiplyScalar(e),
  55325. t.add(this.v1),
  55326. t
  55327. }),
  55328. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55329. this.v0 = e,
  55330. this.v1 = t,
  55331. this.v2 = i
  55332. }, function(e) {
  55333. var t = n.ShapeUtils.b2;
  55334. return new n.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))
  55335. }),
  55336. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55337. this.v0 = e,
  55338. this.v1 = t,
  55339. this.v2 = i,
  55340. this.v3 = n
  55341. }, function(e) {
  55342. var t = n.ShapeUtils.b3;
  55343. return new n.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))
  55344. }),
  55345. n.SplineCurve3 = n.Curve.create(function(e) {
  55346. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55347. this.points = void 0 == e ? [] : e
  55348. }, function(e) {
  55349. var t = this.points
  55350. , i = (t.length - 1) * e
  55351. , r = Math.floor(i)
  55352. , o = i - r
  55353. , a = t[0 == r ? r : r - 1]
  55354. , s = t[r]
  55355. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55356. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55357. , h = n.CurveUtils.interpolate;
  55358. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  55359. }),
  55360. n.CatmullRomCurve3 = function() {
  55361. function e() {}
  55362. var t = new n.Vector3
  55363. , i = new e
  55364. , r = new e
  55365. , o = new e;
  55366. return e.prototype.init = function(e, t, i, n) {
  55367. this.c0 = e,
  55368. this.c1 = i,
  55369. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55370. this.c3 = 2 * e - 2 * t + i + n
  55371. }
  55372. ,
  55373. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55374. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55375. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55376. s *= o,
  55377. l *= o,
  55378. this.init(t, i, s, l)
  55379. }
  55380. ,
  55381. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55382. this.init(t, i, r * (i - e), r * (n - t))
  55383. }
  55384. ,
  55385. e.prototype.calc = function(e) {
  55386. var t = e * e
  55387. , i = t * e;
  55388. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55389. }
  55390. ,
  55391. n.Curve.create(function(e) {
  55392. this.points = e || [],
  55393. this.closed = !1
  55394. }, function(e) {
  55395. var a, s, l, c, h = this.points;
  55396. c = h.length,
  55397. c < 2 && console.log("duh, you need at least 2 points"),
  55398. a = (c - (this.closed ? 0 : 1)) * e,
  55399. s = Math.floor(a),
  55400. l = a - s,
  55401. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55402. l = 1);
  55403. var u, d, p, f;
  55404. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55405. u = t),
  55406. d = h[s % c],
  55407. p = h[(s + 1) % c],
  55408. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55409. f = t),
  55410. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55411. var g = "chordal" === this.type ? .5 : .25
  55412. , m = Math.pow(u.distanceToSquared(d), g)
  55413. , v = Math.pow(d.distanceToSquared(p), g)
  55414. , A = Math.pow(p.distanceToSquared(f), g);
  55415. v < 1e-4 && (v = 1),
  55416. m < 1e-4 && (m = v),
  55417. A < 1e-4 && (A = v),
  55418. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55419. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55420. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55421. } else if ("catmullrom" === this.type) {
  55422. var y = void 0 !== this.tension ? this.tension : .5;
  55423. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55424. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55425. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55426. }
  55427. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55428. return C
  55429. })
  55430. }(),
  55431. n.ClosedSplineCurve3 = function(e) {
  55432. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55433. n.CatmullRomCurve3.call(this, e),
  55434. this.type = "catmullrom",
  55435. this.closed = !0
  55436. }
  55437. ,
  55438. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55439. n.BoxGeometry = function(e, t, i, r, o, a) {
  55440. n.Geometry.call(this),
  55441. this.type = "BoxGeometry",
  55442. this.parameters = {
  55443. width: e,
  55444. height: t,
  55445. depth: i,
  55446. widthSegments: r,
  55447. heightSegments: o,
  55448. depthSegments: a
  55449. },
  55450. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  55451. this.mergeVertices()
  55452. }
  55453. ,
  55454. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  55455. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  55456. n.CubeGeometry = n.BoxGeometry,
  55457. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  55458. function s(e, t, i) {
  55459. var n = 0;
  55460. return n += e * t * 2,
  55461. n += e * i * 2,
  55462. n += i * t * 2,
  55463. 4 * n
  55464. }
  55465. function l(e, t, i, r, o, a, s, l, h, u, I) {
  55466. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  55467. for (var L = O * b - _, D = 0; D < x; D++) {
  55468. var N = D * E - w;
  55469. P[e] = N * r,
  55470. P[t] = L * o,
  55471. P[i] = T,
  55472. p[m] = P.x,
  55473. p[m + 1] = P.y,
  55474. p[m + 2] = P.z,
  55475. P[e] = 0,
  55476. P[t] = 0,
  55477. P[i] = l > 0 ? 1 : -1,
  55478. f[m] = P.x,
  55479. f[m + 1] = P.y,
  55480. f[m + 2] = P.z,
  55481. g[v] = D / h,
  55482. g[v + 1] = 1 - O / u,
  55483. m += 3,
  55484. v += 2,
  55485. M += 1
  55486. }
  55487. for (O = 0; O < u; O++)
  55488. for (D = 0; D < h; D++) {
  55489. var B = y + D + x * O
  55490. , F = y + D + x * (O + 1)
  55491. , V = y + (D + 1) + x * (O + 1)
  55492. , U = y + (D + 1) + x * O;
  55493. d[A] = B,
  55494. d[A + 1] = F,
  55495. d[A + 2] = U,
  55496. d[A + 3] = F,
  55497. d[A + 4] = V,
  55498. d[A + 5] = U,
  55499. A += 6,
  55500. R += 6
  55501. }
  55502. c.addGroup(C, R, I),
  55503. C += R,
  55504. y += M
  55505. }
  55506. n.BufferGeometry.call(this),
  55507. this.type = "BoxBufferGeometry",
  55508. this.parameters = {
  55509. width: e,
  55510. height: t,
  55511. depth: i,
  55512. widthSegments: r,
  55513. heightSegments: o,
  55514. depthSegments: a
  55515. };
  55516. var c = this;
  55517. r = Math.floor(r) || 1,
  55518. o = Math.floor(o) || 1,
  55519. a = Math.floor(a) || 1;
  55520. var h = s(r, o, a)
  55521. , u = h / 4 * 6
  55522. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  55523. , p = new Float32Array(3 * h)
  55524. , f = new Float32Array(3 * h)
  55525. , g = new Float32Array(2 * h)
  55526. , m = 0
  55527. , v = 0
  55528. , A = 0
  55529. , y = 0
  55530. , C = 0;
  55531. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  55532. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  55533. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  55534. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  55535. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  55536. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  55537. this.setIndex(new n.BufferAttribute(d,1)),
  55538. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55539. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55540. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55541. }
  55542. ,
  55543. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55544. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  55545. n.CircleGeometry = function(e, t, i, r) {
  55546. n.Geometry.call(this),
  55547. this.type = "CircleGeometry",
  55548. this.parameters = {
  55549. radius: e,
  55550. segments: t,
  55551. thetaStart: i,
  55552. thetaLength: r
  55553. },
  55554. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  55555. }
  55556. ,
  55557. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  55558. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  55559. n.CircleBufferGeometry = function(e, t, i, r) {
  55560. n.BufferGeometry.call(this),
  55561. this.type = "CircleBufferGeometry",
  55562. this.parameters = {
  55563. radius: e,
  55564. segments: t,
  55565. thetaStart: i,
  55566. thetaLength: r
  55567. },
  55568. e = e || 50,
  55569. t = void 0 !== t ? Math.max(3, t) : 8,
  55570. i = void 0 !== i ? i : 0,
  55571. r = void 0 !== r ? r : 2 * Math.PI;
  55572. var o = t + 2
  55573. , a = new Float32Array(3 * o)
  55574. , s = new Float32Array(3 * o)
  55575. , l = new Float32Array(2 * o);
  55576. s[2] = 1,
  55577. l[0] = .5,
  55578. l[1] = .5;
  55579. for (var c = 0, h = 3, u = 2; c <= t; c++,
  55580. h += 3,
  55581. u += 2) {
  55582. var d = i + c / t * r;
  55583. a[h] = e * Math.cos(d),
  55584. a[h + 1] = e * Math.sin(d),
  55585. s[h + 2] = 1,
  55586. l[u] = (a[h] / e + 1) / 2,
  55587. l[u + 1] = (a[h + 1] / e + 1) / 2
  55588. }
  55589. for (var p = [], h = 1; h <= t; h++)
  55590. p.push(h, h + 1, 0);
  55591. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  55592. this.addAttribute("position", new n.BufferAttribute(a,3)),
  55593. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  55594. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  55595. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55596. }
  55597. ,
  55598. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55599. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  55600. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  55601. function c() {
  55602. var e = (r + 1) * (o + 1);
  55603. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  55604. e
  55605. }
  55606. function h() {
  55607. var e = r * o * 2 * 3;
  55608. return a === !1 && (e += 2 * r * 3),
  55609. e
  55610. }
  55611. function u() {
  55612. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  55613. for (c = 0; c <= o; c++) {
  55614. var p = []
  55615. , f = c / o
  55616. , b = f * (t - e) + e;
  55617. for (a = 0; a <= r; a++) {
  55618. var w = a / r;
  55619. u.x = b * Math.sin(w * l + s),
  55620. u.y = -f * i + E,
  55621. u.z = b * Math.cos(w * l + s),
  55622. m.setXYZ(y, u.x, u.y, u.z),
  55623. h.copy(u),
  55624. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  55625. h.z = Math.cos(w * l + s)),
  55626. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  55627. v.setXYZ(y, h.x, h.y, h.z),
  55628. A.setXY(y, w, 1 - f),
  55629. p.push(y),
  55630. y++
  55631. }
  55632. I.push(p)
  55633. }
  55634. for (a = 0; a < r; a++)
  55635. for (c = 0; c < o; c++) {
  55636. var _ = I[c][a]
  55637. , T = I[c + 1][a]
  55638. , x = I[c + 1][a + 1]
  55639. , S = I[c][a + 1];
  55640. g.setX(C, _),
  55641. C++,
  55642. g.setX(C, T),
  55643. C++,
  55644. g.setX(C, S),
  55645. C++,
  55646. g.setX(C, T),
  55647. C++,
  55648. g.setX(C, x),
  55649. C++,
  55650. g.setX(C, S),
  55651. C++
  55652. }
  55653. }
  55654. function d(i) {
  55655. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  55656. for (a = y,
  55657. o = 1; o <= r; o++)
  55658. m.setXYZ(y, 0, E * p, 0),
  55659. v.setXYZ(y, 0, p, 0),
  55660. i === !0 ? (h.x = o / r,
  55661. h.y = 0) : (h.x = (o - 1) / r,
  55662. h.y = 1),
  55663. A.setXY(y, h.x, h.y),
  55664. y++;
  55665. for (c = y,
  55666. o = 0; o <= r; o++) {
  55667. var f = o / r;
  55668. u.x = d * Math.sin(f * l + s),
  55669. u.y = E * p,
  55670. u.z = d * Math.cos(f * l + s),
  55671. m.setXYZ(y, u.x, u.y, u.z),
  55672. v.setXYZ(y, 0, p, 0),
  55673. A.setXY(y, f, i === !0 ? 1 : 0),
  55674. y++
  55675. }
  55676. for (o = 0; o < r; o++) {
  55677. var I = a + o
  55678. , b = c + o;
  55679. i === !0 ? (g.setX(C, b),
  55680. C++,
  55681. g.setX(C, b + 1),
  55682. C++,
  55683. g.setX(C, I),
  55684. C++) : (g.setX(C, b + 1),
  55685. C++,
  55686. g.setX(C, b),
  55687. C++,
  55688. g.setX(C, I),
  55689. C++)
  55690. }
  55691. }
  55692. n.BufferGeometry.call(this),
  55693. this.type = "CylinderBufferGeometry",
  55694. this.parameters = {
  55695. radiusTop: e,
  55696. radiusBottom: t,
  55697. height: i,
  55698. radialSegments: r,
  55699. heightSegments: o,
  55700. openEnded: a,
  55701. thetaStart: s,
  55702. thetaLength: l
  55703. },
  55704. e = void 0 !== e ? e : 20,
  55705. t = void 0 !== t ? t : 20,
  55706. i = void 0 !== i ? i : 100,
  55707. r = Math.floor(r) || 8,
  55708. o = Math.floor(o) || 1,
  55709. a = void 0 !== a && a,
  55710. s = void 0 !== s ? s : 0,
  55711. l = void 0 !== l ? l : 2 * Math.PI;
  55712. var p = c()
  55713. , f = h()
  55714. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  55715. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  55716. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  55717. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  55718. , y = 0
  55719. , C = 0
  55720. , I = []
  55721. , E = i / 2;
  55722. u(),
  55723. a === !1 && (e > 0 && d(!0),
  55724. t > 0 && d(!1)),
  55725. this.setIndex(g),
  55726. this.addAttribute("position", m),
  55727. this.addAttribute("normal", v),
  55728. this.addAttribute("uv", A)
  55729. }
  55730. ,
  55731. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55732. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  55733. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  55734. n.Geometry.call(this),
  55735. this.type = "CylinderGeometry",
  55736. this.parameters = {
  55737. radiusTop: e,
  55738. radiusBottom: t,
  55739. height: i,
  55740. radialSegments: r,
  55741. heightSegments: o,
  55742. openEnded: a,
  55743. thetaStart: s,
  55744. thetaLength: l
  55745. },
  55746. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  55747. this.mergeVertices()
  55748. }
  55749. ,
  55750. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  55751. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  55752. n.EdgesGeometry = function(e, t) {
  55753. function i(e, t) {
  55754. return e - t
  55755. }
  55756. n.BufferGeometry.call(this),
  55757. t = void 0 !== t ? t : 1;
  55758. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  55759. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  55760. r.fromBufferGeometry(e)) : r = e.clone(),
  55761. r.mergeVertices(),
  55762. r.computeFaceNormals();
  55763. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  55764. for (var p = h[u], f = 0; f < 3; f++) {
  55765. a[0] = p[l[f]],
  55766. a[1] = p[l[(f + 1) % 3]],
  55767. a.sort(i);
  55768. var g = a.toString();
  55769. void 0 === s[g] ? s[g] = {
  55770. vert1: a[0],
  55771. vert2: a[1],
  55772. face1: u,
  55773. face2: void 0
  55774. } : s[g].face2 = u
  55775. }
  55776. var m = [];
  55777. for (var g in s) {
  55778. var v = s[g];
  55779. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  55780. var A = c[v.vert1];
  55781. m.push(A.x),
  55782. m.push(A.y),
  55783. m.push(A.z),
  55784. A = c[v.vert2],
  55785. m.push(A.x),
  55786. m.push(A.y),
  55787. m.push(A.z)
  55788. }
  55789. }
  55790. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  55791. }
  55792. ,
  55793. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55794. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  55795. n.ExtrudeGeometry = function(e, t) {
  55796. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  55797. this.type = "ExtrudeGeometry",
  55798. e = Array.isArray(e) ? e : [e],
  55799. this.addShapeList(e, t),
  55800. void this.computeFaceNormals())
  55801. }
  55802. ;
  55803. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  55804. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  55805. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  55806. for (var i = e.length, n = 0; n < i; n++) {
  55807. var r = e[n];
  55808. this.addShape(r, t)
  55809. }
  55810. }
  55811. ,
  55812. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  55813. function i(e, t, i) {
  55814. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  55815. t.clone().multiplyScalar(i).add(e)
  55816. }
  55817. function r(e, t, i) {
  55818. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  55819. if (Math.abs(d) > Number.EPSILON) {
  55820. var p = Math.sqrt(u)
  55821. , f = Math.sqrt(c * c + h * h)
  55822. , g = t.x - l / p
  55823. , m = t.y + s / p
  55824. , v = i.x - h / f
  55825. , A = i.y + c / f
  55826. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  55827. r = g + s * y - e.x,
  55828. o = m + l * y - e.y;
  55829. var C = r * r + o * o;
  55830. if (C <= 2)
  55831. return new n.Vector2(r,o);
  55832. a = Math.sqrt(C / 2)
  55833. } else {
  55834. var I = !1;
  55835. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  55836. I ? (r = -l,
  55837. o = s,
  55838. a = Math.sqrt(u)) : (r = s,
  55839. o = l,
  55840. a = Math.sqrt(u / 2))
  55841. }
  55842. return new n.Vector2(r / a,o / a)
  55843. }
  55844. function o() {
  55845. if (C) {
  55846. var e = 0
  55847. , t = z * e;
  55848. for (Y = 0; Y < W; Y++)
  55849. G = N[Y],
  55850. c(G[2] + t, G[1] + t, G[0] + t);
  55851. for (e = E + 2 * y,
  55852. t = z * e,
  55853. Y = 0; Y < W; Y++)
  55854. G = N[Y],
  55855. c(G[0] + t, G[1] + t, G[2] + t)
  55856. } else {
  55857. for (Y = 0; Y < W; Y++)
  55858. G = N[Y],
  55859. c(G[2], G[1], G[0]);
  55860. for (Y = 0; Y < W; Y++)
  55861. G = N[Y],
  55862. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  55863. }
  55864. }
  55865. function a() {
  55866. var e = 0;
  55867. for (s(B, e),
  55868. e += B.length,
  55869. x = 0,
  55870. S = L.length; x < S; x++)
  55871. T = L[x],
  55872. s(T, e),
  55873. e += T.length
  55874. }
  55875. function s(e, t) {
  55876. var i, n;
  55877. for (Y = e.length; --Y >= 0; ) {
  55878. i = Y,
  55879. n = Y - 1,
  55880. n < 0 && (n = e.length - 1);
  55881. var r = 0
  55882. , o = E + 2 * y;
  55883. for (r = 0; r < o; r++) {
  55884. var a = z * r
  55885. , s = z * (r + 1)
  55886. , l = t + i + a
  55887. , c = t + n + a
  55888. , u = t + n + s
  55889. , d = t + i + s;
  55890. h(l, c, u, d, e, r, o, i, n)
  55891. }
  55892. }
  55893. }
  55894. function l(e, t, i) {
  55895. M.vertices.push(new n.Vector3(e,t,i))
  55896. }
  55897. function c(e, t, i) {
  55898. e += R,
  55899. t += R,
  55900. i += R,
  55901. M.faces.push(new n.Face3(e,t,i,null,null,0));
  55902. var r = _.generateTopUV(M, e, t, i);
  55903. M.faceVertexUvs[0].push(r)
  55904. }
  55905. function h(e, t, i, r, o, a, s, l, c) {
  55906. e += R,
  55907. t += R,
  55908. i += R,
  55909. r += R,
  55910. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  55911. M.faces.push(new n.Face3(t,i,r,null,null,1));
  55912. var h = _.generateSideWallUV(M, e, t, i, r);
  55913. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  55914. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  55915. }
  55916. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  55917. b && (u = b.getSpacedPoints(E),
  55918. w = !0,
  55919. C = !1,
  55920. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  55921. p = new n.Vector3,
  55922. f = new n.Vector3,
  55923. g = new n.Vector3),
  55924. C || (y = 0,
  55925. v = 0,
  55926. A = 0);
  55927. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  55928. if (D) {
  55929. for (O = O.reverse(),
  55930. x = 0,
  55931. S = L.length; x < S; x++)
  55932. T = L[x],
  55933. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  55934. D = !1
  55935. }
  55936. var N = n.ShapeUtils.triangulateShape(O, L)
  55937. , B = O;
  55938. for (x = 0,
  55939. S = L.length; x < S; x++)
  55940. T = L[x],
  55941. O = O.concat(T);
  55942. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  55943. Z++,
  55944. q++)
  55945. Z === X && (Z = 0),
  55946. q === X && (q = 0),
  55947. j[Y] = r(B[Y], B[Z], B[q]);
  55948. var K, Q = [], J = j.concat();
  55949. for (x = 0,
  55950. S = L.length; x < S; x++) {
  55951. for (T = L[x],
  55952. K = [],
  55953. Y = 0,
  55954. X = T.length,
  55955. Z = X - 1,
  55956. q = Y + 1; Y < X; Y++,
  55957. Z++,
  55958. q++)
  55959. Z === X && (Z = 0),
  55960. q === X && (q = 0),
  55961. K[Y] = r(T[Y], T[Z], T[q]);
  55962. Q.push(K),
  55963. J = J.concat(K)
  55964. }
  55965. for (F = 0; F < y; F++) {
  55966. for (U = F / y,
  55967. k = v * (1 - U),
  55968. V = A * Math.sin(U * Math.PI / 2),
  55969. Y = 0,
  55970. X = B.length; Y < X; Y++)
  55971. H = i(B[Y], j[Y], V),
  55972. l(H.x, H.y, -k);
  55973. for (x = 0,
  55974. S = L.length; x < S; x++)
  55975. for (T = L[x],
  55976. K = Q[x],
  55977. Y = 0,
  55978. X = T.length; Y < X; Y++)
  55979. H = i(T[Y], K[Y], V),
  55980. l(H.x, H.y, -k)
  55981. }
  55982. for (V = A,
  55983. Y = 0; Y < z; Y++)
  55984. H = C ? i(O[Y], J[Y], V) : O[Y],
  55985. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  55986. p.copy(d.binormals[0]).multiplyScalar(H.y),
  55987. g.copy(u[0]).add(f).add(p),
  55988. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  55989. var $;
  55990. for ($ = 1; $ <= E; $++)
  55991. for (Y = 0; Y < z; Y++)
  55992. H = C ? i(O[Y], J[Y], V) : O[Y],
  55993. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  55994. p.copy(d.binormals[$]).multiplyScalar(H.y),
  55995. g.copy(u[$]).add(f).add(p),
  55996. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  55997. for (F = y - 1; F >= 0; F--) {
  55998. for (U = F / y,
  55999. k = v * (1 - U),
  56000. V = A * Math.sin(U * Math.PI / 2),
  56001. Y = 0,
  56002. X = B.length; Y < X; Y++)
  56003. H = i(B[Y], j[Y], V),
  56004. l(H.x, H.y, m + k);
  56005. for (x = 0,
  56006. S = L.length; x < S; x++)
  56007. for (T = L[x],
  56008. K = Q[x],
  56009. Y = 0,
  56010. X = T.length; Y < X; Y++)
  56011. H = i(T[Y], K[Y], V),
  56012. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56013. }
  56014. o(),
  56015. a()
  56016. }
  56017. ,
  56018. n.ExtrudeGeometry.WorldUVGenerator = {
  56019. generateTopUV: function(e, t, i, r) {
  56020. var o = e.vertices
  56021. , a = o[t]
  56022. , s = o[i]
  56023. , l = o[r];
  56024. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56025. },
  56026. generateSideWallUV: function(e, t, i, r, o) {
  56027. var a = e.vertices
  56028. , s = a[t]
  56029. , l = a[i]
  56030. , c = a[r]
  56031. , h = a[o];
  56032. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  56033. }
  56034. },
  56035. n.ShapeGeometry = function(e, t) {
  56036. n.Geometry.call(this),
  56037. this.type = "ShapeGeometry",
  56038. Array.isArray(e) === !1 && (e = [e]),
  56039. this.addShapeList(e, t),
  56040. this.computeFaceNormals()
  56041. }
  56042. ,
  56043. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56044. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56045. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56046. for (var i = 0, n = e.length; i < n; i++)
  56047. this.addShape(e[i], t);
  56048. return this
  56049. }
  56050. ,
  56051. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56052. void 0 === t && (t = {});
  56053. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  56054. if (p) {
  56055. for (u = u.reverse(),
  56056. i = 0,
  56057. r = d.length; i < r; i++)
  56058. o = d[i],
  56059. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56060. p = !1
  56061. }
  56062. var f = n.ShapeUtils.triangulateShape(u, d);
  56063. for (i = 0,
  56064. r = d.length; i < r; i++)
  56065. o = d[i],
  56066. u = u.concat(o);
  56067. var g, m, v = u.length, A = f.length;
  56068. for (i = 0; i < v; i++)
  56069. g = u[i],
  56070. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56071. for (i = 0; i < A; i++) {
  56072. m = f[i];
  56073. var y = m[0] + c
  56074. , C = m[1] + c
  56075. , I = m[2] + c;
  56076. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56077. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56078. }
  56079. }
  56080. ,
  56081. n.LatheBufferGeometry = function(e, t, i, r) {
  56082. n.BufferGeometry.call(this),
  56083. this.type = "LatheBufferGeometry",
  56084. this.parameters = {
  56085. points: e,
  56086. segments: t,
  56087. phiStart: i,
  56088. phiLength: r
  56089. },
  56090. t = Math.floor(t) || 12,
  56091. i = i || 0,
  56092. r = r || 2 * Math.PI,
  56093. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56094. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  56095. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56096. for (a = 0; a <= t; a++) {
  56097. var A = i + a * g * r
  56098. , y = Math.sin(A)
  56099. , C = Math.cos(A);
  56100. for (s = 0; s <= e.length - 1; s++)
  56101. m.x = e[s].x * y,
  56102. m.y = e[s].y,
  56103. m.z = e[s].x * C,
  56104. u.setXYZ(p, m.x, m.y, m.z),
  56105. v.x = a / t,
  56106. v.y = s / (e.length - 1),
  56107. d.setXY(p, v.x, v.y),
  56108. p++
  56109. }
  56110. for (a = 0; a < t; a++)
  56111. for (s = 0; s < e.length - 1; s++) {
  56112. o = s + a * e.length;
  56113. var I = o
  56114. , E = o + e.length
  56115. , b = o + e.length + 1
  56116. , w = o + 1;
  56117. h.setX(f, I),
  56118. f++,
  56119. h.setX(f, E),
  56120. f++,
  56121. h.setX(f, w),
  56122. f++,
  56123. h.setX(f, E),
  56124. f++,
  56125. h.setX(f, b),
  56126. f++,
  56127. h.setX(f, w),
  56128. f++
  56129. }
  56130. if (this.setIndex(h),
  56131. this.addAttribute("position", u),
  56132. this.addAttribute("uv", d),
  56133. this.computeVertexNormals(),
  56134. r === 2 * Math.PI) {
  56135. var _ = this.attributes.normal.array
  56136. , T = new n.Vector3
  56137. , x = new n.Vector3
  56138. , S = new n.Vector3;
  56139. for (o = t * e.length * 3,
  56140. a = 0,
  56141. s = 0; a < e.length; a++,
  56142. s += 3)
  56143. T.x = _[s + 0],
  56144. T.y = _[s + 1],
  56145. T.z = _[s + 2],
  56146. x.x = _[o + s + 0],
  56147. x.y = _[o + s + 1],
  56148. x.z = _[o + s + 2],
  56149. S.addVectors(T, x).normalize(),
  56150. _[s + 0] = _[o + s + 0] = S.x,
  56151. _[s + 1] = _[o + s + 1] = S.y,
  56152. _[s + 2] = _[o + s + 2] = S.z
  56153. }
  56154. }
  56155. ,
  56156. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56157. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56158. n.LatheGeometry = function(e, t, i, r) {
  56159. n.Geometry.call(this),
  56160. this.type = "LatheGeometry",
  56161. this.parameters = {
  56162. points: e,
  56163. segments: t,
  56164. phiStart: i,
  56165. phiLength: r
  56166. },
  56167. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56168. this.mergeVertices()
  56169. }
  56170. ,
  56171. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56172. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56173. n.PlaneGeometry = function(e, t, i, r) {
  56174. n.Geometry.call(this),
  56175. this.type = "PlaneGeometry",
  56176. this.parameters = {
  56177. width: e,
  56178. height: t,
  56179. widthSegments: i,
  56180. heightSegments: r
  56181. },
  56182. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56183. }
  56184. ,
  56185. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56186. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56187. n.PlaneBufferGeometry = function(e, t, i, r) {
  56188. n.BufferGeometry.call(this),
  56189. this.type = "PlaneBufferGeometry",
  56190. this.parameters = {
  56191. width: e,
  56192. height: t,
  56193. widthSegments: i,
  56194. heightSegments: r
  56195. };
  56196. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  56197. for (var y = A * d - a, C = 0; C < c; C++) {
  56198. var I = C * u - o;
  56199. p[m] = I,
  56200. p[m + 1] = -y,
  56201. f[m + 2] = 1,
  56202. g[v] = C / s,
  56203. g[v + 1] = 1 - A / l,
  56204. m += 3,
  56205. v += 2
  56206. }
  56207. m = 0;
  56208. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56209. for (var C = 0; C < s; C++) {
  56210. var b = C + c * A
  56211. , w = C + c * (A + 1)
  56212. , _ = C + 1 + c * (A + 1)
  56213. , T = C + 1 + c * A;
  56214. E[m] = b,
  56215. E[m + 1] = w,
  56216. E[m + 2] = T,
  56217. E[m + 3] = w,
  56218. E[m + 4] = _,
  56219. E[m + 5] = T,
  56220. m += 6
  56221. }
  56222. this.setIndex(new n.BufferAttribute(E,1)),
  56223. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56224. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56225. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56226. }
  56227. ,
  56228. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56229. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56230. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56231. n.BufferGeometry.call(this),
  56232. this.type = "RingBufferGeometry",
  56233. this.parameters = {
  56234. innerRadius: e,
  56235. outerRadius: t,
  56236. thetaSegments: i,
  56237. phiSegments: r,
  56238. thetaStart: o,
  56239. thetaLength: a
  56240. },
  56241. e = e || 20,
  56242. t = t || 50,
  56243. o = void 0 !== o ? o : 0,
  56244. a = void 0 !== a ? a : 2 * Math.PI,
  56245. i = void 0 !== i ? Math.max(3, i) : 8,
  56246. r = void 0 !== r ? Math.max(1, r) : 1;
  56247. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  56248. for (l = 0; l <= r; l++) {
  56249. for (c = 0; c <= i; c++)
  56250. s = o + c / i * a,
  56251. C.x = A * Math.cos(s),
  56252. C.y = A * Math.sin(s),
  56253. p.setXYZ(m, C.x, C.y, C.z),
  56254. f.setXYZ(m, 0, 0, 1),
  56255. I.x = (C.x / t + 1) / 2,
  56256. I.y = (C.y / t + 1) / 2,
  56257. g.setXY(m, I.x, I.y),
  56258. m++;
  56259. A += y
  56260. }
  56261. for (l = 0; l < r; l++) {
  56262. var E = l * (i + 1);
  56263. for (c = 0; c < i; c++) {
  56264. s = c + E;
  56265. var b = s
  56266. , w = s + i + 1
  56267. , _ = s + i + 2
  56268. , T = s + 1;
  56269. d.setX(v, b),
  56270. v++,
  56271. d.setX(v, w),
  56272. v++,
  56273. d.setX(v, _),
  56274. v++,
  56275. d.setX(v, b),
  56276. v++,
  56277. d.setX(v, _),
  56278. v++,
  56279. d.setX(v, T),
  56280. v++
  56281. }
  56282. }
  56283. this.setIndex(d),
  56284. this.addAttribute("position", p),
  56285. this.addAttribute("normal", f),
  56286. this.addAttribute("uv", g)
  56287. }
  56288. ,
  56289. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56290. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56291. n.RingGeometry = function(e, t, i, r, o, a) {
  56292. n.Geometry.call(this),
  56293. this.type = "RingGeometry",
  56294. this.parameters = {
  56295. innerRadius: e,
  56296. outerRadius: t,
  56297. thetaSegments: i,
  56298. phiSegments: r,
  56299. thetaStart: o,
  56300. thetaLength: a
  56301. },
  56302. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56303. }
  56304. ,
  56305. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56306. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56307. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56308. n.Geometry.call(this),
  56309. this.type = "SphereGeometry",
  56310. this.parameters = {
  56311. radius: e,
  56312. widthSegments: t,
  56313. heightSegments: i,
  56314. phiStart: r,
  56315. phiLength: o,
  56316. thetaStart: a,
  56317. thetaLength: s
  56318. },
  56319. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56320. }
  56321. ,
  56322. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56323. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56324. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56325. n.BufferGeometry.call(this),
  56326. this.type = "SphereBufferGeometry",
  56327. this.parameters = {
  56328. radius: e,
  56329. widthSegments: t,
  56330. heightSegments: i,
  56331. phiStart: r,
  56332. phiLength: o,
  56333. thetaStart: a,
  56334. thetaLength: s
  56335. },
  56336. e = e || 50,
  56337. t = Math.max(3, Math.floor(t) || 8),
  56338. i = Math.max(2, Math.floor(i) || 6),
  56339. r = void 0 !== r ? r : 0,
  56340. o = void 0 !== o ? o : 2 * Math.PI,
  56341. a = void 0 !== a ? a : 0,
  56342. s = void 0 !== s ? s : Math.PI;
  56343. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  56344. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56345. var C = y / t
  56346. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56347. , E = e * Math.cos(a + A * s)
  56348. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56349. g.set(I, E, b).normalize(),
  56350. h.setXYZ(p, I, E, b),
  56351. u.setXYZ(p, g.x, g.y, g.z),
  56352. d.setXY(p, C, 1 - A),
  56353. v.push(p),
  56354. p++
  56355. }
  56356. f.push(v)
  56357. }
  56358. for (var w = [], m = 0; m < i; m++)
  56359. for (var y = 0; y < t; y++) {
  56360. var _ = f[m][y + 1]
  56361. , T = f[m][y]
  56362. , x = f[m + 1][y]
  56363. , S = f[m + 1][y + 1];
  56364. (0 !== m || a > 0) && w.push(_, T, S),
  56365. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56366. }
  56367. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56368. this.addAttribute("position", h),
  56369. this.addAttribute("normal", u),
  56370. this.addAttribute("uv", d),
  56371. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56372. }
  56373. ,
  56374. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56375. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56376. n.TextGeometry = function(e, t) {
  56377. t = t || {};
  56378. var i = t.font;
  56379. if (i instanceof n.Font == !1)
  56380. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56381. new n.Geometry;
  56382. var r = i.generateShapes(e, t.size, t.curveSegments);
  56383. t.amount = void 0 !== t.height ? t.height : 50,
  56384. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56385. void 0 === t.bevelSize && (t.bevelSize = 8),
  56386. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56387. n.ExtrudeGeometry.call(this, r, t),
  56388. this.type = "TextGeometry"
  56389. }
  56390. ,
  56391. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56392. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56393. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56394. n.BufferGeometry.call(this),
  56395. this.type = "TorusBufferGeometry",
  56396. this.parameters = {
  56397. radius: e,
  56398. tube: t,
  56399. radialSegments: i,
  56400. tubularSegments: r,
  56401. arc: o
  56402. },
  56403. e = e || 100,
  56404. t = t || 40,
  56405. i = Math.floor(i) || 8,
  56406. r = Math.floor(r) || 6,
  56407. o = o || 2 * Math.PI;
  56408. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  56409. for (a = 0; a <= i; a++)
  56410. for (s = 0; s <= r; s++) {
  56411. var C = s / r * o
  56412. , I = a / i * Math.PI * 2;
  56413. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56414. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56415. A.z = t * Math.sin(I),
  56416. u[f] = A.x,
  56417. u[f + 1] = A.y,
  56418. u[f + 2] = A.z,
  56419. v.x = e * Math.cos(C),
  56420. v.y = e * Math.sin(C),
  56421. y.subVectors(A, v).normalize(),
  56422. d[f] = y.x,
  56423. d[f + 1] = y.y,
  56424. d[f + 2] = y.z,
  56425. p[g] = s / r,
  56426. p[g + 1] = a / i,
  56427. f += 3,
  56428. g += 2
  56429. }
  56430. for (a = 1; a <= i; a++)
  56431. for (s = 1; s <= r; s++) {
  56432. var E = (r + 1) * a + s - 1
  56433. , b = (r + 1) * (a - 1) + s - 1
  56434. , w = (r + 1) * (a - 1) + s
  56435. , _ = (r + 1) * a + s;
  56436. h[m] = E,
  56437. h[m + 1] = b,
  56438. h[m + 2] = _,
  56439. h[m + 3] = b,
  56440. h[m + 4] = w,
  56441. h[m + 5] = _,
  56442. m += 6
  56443. }
  56444. this.setIndex(new n.BufferAttribute(h,1)),
  56445. this.addAttribute("position", new n.BufferAttribute(u,3)),
  56446. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  56447. this.addAttribute("uv", new n.BufferAttribute(p,2))
  56448. }
  56449. ,
  56450. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56451. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  56452. n.TorusGeometry = function(e, t, i, r, o) {
  56453. n.Geometry.call(this),
  56454. this.type = "TorusGeometry",
  56455. this.parameters = {
  56456. radius: e,
  56457. tube: t,
  56458. radialSegments: i,
  56459. tubularSegments: r,
  56460. arc: o
  56461. },
  56462. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  56463. }
  56464. ,
  56465. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  56466. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  56467. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  56468. function s(e, t, i, n, r) {
  56469. var o = Math.cos(e)
  56470. , a = Math.sin(e)
  56471. , s = i / t * e
  56472. , l = Math.cos(s);
  56473. r.x = n * (2 + l) * .5 * o,
  56474. r.y = n * (2 + l) * a * .5,
  56475. r.z = n * Math.sin(s) * .5
  56476. }
  56477. n.BufferGeometry.call(this),
  56478. this.type = "TorusKnotBufferGeometry",
  56479. this.parameters = {
  56480. radius: e,
  56481. tube: t,
  56482. tubularSegments: i,
  56483. radialSegments: r,
  56484. p: o,
  56485. q: a
  56486. },
  56487. e = e || 100,
  56488. t = t || 40,
  56489. i = Math.floor(i) || 64,
  56490. r = Math.floor(r) || 8,
  56491. o = o || 2,
  56492. a = a || 3;
  56493. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  56494. for (l = 0; l <= i; ++l) {
  56495. var T = l / i * o * Math.PI * 2;
  56496. for (s(T, o, a, e, I),
  56497. s(T + .01, o, a, e, E),
  56498. w.subVectors(E, I),
  56499. _.addVectors(E, I),
  56500. b.crossVectors(w, _),
  56501. _.crossVectors(b, w),
  56502. b.normalize(),
  56503. _.normalize(),
  56504. c = 0; c <= r; ++c) {
  56505. var x = c / r * Math.PI * 2
  56506. , S = -t * Math.cos(x)
  56507. , M = t * Math.sin(x);
  56508. A.x = I.x + (S * _.x + M * b.x),
  56509. A.y = I.y + (S * _.y + M * b.y),
  56510. A.z = I.z + (S * _.z + M * b.z),
  56511. p.setXYZ(m, A.x, A.y, A.z),
  56512. y.subVectors(A, I).normalize(),
  56513. f.setXYZ(m, y.x, y.y, y.z),
  56514. C.x = l / i,
  56515. C.y = c / r,
  56516. g.setXY(m, C.x, C.y),
  56517. m++
  56518. }
  56519. }
  56520. for (c = 1; c <= i; c++)
  56521. for (l = 1; l <= r; l++) {
  56522. var R = (r + 1) * (c - 1) + (l - 1)
  56523. , P = (r + 1) * c + (l - 1)
  56524. , O = (r + 1) * c + l
  56525. , L = (r + 1) * (c - 1) + l;
  56526. d.setX(v, R),
  56527. v++,
  56528. d.setX(v, P),
  56529. v++,
  56530. d.setX(v, L),
  56531. v++,
  56532. d.setX(v, P),
  56533. v++,
  56534. d.setX(v, O),
  56535. v++,
  56536. d.setX(v, L),
  56537. v++
  56538. }
  56539. this.setIndex(d),
  56540. this.addAttribute("position", p),
  56541. this.addAttribute("normal", f),
  56542. this.addAttribute("uv", g)
  56543. }
  56544. ,
  56545. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56546. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  56547. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  56548. n.Geometry.call(this),
  56549. this.type = "TorusKnotGeometry",
  56550. this.parameters = {
  56551. radius: e,
  56552. tube: t,
  56553. tubularSegments: i,
  56554. radialSegments: r,
  56555. p: o,
  56556. q: a
  56557. },
  56558. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  56559. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  56560. this.mergeVertices()
  56561. }
  56562. ,
  56563. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  56564. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  56565. n.TubeGeometry = function(e, t, i, r, o, a) {
  56566. function s(e, t, i) {
  56567. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  56568. }
  56569. n.Geometry.call(this),
  56570. this.type = "TubeGeometry",
  56571. this.parameters = {
  56572. path: e,
  56573. segments: t,
  56574. radius: i,
  56575. radialSegments: r,
  56576. closed: o,
  56577. taper: a
  56578. },
  56579. t = t || 64,
  56580. i = i || 1,
  56581. r = r || 8,
  56582. o = o || !1,
  56583. a = a || n.TubeGeometry.NoTaper;
  56584. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  56585. for (this.tangents = D,
  56586. this.normals = N,
  56587. this.binormals = B,
  56588. v = 0; v < P; v++)
  56589. for (M[v] = [],
  56590. u = v / (P - 1),
  56591. m = e.getPointAt(u),
  56592. l = D[v],
  56593. c = N[v],
  56594. h = B[v],
  56595. p = i * a(u),
  56596. A = 0; A < r; A++)
  56597. d = A / r * 2 * Math.PI,
  56598. f = -p * Math.cos(d),
  56599. g = p * Math.sin(d),
  56600. O.copy(m),
  56601. O.x += f * c.x + g * h.x,
  56602. O.y += f * c.y + g * h.y,
  56603. O.z += f * c.z + g * h.z,
  56604. M[v][A] = s(O.x, O.y, O.z);
  56605. for (v = 0; v < t; v++)
  56606. for (A = 0; A < r; A++)
  56607. y = o ? (v + 1) % t : v + 1,
  56608. C = (A + 1) % r,
  56609. I = M[v][A],
  56610. E = M[y][A],
  56611. b = M[y][C],
  56612. w = M[v][C],
  56613. _ = new n.Vector2(v / t,A / r),
  56614. T = new n.Vector2((v + 1) / t,A / r),
  56615. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  56616. S = new n.Vector2(v / t,(A + 1) / r),
  56617. this.faces.push(new n.Face3(I,E,w)),
  56618. this.faceVertexUvs[0].push([_, T, S]),
  56619. this.faces.push(new n.Face3(E,b,w)),
  56620. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  56621. this.computeFaceNormals(),
  56622. this.computeVertexNormals()
  56623. }
  56624. ,
  56625. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  56626. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  56627. n.TubeGeometry.NoTaper = function(e) {
  56628. return 1
  56629. }
  56630. ,
  56631. n.TubeGeometry.SinusoidalTaper = function(e) {
  56632. return Math.sin(Math.PI * e)
  56633. }
  56634. ,
  56635. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  56636. function r() {
  56637. f[0] = new n.Vector3,
  56638. g[0] = new n.Vector3,
  56639. a = Number.MAX_VALUE,
  56640. s = Math.abs(p[0].x),
  56641. l = Math.abs(p[0].y),
  56642. c = Math.abs(p[0].z),
  56643. s <= a && (a = s,
  56644. d.set(1, 0, 0)),
  56645. l <= a && (a = l,
  56646. d.set(0, 1, 0)),
  56647. c <= a && d.set(0, 0, 1),
  56648. m.crossVectors(p[0], d).normalize(),
  56649. f[0].crossVectors(p[0], m),
  56650. g[0].crossVectors(p[0], f[0])
  56651. }
  56652. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  56653. for (this.tangents = p,
  56654. this.normals = f,
  56655. this.binormals = g,
  56656. h = 0; h < A; h++)
  56657. u = h / (A - 1),
  56658. p[h] = e.getTangentAt(u),
  56659. p[h].normalize();
  56660. for (r(),
  56661. h = 1; h < A; h++)
  56662. f[h] = f[h - 1].clone(),
  56663. g[h] = g[h - 1].clone(),
  56664. m.crossVectors(p[h - 1], p[h]),
  56665. m.length() > Number.EPSILON && (m.normalize(),
  56666. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  56667. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  56668. g[h].crossVectors(p[h], f[h]);
  56669. if (i)
  56670. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  56671. o /= A - 1,
  56672. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  56673. h = 1; h < A; h++)
  56674. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  56675. g[h].crossVectors(p[h], f[h])
  56676. }
  56677. ,
  56678. n.PolyhedronGeometry = function(e, t, i, r) {
  56679. function o(e) {
  56680. var t = e.normalize().clone();
  56681. t.index = u.vertices.push(t) - 1;
  56682. var i = l(e) / 2 / Math.PI + .5
  56683. , r = c(e) / Math.PI + .5;
  56684. return t.uv = new n.Vector2(i,1 - r),
  56685. t
  56686. }
  56687. function a(e, t, i, r) {
  56688. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  56689. u.faces.push(o),
  56690. C.copy(e).add(t).add(i).divideScalar(3);
  56691. var a = l(C);
  56692. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  56693. }
  56694. function s(e, t) {
  56695. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  56696. l[h] = [];
  56697. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  56698. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  56699. }
  56700. for (var h = 0; h < i; h++)
  56701. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  56702. var m = Math.floor(g / 2);
  56703. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  56704. }
  56705. }
  56706. function l(e) {
  56707. return Math.atan2(e.z, -e.x)
  56708. }
  56709. function c(e) {
  56710. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  56711. }
  56712. function h(e, t, i) {
  56713. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  56714. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  56715. e.clone()
  56716. }
  56717. n.Geometry.call(this),
  56718. this.type = "PolyhedronGeometry",
  56719. this.parameters = {
  56720. vertices: e,
  56721. indices: t,
  56722. radius: i,
  56723. detail: r
  56724. },
  56725. i = i || 1,
  56726. r = r || 0;
  56727. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  56728. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  56729. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  56730. m++) {
  56731. var v = f[t[d]]
  56732. , A = f[t[d + 1]]
  56733. , y = f[t[d + 2]];
  56734. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  56735. }
  56736. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  56737. s(g[d], r);
  56738. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  56739. var I = this.faceVertexUvs[0][d]
  56740. , E = I[0].x
  56741. , b = I[1].x
  56742. , w = I[2].x
  56743. , _ = Math.max(E, b, w)
  56744. , T = Math.min(E, b, w);
  56745. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  56746. b < .2 && (I[1].x += 1),
  56747. w < .2 && (I[2].x += 1))
  56748. }
  56749. for (var d = 0, p = this.vertices.length; d < p; d++)
  56750. this.vertices[d].multiplyScalar(i);
  56751. this.mergeVertices(),
  56752. this.computeFaceNormals(),
  56753. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  56754. }
  56755. ,
  56756. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  56757. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  56758. n.DodecahedronGeometry = function(e, t) {
  56759. var i = (1 + Math.sqrt(5)) / 2
  56760. , r = 1 / i
  56761. , o = [-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, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  56762. , a = [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];
  56763. n.PolyhedronGeometry.call(this, o, a, e, t),
  56764. this.type = "DodecahedronGeometry",
  56765. this.parameters = {
  56766. radius: e,
  56767. detail: t
  56768. }
  56769. }
  56770. ,
  56771. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56772. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  56773. n.IcosahedronGeometry = function(e, t) {
  56774. var i = (1 + Math.sqrt(5)) / 2
  56775. , r = [-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]
  56776. , o = [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];
  56777. n.PolyhedronGeometry.call(this, r, o, e, t),
  56778. this.type = "IcosahedronGeometry",
  56779. this.parameters = {
  56780. radius: e,
  56781. detail: t
  56782. }
  56783. }
  56784. ,
  56785. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56786. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  56787. n.OctahedronGeometry = function(e, t) {
  56788. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  56789. , r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  56790. n.PolyhedronGeometry.call(this, i, r, e, t),
  56791. this.type = "OctahedronGeometry",
  56792. this.parameters = {
  56793. radius: e,
  56794. detail: t
  56795. }
  56796. }
  56797. ,
  56798. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56799. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  56800. n.TetrahedronGeometry = function(e, t) {
  56801. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  56802. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  56803. n.PolyhedronGeometry.call(this, i, r, e, t),
  56804. this.type = "TetrahedronGeometry",
  56805. this.parameters = {
  56806. radius: e,
  56807. detail: t
  56808. }
  56809. }
  56810. ,
  56811. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56812. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  56813. n.ParametricGeometry = function(e, t, i) {
  56814. n.Geometry.call(this),
  56815. this.type = "ParametricGeometry",
  56816. this.parameters = {
  56817. func: e,
  56818. slices: t,
  56819. stacks: i
  56820. };
  56821. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  56822. for (r = 0; r <= i; r++)
  56823. for (l = r / i,
  56824. o = 0; o <= t; o++)
  56825. s = o / t,
  56826. a = e(s, l),
  56827. c.push(a);
  56828. var p, f, g, m, v, A, y, C;
  56829. for (r = 0; r < i; r++)
  56830. for (o = 0; o < t; o++)
  56831. p = r * d + o,
  56832. f = r * d + o + 1,
  56833. g = (r + 1) * d + o + 1,
  56834. m = (r + 1) * d + o,
  56835. v = new n.Vector2(o / t,r / i),
  56836. A = new n.Vector2((o + 1) / t,r / i),
  56837. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  56838. C = new n.Vector2(o / t,(r + 1) / i),
  56839. h.push(new n.Face3(p,f,m)),
  56840. u.push([v, A, C]),
  56841. h.push(new n.Face3(f,g,m)),
  56842. u.push([A.clone(), y, C.clone()]);
  56843. this.computeFaceNormals(),
  56844. this.computeVertexNormals()
  56845. }
  56846. ,
  56847. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  56848. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  56849. n.WireframeGeometry = function(e) {
  56850. function t(e, t) {
  56851. return e - t
  56852. }
  56853. n.BufferGeometry.call(this);
  56854. var i = [0, 0]
  56855. , r = {}
  56856. , o = ["a", "b", "c"];
  56857. if (e instanceof n.Geometry) {
  56858. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  56859. for (var d = s[h], p = 0; p < 3; p++) {
  56860. i[0] = d[o[p]],
  56861. i[1] = d[o[(p + 1) % 3]],
  56862. i.sort(t);
  56863. var f = i.toString();
  56864. void 0 === r[f] && (c[2 * l] = i[0],
  56865. c[2 * l + 1] = i[1],
  56866. r[f] = !0,
  56867. l++)
  56868. }
  56869. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56870. for (var p = 0; p < 2; p++) {
  56871. var m = a[c[2 * h + p]]
  56872. , v = 6 * h + 3 * p;
  56873. g[v + 0] = m.x,
  56874. g[v + 1] = m.y,
  56875. g[v + 2] = m.z
  56876. }
  56877. this.addAttribute("position", new n.BufferAttribute(g,3))
  56878. } else if (e instanceof n.BufferGeometry)
  56879. if (null !== e.index) {
  56880. var A = e.index.array
  56881. , a = e.attributes.position
  56882. , y = e.groups
  56883. , l = 0;
  56884. 0 === y.length && e.addGroup(0, A.length);
  56885. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  56886. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  56887. for (var p = 0; p < 3; p++) {
  56888. i[0] = A[h + p],
  56889. i[1] = A[h + (p + 1) % 3],
  56890. i.sort(t);
  56891. var f = i.toString();
  56892. void 0 === r[f] && (c[2 * l] = i[0],
  56893. c[2 * l + 1] = i[1],
  56894. r[f] = !0,
  56895. l++)
  56896. }
  56897. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56898. for (var p = 0; p < 2; p++) {
  56899. var v = 6 * h + 3 * p
  56900. , T = c[2 * h + p];
  56901. g[v + 0] = a.getX(T),
  56902. g[v + 1] = a.getY(T),
  56903. g[v + 2] = a.getZ(T)
  56904. }
  56905. this.addAttribute("position", new n.BufferAttribute(g,3))
  56906. } else {
  56907. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  56908. for (var p = 0; p < 3; p++) {
  56909. var v = 18 * h + 6 * p
  56910. , S = 9 * h + 3 * p;
  56911. g[v + 0] = a[S],
  56912. g[v + 1] = a[S + 1],
  56913. g[v + 2] = a[S + 2];
  56914. var T = 9 * h + 3 * ((p + 1) % 3);
  56915. g[v + 3] = a[T],
  56916. g[v + 4] = a[T + 1],
  56917. g[v + 5] = a[T + 2]
  56918. }
  56919. this.addAttribute("position", new n.BufferAttribute(g,3))
  56920. }
  56921. }
  56922. ,
  56923. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56924. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  56925. n.AxisHelper = function(e) {
  56926. e = e || 1;
  56927. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  56928. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  56929. , r = new n.BufferGeometry;
  56930. r.addAttribute("position", new n.BufferAttribute(t,3)),
  56931. r.addAttribute("color", new n.BufferAttribute(i,3));
  56932. var o = new n.LineBasicMaterial({
  56933. vertexColors: n.VertexColors
  56934. });
  56935. n.LineSegments.call(this, r, o)
  56936. }
  56937. ,
  56938. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  56939. n.AxisHelper.prototype.constructor = n.AxisHelper,
  56940. n.ArrowHelper = function() {
  56941. var e = new n.Geometry;
  56942. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  56943. var t = new n.CylinderGeometry(0,.5,1,5,1);
  56944. return t.translate(0, -.5, 0),
  56945. function(i, r, o, a, s, l) {
  56946. n.Object3D.call(this),
  56947. void 0 === a && (a = 16776960),
  56948. void 0 === o && (o = 1),
  56949. void 0 === s && (s = .2 * o),
  56950. void 0 === l && (l = .2 * s),
  56951. this.position.copy(r),
  56952. this.line = new n.Line(e,new n.LineBasicMaterial({
  56953. color: a
  56954. })),
  56955. this.line.matrixAutoUpdate = !1,
  56956. this.add(this.line),
  56957. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  56958. color: a
  56959. })),
  56960. this.cone.matrixAutoUpdate = !1,
  56961. this.add(this.cone),
  56962. this.setDirection(i),
  56963. this.setLength(o, s, l)
  56964. }
  56965. }(),
  56966. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  56967. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  56968. n.ArrowHelper.prototype.setDirection = function() {
  56969. var e, t = new n.Vector3;
  56970. return function(i) {
  56971. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  56972. e = Math.acos(i.y),
  56973. this.quaternion.setFromAxisAngle(t, e))
  56974. }
  56975. }(),
  56976. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  56977. void 0 === t && (t = .2 * e),
  56978. void 0 === i && (i = .2 * t),
  56979. this.line.scale.set(1, Math.max(0, e - t), 1),
  56980. this.line.updateMatrix(),
  56981. this.cone.scale.set(i, t, i),
  56982. this.cone.position.y = e,
  56983. this.cone.updateMatrix()
  56984. }
  56985. ,
  56986. n.ArrowHelper.prototype.setColor = function(e) {
  56987. this.line.material.color.set(e),
  56988. this.cone.material.color.set(e)
  56989. }
  56990. ,
  56991. n.BoxHelper = function(e) {
  56992. 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])
  56993. , i = new Float32Array(24)
  56994. , r = new n.BufferGeometry;
  56995. r.setIndex(new n.BufferAttribute(t,1)),
  56996. r.addAttribute("position", new n.BufferAttribute(i,3)),
  56997. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  56998. color: 16776960
  56999. })),
  57000. void 0 !== e && this.update(e)
  57001. }
  57002. ,
  57003. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57004. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57005. n.BoxHelper.prototype.update = function() {
  57006. var e = new n.Box3;
  57007. return function(t) {
  57008. if (e.setFromObject(t),
  57009. !e.isEmpty()) {
  57010. var i = e.min
  57011. , n = e.max
  57012. , r = this.geometry.attributes.position
  57013. , o = r.array;
  57014. o[0] = n.x,
  57015. o[1] = n.y,
  57016. o[2] = n.z,
  57017. o[3] = i.x,
  57018. o[4] = n.y,
  57019. o[5] = n.z,
  57020. o[6] = i.x,
  57021. o[7] = i.y,
  57022. o[8] = n.z,
  57023. o[9] = n.x,
  57024. o[10] = i.y,
  57025. o[11] = n.z,
  57026. o[12] = n.x,
  57027. o[13] = n.y,
  57028. o[14] = i.z,
  57029. o[15] = i.x,
  57030. o[16] = n.y,
  57031. o[17] = i.z,
  57032. o[18] = i.x,
  57033. o[19] = i.y,
  57034. o[20] = i.z,
  57035. o[21] = n.x,
  57036. o[22] = i.y,
  57037. o[23] = i.z,
  57038. r.needsUpdate = !0,
  57039. this.geometry.computeBoundingSphere()
  57040. }
  57041. }
  57042. }(),
  57043. n.BoundingBoxHelper = function(e, t) {
  57044. var i = void 0 !== t ? t : 8947848;
  57045. this.object = e,
  57046. this.box = new n.Box3,
  57047. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57048. color: i,
  57049. wireframe: !0
  57050. }))
  57051. }
  57052. ,
  57053. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57054. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57055. n.BoundingBoxHelper.prototype.update = function() {
  57056. this.box.setFromObject(this.object),
  57057. this.box.size(this.scale),
  57058. this.box.center(this.position)
  57059. }
  57060. ,
  57061. n.CameraHelper = function(e) {
  57062. function t(e, t, n) {
  57063. i(e, n),
  57064. i(t, n)
  57065. }
  57066. function i(e, t) {
  57067. r.vertices.push(new n.Vector3),
  57068. r.colors.push(new n.Color(t)),
  57069. void 0 === a[e] && (a[e] = []),
  57070. a[e].push(r.vertices.length - 1)
  57071. }
  57072. var r = new n.Geometry
  57073. , o = new n.LineBasicMaterial({
  57074. color: 16777215,
  57075. vertexColors: n.FaceColors
  57076. })
  57077. , a = {}
  57078. , s = 16755200
  57079. , l = 16711680
  57080. , c = 43775
  57081. , h = 16777215
  57082. , u = 3355443;
  57083. t("n1", "n2", s),
  57084. t("n2", "n4", s),
  57085. t("n4", "n3", s),
  57086. t("n3", "n1", s),
  57087. t("f1", "f2", s),
  57088. t("f2", "f4", s),
  57089. t("f4", "f3", s),
  57090. t("f3", "f1", s),
  57091. t("n1", "f1", s),
  57092. t("n2", "f2", s),
  57093. t("n3", "f3", s),
  57094. t("n4", "f4", s),
  57095. t("p", "n1", l),
  57096. t("p", "n2", l),
  57097. t("p", "n3", l),
  57098. t("p", "n4", l),
  57099. t("u1", "u2", c),
  57100. t("u2", "u3", c),
  57101. t("u3", "u1", c),
  57102. t("c", "t", h),
  57103. t("p", "c", u),
  57104. t("cn1", "cn2", u),
  57105. t("cn3", "cn4", u),
  57106. t("cf1", "cf2", u),
  57107. t("cf3", "cf4", u),
  57108. n.LineSegments.call(this, r, o),
  57109. this.camera = e,
  57110. this.camera.updateProjectionMatrix(),
  57111. this.matrix = e.matrixWorld,
  57112. this.matrixAutoUpdate = !1,
  57113. this.pointMap = a,
  57114. this.update()
  57115. }
  57116. ,
  57117. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57118. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57119. n.CameraHelper.prototype.update = function() {
  57120. function e(e, n, a, s) {
  57121. r.set(n, a, s).unproject(o);
  57122. var l = i[e];
  57123. if (void 0 !== l)
  57124. for (var c = 0, h = l.length; c < h; c++)
  57125. t.vertices[l[c]].copy(r)
  57126. }
  57127. var t, i, r = new n.Vector3, o = new n.Camera;
  57128. return function() {
  57129. t = this.geometry,
  57130. i = this.pointMap;
  57131. var n = 1
  57132. , r = 1;
  57133. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57134. e("c", 0, 0, -1),
  57135. e("t", 0, 0, 1),
  57136. e("n1", -n, -r, -1),
  57137. e("n2", n, -r, -1),
  57138. e("n3", -n, r, -1),
  57139. e("n4", n, r, -1),
  57140. e("f1", -n, -r, 1),
  57141. e("f2", n, -r, 1),
  57142. e("f3", -n, r, 1),
  57143. e("f4", n, r, 1),
  57144. e("u1", .7 * n, 1.1 * r, -1),
  57145. e("u2", .7 * -n, 1.1 * r, -1),
  57146. e("u3", 0, 2 * r, -1),
  57147. e("cf1", -n, 0, 1),
  57148. e("cf2", n, 0, 1),
  57149. e("cf3", 0, -r, 1),
  57150. e("cf4", 0, r, 1),
  57151. e("cn1", -n, 0, -1),
  57152. e("cn2", n, 0, -1),
  57153. e("cn3", 0, -r, -1),
  57154. e("cn4", 0, r, -1),
  57155. t.verticesNeedUpdate = !0
  57156. }
  57157. }(),
  57158. n.DirectionalLightHelper = function(e, t) {
  57159. n.Object3D.call(this),
  57160. this.light = e,
  57161. this.light.updateMatrixWorld(),
  57162. this.matrix = e.matrixWorld,
  57163. this.matrixAutoUpdate = !1,
  57164. t = t || 1;
  57165. var i = new n.Geometry;
  57166. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  57167. var r = new n.LineBasicMaterial({
  57168. fog: !1
  57169. });
  57170. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57171. this.lightPlane = new n.Line(i,r),
  57172. this.add(this.lightPlane),
  57173. i = new n.Geometry,
  57174. i.vertices.push(new n.Vector3, new n.Vector3),
  57175. r = new n.LineBasicMaterial({
  57176. fog: !1
  57177. }),
  57178. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57179. this.targetLine = new n.Line(i,r),
  57180. this.add(this.targetLine),
  57181. this.update()
  57182. }
  57183. ,
  57184. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57185. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57186. n.DirectionalLightHelper.prototype.dispose = function() {
  57187. this.lightPlane.geometry.dispose(),
  57188. this.lightPlane.material.dispose(),
  57189. this.targetLine.geometry.dispose(),
  57190. this.targetLine.material.dispose()
  57191. }
  57192. ,
  57193. n.DirectionalLightHelper.prototype.update = function() {
  57194. var e = new n.Vector3
  57195. , t = new n.Vector3
  57196. , i = new n.Vector3;
  57197. return function() {
  57198. e.setFromMatrixPosition(this.light.matrixWorld),
  57199. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57200. i.subVectors(t, e),
  57201. this.lightPlane.lookAt(i),
  57202. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57203. this.targetLine.geometry.vertices[1].copy(i),
  57204. this.targetLine.geometry.verticesNeedUpdate = !0,
  57205. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57206. }
  57207. }(),
  57208. n.EdgesHelper = function(e, t, i) {
  57209. var r = void 0 !== t ? t : 16777215;
  57210. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57211. color: r
  57212. })),
  57213. this.matrix = e.matrixWorld,
  57214. this.matrixAutoUpdate = !1
  57215. }
  57216. ,
  57217. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57218. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57219. n.FaceNormalsHelper = function(e, t, i, r) {
  57220. this.object = e,
  57221. this.size = void 0 !== t ? t : 1;
  57222. var o = void 0 !== i ? i : 16776960
  57223. , a = void 0 !== r ? r : 1
  57224. , s = 0
  57225. , l = this.object.geometry;
  57226. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57227. var c = new n.BufferGeometry
  57228. , h = new n.Float32Attribute(2 * s * 3,3);
  57229. c.addAttribute("position", h),
  57230. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57231. color: o,
  57232. linewidth: a
  57233. })),
  57234. this.matrixAutoUpdate = !1,
  57235. this.update()
  57236. }
  57237. ,
  57238. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57239. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57240. n.FaceNormalsHelper.prototype.update = function() {
  57241. var e = new n.Vector3
  57242. , t = new n.Vector3
  57243. , i = new n.Matrix3;
  57244. return function() {
  57245. this.object.updateMatrixWorld(!0),
  57246. i.getNormalMatrix(this.object.matrixWorld);
  57247. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  57248. var u = s[c]
  57249. , d = u.normal;
  57250. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57251. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57252. r.setXYZ(l, e.x, e.y, e.z),
  57253. l += 1,
  57254. r.setXYZ(l, t.x, t.y, t.z),
  57255. l += 1
  57256. }
  57257. return r.needsUpdate = !0,
  57258. this
  57259. }
  57260. }(),
  57261. n.GridHelper = function(e, t) {
  57262. var i = new n.Geometry
  57263. , r = new n.LineBasicMaterial({
  57264. vertexColors: n.VertexColors
  57265. });
  57266. this.color1 = new n.Color(4473924),
  57267. this.color2 = new n.Color(8947848);
  57268. for (var o = -e; o <= e; o += t) {
  57269. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  57270. var a = 0 === o ? this.color1 : this.color2;
  57271. i.colors.push(a, a, a, a)
  57272. }
  57273. n.LineSegments.call(this, i, r)
  57274. }
  57275. ,
  57276. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57277. n.GridHelper.prototype.constructor = n.GridHelper,
  57278. n.GridHelper.prototype.setColors = function(e, t) {
  57279. this.color1.set(e),
  57280. this.color2.set(t),
  57281. this.geometry.colorsNeedUpdate = !0
  57282. }
  57283. ,
  57284. n.HemisphereLightHelper = function(e, t) {
  57285. n.Object3D.call(this),
  57286. this.light = e,
  57287. this.light.updateMatrixWorld(),
  57288. this.matrix = e.matrixWorld,
  57289. this.matrixAutoUpdate = !1,
  57290. this.colors = [new n.Color, new n.Color];
  57291. var i = new n.SphereGeometry(t,4,2);
  57292. i.rotateX(-Math.PI / 2);
  57293. for (var r = 0, o = 8; r < o; r++)
  57294. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57295. var a = new n.MeshBasicMaterial({
  57296. vertexColors: n.FaceColors,
  57297. wireframe: !0
  57298. });
  57299. this.lightSphere = new n.Mesh(i,a),
  57300. this.add(this.lightSphere),
  57301. this.update()
  57302. }
  57303. ,
  57304. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57305. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57306. n.HemisphereLightHelper.prototype.dispose = function() {
  57307. this.lightSphere.geometry.dispose(),
  57308. this.lightSphere.material.dispose()
  57309. }
  57310. ,
  57311. n.HemisphereLightHelper.prototype.update = function() {
  57312. var e = new n.Vector3;
  57313. return function() {
  57314. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57315. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57316. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57317. this.lightSphere.geometry.colorsNeedUpdate = !0
  57318. }
  57319. }(),
  57320. n.PointLightHelper = function(e, t) {
  57321. this.light = e,
  57322. this.light.updateMatrixWorld();
  57323. var i = new n.SphereGeometry(t,4,2)
  57324. , r = new n.MeshBasicMaterial({
  57325. wireframe: !0,
  57326. fog: !1
  57327. });
  57328. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57329. n.Mesh.call(this, i, r),
  57330. this.matrix = this.light.matrixWorld,
  57331. this.matrixAutoUpdate = !1
  57332. }
  57333. ,
  57334. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57335. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57336. n.PointLightHelper.prototype.dispose = function() {
  57337. this.geometry.dispose(),
  57338. this.material.dispose()
  57339. }
  57340. ,
  57341. n.PointLightHelper.prototype.update = function() {
  57342. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57343. }
  57344. ,
  57345. n.SkeletonHelper = function(e) {
  57346. this.bones = this.getBoneList(e);
  57347. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57348. var r = this.bones[i];
  57349. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57350. t.vertices.push(new n.Vector3),
  57351. t.colors.push(new n.Color(0,0,1)),
  57352. t.colors.push(new n.Color(0,1,0)))
  57353. }
  57354. t.dynamic = !0;
  57355. var o = new n.LineBasicMaterial({
  57356. vertexColors: n.VertexColors,
  57357. depthTest: !1,
  57358. depthWrite: !1,
  57359. transparent: !0
  57360. });
  57361. n.LineSegments.call(this, t, o),
  57362. this.root = e,
  57363. this.matrix = e.matrixWorld,
  57364. this.matrixAutoUpdate = !1,
  57365. this.update()
  57366. }
  57367. ,
  57368. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57369. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57370. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57371. var t = [];
  57372. e instanceof n.Bone && t.push(e);
  57373. for (var i = 0; i < e.children.length; i++)
  57374. t.push.apply(t, this.getBoneList(e.children[i]));
  57375. return t
  57376. }
  57377. ,
  57378. n.SkeletonHelper.prototype.update = function() {
  57379. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  57380. var a = this.bones[o];
  57381. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57382. e.vertices[r].setFromMatrixPosition(i),
  57383. i.multiplyMatrices(t, a.parent.matrixWorld),
  57384. e.vertices[r + 1].setFromMatrixPosition(i),
  57385. r += 2)
  57386. }
  57387. e.verticesNeedUpdate = !0,
  57388. e.computeBoundingSphere()
  57389. }
  57390. ,
  57391. n.SpotLightHelper = function(e) {
  57392. n.Object3D.call(this),
  57393. this.light = e,
  57394. this.light.updateMatrixWorld(),
  57395. this.matrix = e.matrixWorld,
  57396. this.matrixAutoUpdate = !1;
  57397. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57398. t.translate(0, -.5, 0),
  57399. t.rotateX(-Math.PI / 2);
  57400. var i = new n.MeshBasicMaterial({
  57401. wireframe: !0,
  57402. fog: !1
  57403. });
  57404. this.cone = new n.Mesh(t,i),
  57405. this.add(this.cone),
  57406. this.update()
  57407. }
  57408. ,
  57409. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57410. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57411. n.SpotLightHelper.prototype.dispose = function() {
  57412. this.cone.geometry.dispose(),
  57413. this.cone.material.dispose()
  57414. }
  57415. ,
  57416. n.SpotLightHelper.prototype.update = function() {
  57417. var e = new n.Vector3
  57418. , t = new n.Vector3;
  57419. return function() {
  57420. var i = this.light.distance ? this.light.distance : 1e4
  57421. , n = i * Math.tan(this.light.angle);
  57422. this.cone.scale.set(n, n, i),
  57423. e.setFromMatrixPosition(this.light.matrixWorld),
  57424. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57425. this.cone.lookAt(t.sub(e)),
  57426. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57427. }
  57428. }(),
  57429. n.VertexNormalsHelper = function(e, t, i, r) {
  57430. this.object = e,
  57431. this.size = void 0 !== t ? t : 1;
  57432. var o = void 0 !== i ? i : 16711680
  57433. , a = void 0 !== r ? r : 1
  57434. , s = 0
  57435. , l = this.object.geometry;
  57436. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57437. var c = new n.BufferGeometry
  57438. , h = new n.Float32Attribute(2 * s * 3,3);
  57439. c.addAttribute("position", h),
  57440. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57441. color: o,
  57442. linewidth: a
  57443. })),
  57444. this.matrixAutoUpdate = !1,
  57445. this.update()
  57446. }
  57447. ,
  57448. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57449. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  57450. n.VertexNormalsHelper.prototype.update = function() {
  57451. var e = new n.Vector3
  57452. , t = new n.Vector3
  57453. , i = new n.Matrix3;
  57454. return function() {
  57455. var r = ["a", "b", "c"];
  57456. this.object.updateMatrixWorld(!0),
  57457. i.getNormalMatrix(this.object.matrixWorld);
  57458. var o = this.object.matrixWorld
  57459. , a = this.geometry.attributes.position
  57460. , s = this.object.geometry;
  57461. if (s instanceof n.Geometry)
  57462. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  57463. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  57464. var m = l[p[r[f]]]
  57465. , v = p.vertexNormals[f];
  57466. e.copy(m).applyMatrix4(o),
  57467. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57468. a.setXYZ(h, e.x, e.y, e.z),
  57469. h += 1,
  57470. a.setXYZ(h, t.x, t.y, t.z),
  57471. h += 1
  57472. }
  57473. else if (s instanceof n.BufferGeometry)
  57474. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  57475. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  57476. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  57477. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57478. a.setXYZ(h, e.x, e.y, e.z),
  57479. h += 1,
  57480. a.setXYZ(h, t.x, t.y, t.z),
  57481. h += 1;
  57482. return a.needsUpdate = !0,
  57483. this
  57484. }
  57485. }(),
  57486. n.WireframeHelper = function(e, t) {
  57487. var i = void 0 !== t ? t : 16777215;
  57488. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  57489. color: i
  57490. })),
  57491. this.matrix = e.matrixWorld,
  57492. this.matrixAutoUpdate = !1
  57493. }
  57494. ,
  57495. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  57496. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  57497. n.ImmediateRenderObject = function(e) {
  57498. n.Object3D.call(this),
  57499. this.material = e,
  57500. this.render = function(e) {}
  57501. }
  57502. ,
  57503. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  57504. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  57505. n.MorphBlendMesh = function(e, t) {
  57506. n.Mesh.call(this, e, t),
  57507. this.animationsMap = {},
  57508. this.animationsList = [];
  57509. var i = this.geometry.morphTargets.length
  57510. , r = "__default"
  57511. , o = 0
  57512. , a = i - 1
  57513. , s = i / 1;
  57514. this.createAnimation(r, o, a, s),
  57515. this.setAnimationWeight(r, 1)
  57516. }
  57517. ,
  57518. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  57519. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  57520. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  57521. var r = {
  57522. start: t,
  57523. end: i,
  57524. length: i - t + 1,
  57525. fps: n,
  57526. duration: (i - t) / n,
  57527. lastFrame: 0,
  57528. currentFrame: 0,
  57529. active: !1,
  57530. time: 0,
  57531. direction: 1,
  57532. weight: 1,
  57533. directionBackwards: !1,
  57534. mirroredLoop: !1
  57535. };
  57536. this.animationsMap[e] = r,
  57537. this.animationsList.push(r)
  57538. }
  57539. ,
  57540. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  57541. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  57542. var s = r.morphTargets[o]
  57543. , l = s.name.match(i);
  57544. if (l && l.length > 1) {
  57545. var c = l[1];
  57546. n[c] || (n[c] = {
  57547. start: 1 / 0,
  57548. end: -(1 / 0)
  57549. });
  57550. var h = n[c];
  57551. o < h.start && (h.start = o),
  57552. o > h.end && (h.end = o),
  57553. t || (t = c)
  57554. }
  57555. }
  57556. for (var c in n) {
  57557. var h = n[c];
  57558. this.createAnimation(c, h.start, h.end, e)
  57559. }
  57560. this.firstAnimation = t
  57561. }
  57562. ,
  57563. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  57564. var t = this.animationsMap[e];
  57565. t && (t.direction = 1,
  57566. t.directionBackwards = !1)
  57567. }
  57568. ,
  57569. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  57570. var t = this.animationsMap[e];
  57571. t && (t.direction = -1,
  57572. t.directionBackwards = !0)
  57573. }
  57574. ,
  57575. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  57576. var i = this.animationsMap[e];
  57577. i && (i.fps = t,
  57578. i.duration = (i.end - i.start) / i.fps)
  57579. }
  57580. ,
  57581. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  57582. var i = this.animationsMap[e];
  57583. i && (i.duration = t,
  57584. i.fps = (i.end - i.start) / i.duration)
  57585. }
  57586. ,
  57587. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  57588. var i = this.animationsMap[e];
  57589. i && (i.weight = t)
  57590. }
  57591. ,
  57592. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  57593. var i = this.animationsMap[e];
  57594. i && (i.time = t)
  57595. }
  57596. ,
  57597. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  57598. var t = 0
  57599. , i = this.animationsMap[e];
  57600. return i && (t = i.time),
  57601. t
  57602. }
  57603. ,
  57604. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  57605. var t = -1
  57606. , i = this.animationsMap[e];
  57607. return i && (t = i.duration),
  57608. t
  57609. }
  57610. ,
  57611. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  57612. var t = this.animationsMap[e];
  57613. t ? (t.time = 0,
  57614. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  57615. }
  57616. ,
  57617. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  57618. var t = this.animationsMap[e];
  57619. t && (t.active = !1)
  57620. }
  57621. ,
  57622. n.MorphBlendMesh.prototype.update = function(e) {
  57623. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  57624. var r = this.animationsList[t];
  57625. if (r.active) {
  57626. var o = r.duration / r.length;
  57627. r.time += r.direction * e,
  57628. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  57629. r.time > r.duration && (r.time = r.duration,
  57630. r.directionBackwards = !0),
  57631. r.time < 0 && (r.time = 0,
  57632. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  57633. r.time < 0 && (r.time += r.duration));
  57634. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  57635. , s = r.weight;
  57636. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  57637. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  57638. this.morphTargetInfluences[a] = 0,
  57639. r.lastFrame = r.currentFrame,
  57640. r.currentFrame = a);
  57641. var l = r.time % o / o;
  57642. r.directionBackwards && (l = 1 - l),
  57643. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  57644. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  57645. }
  57646. }
  57647. }
  57648. ,
  57649. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  57650. i.THREE = n) : this.THREE = n
  57651. }
  57652. , {}]
  57653. }, {}, [116]);