main_2020_edit.js 2.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144
  1. hardwareHotList = {}
  2. //热点 设备控制
  3. $("#hotPannel .close").on('click',()=>{
  4. $("#hotPannel>div").css("display","");
  5. window.hotNeedUpdatePannel = null;
  6. })
  7. $("#hotPannel input.mui-switch").on('change',()=>{
  8. var ifOn = $('#hotPannel input.mui-switch').is(':checked');
  9. })
  10. var dom = {
  11. getOffset: function(e, t, i) {
  12. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  13. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  14. left += "left" == e ? t.offsetLeft : t.offsetTop;
  15. return left
  16. }
  17. };
  18. if (function() {
  19. "use strict";
  20. function o(e, t) {
  21. return typeof e === t
  22. }
  23. function a(e, t) {
  24. return e instanceof t
  25. }
  26. function s(e) {
  27. return e && e.nodeType
  28. }
  29. function l(e) {
  30. return s(e) ? e : a(e, y) ? e[0] : void 0
  31. }
  32. function e(e, i, n) {
  33. return y.each(e, function(e, t) {
  34. n = i.call(t, n, e, t)
  35. }),
  36. n
  37. }
  38. function t(e, t, i) {
  39. var n, r, o;
  40. if (e === t)
  41. return !0;
  42. if (!e || !t || e.constructor !== t.constructor)
  43. return !1;
  44. for (n = 0,
  45. r = i.length; n < r; n += 1) {
  46. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  47. return !1;
  48. if (e[o] !== t[o])
  49. return !1
  50. }
  51. return !0
  52. }
  53. function c(e, t, i, n) {
  54. this.left = w(e),
  55. this.top = w(t),
  56. this.width = w(i),
  57. this.height = w(n),
  58. this.right = this.left + this.width,
  59. this.bottom = this.top + this.height
  60. }
  61. function h(e, t, i, n) {
  62. this.visible = e || 0,
  63. this.viewport = t || 0,
  64. this.possible = i || 0,
  65. this.rects = n && I({}, n) || null
  66. }
  67. function r(e, t) {
  68. this.els = e,
  69. this.viewport = t
  70. }
  71. function n(e, t) {
  72. return e.val - t.val
  73. }
  74. function u(e, t) {
  75. return t.val - e.val
  76. }
  77. function d(e) {
  78. var t = c.ofContent(e, !0)
  79. , i = c.ofViewport(e, !0)
  80. , n = t.width - i.width
  81. , r = t.height - i.height;
  82. this.content = t,
  83. this.viewport = i,
  84. this.width = n <= 0 ? null : i.left / n,
  85. this.height = r <= 0 ? null : i.top / r,
  86. this.left = i.left,
  87. this.top = i.top,
  88. this.right = t.right - i.right,
  89. this.bottom = t.bottom - i.bottom
  90. }
  91. function p(e) {
  92. this.el = e || window
  93. }
  94. function f(e, t) {
  95. this.context = e,
  96. this.viewport = t,
  97. this.init()
  98. }
  99. function g(e, t, i, n) {
  100. this.context = new r(e,t),
  101. this.property = i,
  102. this.descending = n,
  103. this.init()
  104. }
  105. function m(e) {
  106. e && e !== window && e !== document ? (this.context = e,
  107. this.$autoTarget = y(e)) : this.context = window,
  108. this.init()
  109. }
  110. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  111. v = 1,
  112. function(e) {
  113. return e ? (i[e] || (i[e] = v,
  114. v += 1),
  115. i[e]) : 0
  116. }
  117. );
  118. I(c.prototype, {
  119. equals: function(e) {
  120. return t(this, e, ["left", "top", "width", "height"])
  121. },
  122. area: function() {
  123. return this.width * this.height
  124. },
  125. relativeTo: function(e) {
  126. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  127. },
  128. intersection: function(e) {
  129. if (!a(e, c))
  130. return null;
  131. var t = _(this.left, e.left)
  132. , i = b(this.right, e.right)
  133. , n = _(this.top, e.top)
  134. , r = i - t
  135. , o = b(this.bottom, e.bottom) - n;
  136. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  137. },
  138. envelope: function(e) {
  139. if (!a(e, c))
  140. return this;
  141. var t = b(this.left, e.left)
  142. , i = _(this.right, e.right)
  143. , n = b(this.top, e.top);
  144. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  145. }
  146. }),
  147. I(c, {
  148. ofContent: function(e, t) {
  149. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  150. },
  151. ofViewport: function(e, t) {
  152. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  153. },
  154. ofElement: function(e) {
  155. var t = y(e);
  156. if (!t.is(":visible"))
  157. return null;
  158. var i = t.offset();
  159. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  160. }
  161. }),
  162. I(h.prototype, {
  163. equals: function(e) {
  164. return this.fracsEqual(e) && this.rectsEqual(e)
  165. },
  166. fracsEqual: function(e) {
  167. return t(this, e, ["visible", "viewport", "possible"])
  168. },
  169. rectsEqual: function(e) {
  170. return t(this.rects, e.rects, ["document", "element", "viewport"])
  171. }
  172. }),
  173. I(h, {
  174. of: function(e, t) {
  175. var i, n, r;
  176. return e = s(e) && c.ofElement(e) || e,
  177. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  178. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  179. r = b(e.width, t.width) * b(e.height, t.height),
  180. new h(n / e.area(),n / t.area(),n / r,{
  181. document: i,
  182. element: i.relativeTo(e),
  183. viewport: i.relativeTo(t)
  184. })) : new h
  185. }
  186. });
  187. var x = ["width", "height", "left", "right", "top", "bottom"]
  188. , S = ["possible", "visible", "viewport"];
  189. I(r.prototype, {
  190. sorted: function(t, e) {
  191. var i = this.viewport;
  192. return y.map(this.els, function(e) {
  193. return {
  194. el: e,
  195. val: function(e, t, i) {
  196. var n;
  197. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  198. n ? n[i] : 0
  199. }(e, i, t)
  200. }
  201. }).sort(e ? u : n)
  202. },
  203. best: function(e, t) {
  204. return this.els.length ? this.sorted(e, t)[0] : null
  205. }
  206. }),
  207. I(d.prototype, {
  208. equals: function(e) {
  209. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  210. }
  211. }),
  212. I(p.prototype, {
  213. equals: function(e) {
  214. return t(this, e, ["el"])
  215. },
  216. scrollState: function() {
  217. return new d(this.el)
  218. },
  219. scrollTo: function(e, t, i) {
  220. var n = y(this.el === window ? "html,body" : this.el);
  221. e = e || 0,
  222. t = t || 0,
  223. i = isNaN(i) ? 1e3 : i,
  224. n.stop(!0).animate({
  225. scrollLeft: e,
  226. scrollTop: t
  227. }, i)
  228. },
  229. scroll: function(e, t, i) {
  230. var n = this.el === window ? A : y(this.el);
  231. e = e || 0,
  232. t = t || 0,
  233. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  234. },
  235. scrollToRect: function(e, t, i, n) {
  236. t = t || 0,
  237. i = i || 0,
  238. this.scrollTo(e.left - t, e.top - i, n)
  239. },
  240. scrollToElement: function(e, t, i, n) {
  241. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  242. this.scrollToRect(r, t, i, n)
  243. }
  244. });
  245. var M = {
  246. init: function() {
  247. this.callbacks = y.Callbacks("memory unique"),
  248. this.currVal = null,
  249. this.prevVal = null,
  250. this.checkProxy = y.proxy(this.check, this),
  251. this.autoCheck()
  252. },
  253. bind: function(e) {
  254. this.callbacks.add(e)
  255. },
  256. unbind: function(e) {
  257. e ? this.callbacks.remove(e) : this.callbacks.empty()
  258. },
  259. trigger: function() {
  260. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  261. },
  262. check: function(e) {
  263. var t = this.updatedValue(e);
  264. return void 0 !== t && (this.prevVal = this.currVal,
  265. this.currVal = t,
  266. this.trigger(),
  267. !0)
  268. },
  269. $autoTarget: A,
  270. autoEvents: "load resize scroll",
  271. autoCheck: function(e) {
  272. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  273. }
  274. };
  275. I(f.prototype, M, {
  276. updatedValue: function() {
  277. var e = h.of(this.context, this.viewport);
  278. return this.currVal && this.currVal.equals(e) ? void 0 : e
  279. }
  280. }),
  281. I(g.prototype, M, {
  282. updatedValue: function() {
  283. var e = this.context.best(this.property, this.descending);
  284. return e && (e = 0 < e.val ? e.el : null,
  285. this.currVal !== e) ? e : void 0
  286. }
  287. }),
  288. I(m.prototype, M, {
  289. updatedValue: function() {
  290. var e = new d(this.context);
  291. return this.currVal && this.currVal.equals(e) ? void 0 : e
  292. }
  293. });
  294. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  295. function H(e, t, i, n) {
  296. return i = N(i) ? i.apply(e, t) : i,
  297. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  298. }
  299. R = U,
  300. P = {
  301. statics: {
  302. version: "0.15.0",
  303. Rect: c,
  304. Fractions: h,
  305. Group: r,
  306. ScrollState: d,
  307. Viewport: p,
  308. FracsCallbacks: f,
  309. GroupCallbacks: g,
  310. ScrollStateCallbacks: m,
  311. fracs: function(e, t) {
  312. return h.of(e, t)
  313. }
  314. },
  315. methods: {
  316. content: function(e) {
  317. return this.length ? c.ofContent(this[0], e) : null
  318. },
  319. envelope: function() {
  320. return e(this, function(e) {
  321. var t = c.ofElement(this);
  322. return e ? e.envelope(t) : t
  323. })
  324. },
  325. fracs: function(e, i, n) {
  326. o(e, "string") || (n = i,
  327. i = e,
  328. e = null),
  329. E(i) || (n = i,
  330. i = null),
  331. n = l(n);
  332. var r = U + ".fracs." + T(n);
  333. return "unbind" === e ? this.each(function() {
  334. var e = y(this).data(r);
  335. e && e.unbind(i)
  336. }) : "check" === e ? this.each(function() {
  337. var e = y(this).data(r);
  338. e && e.check()
  339. }) : E(i) ? this.each(function() {
  340. var e = y(this)
  341. , t = e.data(r);
  342. t || (t = new f(this,n),
  343. e.data(r, t)),
  344. t.bind(i)
  345. }) : this.length ? h.of(this[0], n) : null
  346. },
  347. intersection: function() {
  348. return e(this, function(e) {
  349. var t = c.ofElement(this);
  350. return e ? e.intersection(t) : t
  351. })
  352. },
  353. max: function(e, t, i) {
  354. return E(t) || (i = t,
  355. t = null),
  356. i = l(i),
  357. t ? (new g(this,i,e,!0).bind(t),
  358. this) : this.pushStack(new r(this,i).best(e, !0).el)
  359. },
  360. min: function(e, t, i) {
  361. return E(t) || (i = t,
  362. t = null),
  363. i = l(i),
  364. t ? (new g(this,i,e).bind(t),
  365. this) : this.pushStack(new r(this,i).best(e).el)
  366. },
  367. rect: function() {
  368. return this.length ? c.ofElement(this[0]) : null
  369. },
  370. scrollState: function(e, i) {
  371. var n = U + ".scrollState";
  372. return o(e, "string") || (i = e,
  373. e = null),
  374. "unbind" === e ? this.each(function() {
  375. var e = y(this).data(n);
  376. e && e.unbind(i)
  377. }) : "check" === e ? this.each(function() {
  378. var e = y(this).data(n);
  379. e && e.check()
  380. }) : E(i) ? this.each(function() {
  381. var e = y(this)
  382. , t = e.data(n);
  383. t || (t = new m(this),
  384. e.data(n, t)),
  385. t.bind(i)
  386. }) : this.length ? new d(this[0]) : null
  387. },
  388. scroll: function(e, t, i) {
  389. return this.each(function() {
  390. new p(this).scroll(e, t, i)
  391. })
  392. },
  393. scrollTo: function(e, t, i, n) {
  394. return y.isNumeric(e) && (n = i,
  395. i = t,
  396. t = e,
  397. e = null),
  398. e = l(e),
  399. this.each(function() {
  400. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  401. })
  402. },
  403. scrollToThis: function(e, t, i, n) {
  404. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  405. this
  406. },
  407. softLink: function(t, i, n, r) {
  408. return r = new p(l(r)),
  409. this.filter("a[href^=#]").each(function() {
  410. var e = y(this);
  411. e.on("click", function() {
  412. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  413. })
  414. })
  415. },
  416. sort: function(e, t, i) {
  417. return o(t, "boolean") || (i = t,
  418. t = null),
  419. i = l(i),
  420. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  421. return e.el
  422. }))
  423. },
  424. viewport: function(e) {
  425. return this.length ? c.ofViewport(this[0], e) : null
  426. }
  427. },
  428. defaultStatic: "fracs",
  429. defaultMethod: "fracs"
  430. },
  431. O = [].slice,
  432. L = jQuery,
  433. D = L.extend,
  434. N = L.isFunction,
  435. F = D({}, P),
  436. B = function() {
  437. return H(this, O.call(arguments), F.defaultStatic, B)
  438. }
  439. ,
  440. V = function(e) {
  441. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  442. }
  443. ,
  444. (k = function(e) {
  445. e && (D(B, e.statics),
  446. D(V, e.methods)),
  447. B.modplug = k
  448. }
  449. ).prev = {
  450. statics: L[R],
  451. methods: L.fn[R]
  452. },
  453. k(P),
  454. L[R] = B,
  455. L.fn[R] = V
  456. }(),
  457. "undefined" == typeof jQuery)
  458. throw new Error("Bootstrap's JavaScript requires jQuery");
  459. !function(m) {
  460. "use strict";
  461. function r(e, t) {
  462. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  463. this.init("tooltip", e, t)
  464. }
  465. r.VERSION = "3.2.0",
  466. r.DEFAULTS = {
  467. animation: !0,
  468. placement: "top",
  469. selector: !1,
  470. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  471. trigger: "hover focus",
  472. title: "",
  473. delay: 0,
  474. html: !1,
  475. container: !1,
  476. viewport: {
  477. selector: "body",
  478. padding: 0
  479. }
  480. },
  481. r.prototype.init = function(e, t, i) {
  482. this.enabled = !0,
  483. this.type = e,
  484. this.$element = m(t),
  485. this.options = this.getOptions(i),
  486. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  487. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  488. var o = n[r];
  489. if ("click" == o)
  490. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  491. else if ("manual" != o) {
  492. var a = "hover" == o ? "mouseenter" : "focusin"
  493. , s = "hover" == o ? "mouseleave" : "focusout";
  494. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  495. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  496. }
  497. }
  498. this.options.selector ? this._options = m.extend({}, this.options, {
  499. trigger: "manual",
  500. selector: ""
  501. }) : this.fixTitle()
  502. }
  503. ,
  504. r.prototype.getDefaults = function() {
  505. return r.DEFAULTS
  506. }
  507. ,
  508. r.prototype.getOptions = function(e) {
  509. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  510. show: e.delay,
  511. hide: e.delay
  512. }),
  513. e
  514. }
  515. ,
  516. r.prototype.getDelegateOptions = function() {
  517. var i = {}
  518. , n = this.getDefaults();
  519. return this._options && m.each(this._options, function(e, t) {
  520. n[e] != t && (i[e] = t)
  521. }),
  522. i
  523. }
  524. ,
  525. r.prototype.enter = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "in",
  531. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  532. }
  533. ,
  534. r.prototype.leave = function(e) {
  535. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  536. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  537. m(e.currentTarget).data("bs." + this.type, t)),
  538. clearTimeout(t.timeout),
  539. t.hoverState = "out",
  540. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  541. "out" == t.hoverState && t.hide()
  542. }, t.options.delay.hide)) : t.hide()
  543. }
  544. ,
  545. r.prototype.show = function() {
  546. var e = m.Event("show.bs." + this.type);
  547. if (this.hasContent() && this.enabled) {
  548. this.$element.trigger(e);
  549. var t = m.contains(document.documentElement, this.$element[0]);
  550. if (e.isDefaultPrevented() || !t)
  551. return;
  552. var i = this
  553. , n = this.tip()
  554. , r = this.getUID(this.type);
  555. this.setContent(),
  556. n.attr("id", r),
  557. this.$element.attr("aria-describedby", r),
  558. this.options.animation && n.addClass("fade");
  559. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  560. , a = /\s?auto?\s?/i
  561. , s = a.test(o);
  562. s && (o = o.replace(a, "") || "top"),
  563. n.detach().css({
  564. top: 0,
  565. left: 0,
  566. display: "block"
  567. }).addClass(o).data("bs." + this.type, this),
  568. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  569. var l = this.getPosition()
  570. , c = n[0].offsetWidth
  571. , h = n[0].offsetHeight;
  572. if (s) {
  573. var u = o
  574. , d = this.$element.parent()
  575. , p = this.getPosition(d);
  576. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  577. n.removeClass(u).addClass(o)
  578. }
  579. var f = this.getCalculatedOffset(o, l, c, h);
  580. this.applyPlacement(f, o);
  581. var g = function() {
  582. i.$element.trigger("shown.bs." + i.type),
  583. i.hoverState = null
  584. };
  585. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  586. }
  587. }
  588. ,
  589. r.prototype.applyPlacement = function(e, t) {
  590. var i = this.tip()
  591. , n = i[0].offsetWidth
  592. , r = i[0].offsetHeight
  593. , o = parseInt(i.css("margin-top"), 10)
  594. , a = parseInt(i.css("margin-left"), 10);
  595. isNaN(o) && (o = 0),
  596. isNaN(a) && (a = 0),
  597. e.top = e.top + o,
  598. e.left = e.left + a,
  599. m.offset.setOffset(i[0], m.extend({
  600. using: function(e) {
  601. i.css({
  602. top: Math.round(e.top),
  603. left: Math.round(e.left)
  604. })
  605. }
  606. }, e), 0),
  607. i.addClass("in");
  608. var s = i[0].offsetWidth
  609. , l = i[0].offsetHeight;
  610. "top" == t && l != r && (e.top = e.top + r - l);
  611. var c = this.getViewportAdjustedDelta(t, e, s, l);
  612. c.left ? e.left += c.left : e.top += c.top;
  613. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  614. , u = c.left ? "left" : "top"
  615. , d = c.left ? "offsetWidth" : "offsetHeight";
  616. i.offset(e),
  617. this.replaceArrow(h, i[0][d], u)
  618. }
  619. ,
  620. r.prototype.replaceArrow = function(e, t, i) {
  621. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  622. }
  623. ,
  624. r.prototype.setContent = function() {
  625. var e = this.tip()
  626. , t = this.getTitle();
  627. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  628. e.removeClass("fade in top bottom left right")
  629. }
  630. ,
  631. r.prototype.hide = function() {
  632. function e() {
  633. "in" != t.hoverState && i.detach(),
  634. t.$element.trigger("hidden.bs." + t.type)
  635. }
  636. var t = this
  637. , i = this.tip()
  638. , n = m.Event("hide.bs." + this.type);
  639. if (this.$element.removeAttr("aria-describedby"),
  640. this.$element.trigger(n),
  641. !n.isDefaultPrevented())
  642. return i.removeClass("in"),
  643. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  644. this.hoverState = null,
  645. this
  646. }
  647. ,
  648. r.prototype.fixTitle = function() {
  649. var e = this.$element;
  650. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  651. }
  652. ,
  653. r.prototype.hasContent = function() {
  654. return this.getTitle()
  655. }
  656. ,
  657. r.prototype.getPosition = function(e) {
  658. var t = (e = e || this.$element)[0]
  659. , i = "BODY" == t.tagName;
  660. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  661. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  662. width: i ? m(window).width() : e.outerWidth(),
  663. height: i ? m(window).height() : e.outerHeight()
  664. }, i ? {
  665. top: 0,
  666. left: 0
  667. } : e.offset())
  668. }
  669. ,
  670. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  671. return "bottom" == e ? {
  672. top: t.top + t.height,
  673. left: t.left + t.width / 2 - i / 2
  674. } : "top" == e ? {
  675. top: t.top - n,
  676. left: t.left + t.width / 2 - i / 2
  677. } : "left" == e ? {
  678. top: t.top + t.height / 2 - n / 2,
  679. left: t.left - i
  680. } : {
  681. top: t.top + t.height / 2 - n / 2,
  682. left: t.left + t.width
  683. }
  684. }
  685. ,
  686. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  687. var r = {
  688. top: 0,
  689. left: 0
  690. };
  691. if (!this.$viewport)
  692. return r;
  693. var o = this.options.viewport && this.options.viewport.padding || 0
  694. , a = this.getPosition(this.$viewport);
  695. if (/right|left/.test(e)) {
  696. var s = t.top - o - a.scroll
  697. , l = t.top + o - a.scroll + n;
  698. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  699. } else {
  700. var c = t.left - o
  701. , h = t.left + o + i;
  702. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  703. }
  704. return r
  705. }
  706. ,
  707. r.prototype.getTitle = function() {
  708. var e = this.$element
  709. , t = this.options;
  710. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  711. }
  712. ,
  713. r.prototype.getUID = function(e) {
  714. for (; e += ~~(1e6 * Math.random()),
  715. document.getElementById(e); )
  716. ;
  717. return e
  718. }
  719. ,
  720. r.prototype.tip = function() {
  721. return this.$tip = this.$tip || m(this.options.template)
  722. }
  723. ,
  724. r.prototype.arrow = function() {
  725. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  726. }
  727. ,
  728. r.prototype.validate = function() {
  729. this.$element[0].parentNode || (this.hide(),
  730. this.$element = null,
  731. this.options = null)
  732. }
  733. ,
  734. r.prototype.enable = function() {
  735. this.enabled = !0
  736. }
  737. ,
  738. r.prototype.disable = function() {
  739. this.enabled = !1
  740. }
  741. ,
  742. r.prototype.toggleEnabled = function() {
  743. this.enabled = !this.enabled
  744. }
  745. ,
  746. r.prototype.toggle = function(e) {
  747. var t = this;
  748. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  749. m(e.currentTarget).data("bs." + this.type, t))),
  750. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  751. }
  752. ,
  753. r.prototype.destroy = function() {
  754. clearTimeout(this.timeout),
  755. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  756. }
  757. ;
  758. var e = m.fn.tooltip;
  759. m.fn.tooltip = function(n) {
  760. return this.each(function() {
  761. var e = m(this)
  762. , t = e.data("bs.tooltip")
  763. , i = "object" == typeof n && n;
  764. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  765. "string" == typeof n && t[n]())
  766. })
  767. }
  768. ,
  769. m.fn.tooltip.Constructor = r,
  770. m.fn.tooltip.noConflict = function() {
  771. return m.fn.tooltip = e,
  772. this
  773. }
  774. }(jQuery),
  775. function(e, t, i) {
  776. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  777. }(0, this, function() {
  778. "use strict";
  779. function Keen() {
  780. return _init.apply(this, arguments)
  781. }
  782. function _init(e) {
  783. if (_isUndefined(e))
  784. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  785. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  786. throw new Error("Please provide a projectId");
  787. this.configure(e)
  788. }
  789. function _extend(e) {
  790. for (var t = 1; t < arguments.length; t++)
  791. for (var i in arguments[t])
  792. e[i] = arguments[t][i];
  793. return e
  794. }
  795. function _isUndefined(e) {
  796. return void 0 === e
  797. }
  798. function _type(e) {
  799. var t = e && e.constructor ? e.constructor.toString() : void 0;
  800. return t ? t.match(/function (.*)\(/)[1] : "Null"
  801. }
  802. function _each(e, t, i) {
  803. var n;
  804. if (!e)
  805. return 0;
  806. if (i = i || e,
  807. "array" === _type(e)) {
  808. for (n = 0; n < e.length; n++)
  809. if (!1 === t.call(i, e[n], n, e))
  810. return 0
  811. } else
  812. for (n in e)
  813. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  814. return 0;
  815. return 1
  816. }
  817. function _parse_params(e) {
  818. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  819. return decodeURIComponent(e.replace(n, " "))
  820. }, a = e.split("?")[1]; t = r.exec(a); )
  821. i[o(t[1])] = o(t[2]);
  822. return i
  823. }
  824. function _set_protocol(e) {
  825. switch (e) {
  826. case "http":
  827. return "http";
  828. case "auto":
  829. return location.protocol.replace(/:/g, "");
  830. case "https":
  831. case void 0:
  832. default:
  833. return "https"
  834. }
  835. }
  836. function _set_request_type(e) {
  837. var t = e || "jsonp"
  838. , i = !1;
  839. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  840. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  841. }
  842. function _build_url(e) {
  843. return this.client.endpoint + "/projects/" + this.client.projectId + e
  844. }
  845. function _uploadEvent(e, t, i, n, r) {
  846. var o = _build_url.apply(this, ["/events/" + e])
  847. , a = {};
  848. for (var s in i = !1 !== i,
  849. this.client.globalProperties && (a = this.client.globalProperties(e)),
  850. t)
  851. t.hasOwnProperty(s) && (a[s] = t[s]);
  852. switch (this.client.requestType) {
  853. case "xhr":
  854. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  855. break;
  856. case "jsonp":
  857. var l = JSON.stringify(a)
  858. , c = Keen.Base64.encode(l);
  859. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  860. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  861. break;
  862. case "beacon":
  863. l = JSON.stringify(a),
  864. c = Keen.Base64.encode(l);
  865. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  866. o += "&c=clv1",
  867. _request.beacon.apply(this, [o, null, n, r])
  868. }
  869. }
  870. Keen.prototype.configure = function(e) {
  871. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  872. e.protocol = _set_protocol(e.protocol),
  873. e.requestType = _set_request_type(e.requestType),
  874. this.client = {
  875. projectId: e.projectId,
  876. writeKey: e.writeKey,
  877. readKey: e.readKey,
  878. globalProperties: null,
  879. endpoint: e.protocol + "://" + e.host,
  880. requestType: e.requestType
  881. },
  882. Keen.trigger("client", this, e),
  883. this.trigger("ready"),
  884. this
  885. }
  886. ;
  887. var _request = {
  888. xhr: function(e, t, i, n, r, o, a, s) {
  889. if (!r)
  890. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  891. var l = new XMLHttpRequest;
  892. if (l.onreadystatechange = function() {
  893. if (4 == l.readyState)
  894. if (200 <= l.status && l.status < 300) {
  895. var e;
  896. try {
  897. e = JSON.parse(l.responseText)
  898. } catch (e) {
  899. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  900. s && s(l, e)
  901. }
  902. a && e && a(e)
  903. } else
  904. Keen.log("HTTP request failed."),
  905. s && s(l, null)
  906. }
  907. ,
  908. l.open(e, t, o),
  909. r && l.setRequestHeader("Authorization", r),
  910. n && l.setRequestHeader("Content-Type", "application/json"),
  911. i)
  912. for (var c in i)
  913. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  914. var h = n ? JSON.stringify(n) : null;
  915. l.send(h)
  916. },
  917. jsonp: function(e, t, i, n) {
  918. if (!t)
  919. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  920. if (t && e.indexOf("api_key") < 0) {
  921. var r = 0 < e.indexOf("?") ? "&" : "?";
  922. e = e + r + "api_key=" + t
  923. }
  924. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  925. o += "a";
  926. var a = !1;
  927. window[o] = function(e) {
  928. a = !0,
  929. i && e && i(e),
  930. window[o] = void 0
  931. }
  932. ,
  933. e = e + "&jsonp=" + o;
  934. var s = document.createElement("script");
  935. s.id = "keen-jsonp",
  936. s.src = e,
  937. document.getElementsByTagName("head")[0].appendChild(s),
  938. s.onreadystatechange = function() {
  939. !1 === a && "loaded" === this.readyState && (a = !0,
  940. n && n())
  941. }
  942. ,
  943. s.onerror = function() {
  944. !1 === a && (a = !0,
  945. n && n())
  946. }
  947. },
  948. beacon: function(e, t, i, n) {
  949. if (t && e.indexOf("api_key") < 0) {
  950. var r = 0 < e.indexOf("?") ? "&" : "?";
  951. e = e + r + "api_key=" + t
  952. }
  953. var o = document.createElement("img");
  954. o.onload = function() {
  955. if (!0,
  956. "naturalHeight"in this) {
  957. if (this.naturalHeight + this.naturalWidth === 0)
  958. return void this.onerror()
  959. } else if (this.width + this.height === 0)
  960. return void this.onerror();
  961. i && i({
  962. created: !0
  963. })
  964. }
  965. ,
  966. o.onerror = function() {
  967. !0,
  968. n && n()
  969. }
  970. ,
  971. o.src = e
  972. }
  973. }
  974. , Events = Keen.Events = {
  975. on: function(e, t) {
  976. return this.listeners || (this.listeners = {}),
  977. (this.listeners[e] || (this.listeners[e] = [])).push({
  978. callback: t
  979. }),
  980. this
  981. },
  982. off: function(e, t) {
  983. if (!e && !t)
  984. return this.listeners = void 0,
  985. delete this.listeners,
  986. this;
  987. for (var i = this.listeners[e] || [], n = i.length; n--; )
  988. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  989. t && 0 != i.length || (this.listeners[e] = void 0,
  990. delete this.listeners[e]);
  991. return this
  992. },
  993. trigger: function(e) {
  994. if (!this.listeners)
  995. return this;
  996. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  997. i[n].callback.apply(this, t);
  998. return this
  999. }
  1000. };
  1001. _extend(Keen.prototype, Events),
  1002. _extend(Keen, Events),
  1003. Keen.loaded = !0,
  1004. Keen.utils = {
  1005. each: _each,
  1006. extend: _extend,
  1007. parseParams: _parse_params
  1008. },
  1009. Keen.ready = function(e) {
  1010. Keen.loaded ? e() : Keen.on("ready", e)
  1011. }
  1012. ,
  1013. Keen.log = function(e) {
  1014. "object" == typeof console && console.log("[Keen IO]", e)
  1015. }
  1016. ;
  1017. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1018. Keen.prototype.addEvent = function() {
  1019. _uploadEvent.apply(this, arguments)
  1020. }
  1021. ,
  1022. Keen.prototype.addEventSync = function(e, t, i, n) {
  1023. _uploadEvent.apply(this, [e, t, !1, i, n])
  1024. }
  1025. ,
  1026. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1027. var o = e
  1028. , a = o.metaKey
  1029. , s = o.target
  1030. , l = !1
  1031. , c = function() {};
  1032. return void 0 === n && (n = 500),
  1033. "A" === s.nodeName ? c = function() {
  1034. a || l || (l = !0,
  1035. window.location = s.href)
  1036. }
  1037. : "FORM" === s.nodeName && (c = function() {
  1038. l || (l = !0,
  1039. s.submit())
  1040. }
  1041. ),
  1042. r && (c = function() {
  1043. l || (l = !0,
  1044. r())
  1045. }
  1046. ),
  1047. _uploadEvent.call(this, t, i, c, c),
  1048. setTimeout(function() {
  1049. c()
  1050. }, n),
  1051. !!a && void 0
  1052. }
  1053. ,
  1054. Keen.prototype.setGlobalProperties = function(e) {
  1055. if (!this.client)
  1056. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1057. if (!e || "function" != typeof e)
  1058. throw new Error("Invalid value for global properties: " + e);
  1059. this.client.globalProperties = e
  1060. }
  1061. ,
  1062. Keen.Base64 = {
  1063. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1064. encode: function(e) {
  1065. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1066. for (e = this.utf8.encode(e); c < e.length; )
  1067. t = e.charCodeAt(c++),
  1068. i = e.charCodeAt(c++),
  1069. n = e.charCodeAt(c++),
  1070. r = t >> 2,
  1071. o = (3 & t) << 4 | i >> 4,
  1072. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1073. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1074. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1075. return l
  1076. },
  1077. decode: function(e) {
  1078. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1079. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1080. t = c.indexOf(e.charAt(l++)),
  1081. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1082. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1083. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1084. return this.utf8.decode(s)
  1085. },
  1086. utf8: {
  1087. encode: function(e) {
  1088. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1089. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1090. return i
  1091. },
  1092. decode: function(e) {
  1093. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1094. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1095. return i
  1096. }
  1097. }
  1098. },
  1099. "object" != typeof JSON && (JSON = {}),
  1100. function() {
  1101. function f(e) {
  1102. return e < 10 ? "0" + e : e
  1103. }
  1104. function quote(e) {
  1105. return escapable.lastIndex = 0,
  1106. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1107. var t = meta[e];
  1108. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1109. }) + '"' : '"' + e + '"'
  1110. }
  1111. function str(e, t) {
  1112. var i, n, r, o, a, s = gap, l = t[e];
  1113. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1114. "function" == typeof rep && (l = rep.call(t, e, l)),
  1115. typeof l) {
  1116. case "string":
  1117. return quote(l);
  1118. case "number":
  1119. return isFinite(l) ? String(l) : "null";
  1120. case "boolean":
  1121. case "null":
  1122. return String(l);
  1123. case "object":
  1124. if (!l)
  1125. return "null";
  1126. if (gap += indent,
  1127. a = [],
  1128. "[object Array]" === Object.prototype.toString.apply(l)) {
  1129. for (o = l.length,
  1130. i = 0; i < o; i += 1)
  1131. a[i] = str(i, l) || "null";
  1132. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1133. gap = s,
  1134. r
  1135. }
  1136. if (rep && "object" == typeof rep)
  1137. for (o = rep.length,
  1138. i = 0; i < o; i += 1)
  1139. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1140. else
  1141. for (n in l)
  1142. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1143. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1144. gap = s,
  1145. r
  1146. }
  1147. }
  1148. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1149. 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
  1150. }
  1151. ,
  1152. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1153. return this.valueOf()
  1154. }
  1155. );
  1156. 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 = {
  1157. "\b": "\\b",
  1158. "\t": "\\t",
  1159. "\n": "\\n",
  1160. "\f": "\\f",
  1161. "\r": "\\r",
  1162. '"': '\\"',
  1163. "\\": "\\\\"
  1164. }, rep;
  1165. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1166. var n;
  1167. if (indent = gap = "",
  1168. "number" == typeof i)
  1169. for (n = 0; n < i; n += 1)
  1170. indent += " ";
  1171. else
  1172. "string" == typeof i && (indent = i);
  1173. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1174. throw new Error("JSON.stringify");
  1175. return str("", {
  1176. "": e
  1177. })
  1178. }
  1179. ),
  1180. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1181. function walk(e, t) {
  1182. var i, n, r = e[t];
  1183. if (r && "object" == typeof r)
  1184. for (i in r)
  1185. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1186. return reviver.call(e, t, r)
  1187. }
  1188. var j;
  1189. if (text = String(text),
  1190. cx.lastIndex = 0,
  1191. cx.test(text) && (text = text.replace(cx, function(e) {
  1192. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1193. })),
  1194. /^[\],:{}\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, "")))
  1195. return j = eval("(" + text + ")"),
  1196. "function" == typeof reviver ? walk({
  1197. "": j
  1198. }, "") : j;
  1199. throw new SyntaxError("JSON.parse")
  1200. }
  1201. )
  1202. }(),
  1203. Hh = Keen.utils,
  1204. Ih = function(i) {
  1205. function e(e) {
  1206. for (u = 1; e = n.shift(); )
  1207. e()
  1208. }
  1209. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1210. return r[l] && r[l](s, t = function() {
  1211. r.removeEventListener(s, t, !1),
  1212. e()
  1213. }
  1214. , !1),
  1215. a && r.attachEvent(c, t = function() {
  1216. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1217. e())
  1218. }
  1219. ),
  1220. i = a ? function(t) {
  1221. self != top ? u ? t() : n.push(t) : function() {
  1222. try {
  1223. o.doScroll("left")
  1224. } catch (e) {
  1225. return setTimeout(function() {
  1226. i(t)
  1227. }, 50)
  1228. }
  1229. t()
  1230. }()
  1231. }
  1232. : function(e) {
  1233. u ? e() : n.push(e)
  1234. }
  1235. }
  1236. ,
  1237. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1238. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1239. if (loaded && cached) {
  1240. for (var instance in clients = cached.clients || {},
  1241. ready = cached.ready || [],
  1242. clients)
  1243. if (clients.hasOwnProperty(instance)) {
  1244. var client = clients[instance];
  1245. for (var method in Keen.prototype)
  1246. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1247. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1248. ,
  1249. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1250. ,
  1251. client._config && (client.configure.call(client, client._config),
  1252. delete client._config),
  1253. client._setGlobalProperties) {
  1254. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1255. client.setGlobalProperties.apply(client, globals[i]);
  1256. delete client._setGlobalProperties
  1257. }
  1258. if (client._addEvent) {
  1259. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1260. client.addEvent.apply(client, queue[i]);
  1261. delete client._addEvent
  1262. }
  1263. var callback = client._on || [];
  1264. if (client._on) {
  1265. for (var i = 0; i < callback.length; i++)
  1266. client.on.apply(client, callback[i]);
  1267. client.trigger("ready"),
  1268. delete client._on
  1269. }
  1270. }
  1271. for (var i = 0; i < ready.length; i++) {
  1272. var callback = ready[i];
  1273. Keen.on("ready", function() {
  1274. callback()
  1275. })
  1276. }
  1277. }
  1278. return Keen.loaded && setTimeout(function() {
  1279. Keen.utils.domready(function() {
  1280. Keen.trigger("ready")
  1281. })
  1282. }, 0),
  1283. Keen
  1284. }),
  1285. function() {
  1286. var i = window.analytics = window.analytics || [];
  1287. if (!i.initialize) {
  1288. if (i.invoked)
  1289. return window.console && console.error && console.error("Segment snippet included twice.");
  1290. i.invoked = !0,
  1291. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1292. i.factory = function(t) {
  1293. return function() {
  1294. var e = Array.prototype.slice.call(arguments);
  1295. return e.unshift(t),
  1296. i.push(e),
  1297. i
  1298. }
  1299. }
  1300. ;
  1301. for (var e = 0; e < i.methods.length; e++) {
  1302. var t = i.methods[e];
  1303. i[t] = i.factory(t)
  1304. }
  1305. i.load = function(e) {
  1306. var t = document.createElement("script");
  1307. t.type = "text/javascript",
  1308. t.async = !0,
  1309. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1310. var i = document.getElementsByTagName("script")[0];
  1311. i.parentNode.insertBefore(t, i)
  1312. }
  1313. ,
  1314. i.SNIPPET_VERSION = "4.0.0"
  1315. }
  1316. }(),
  1317. function(i, u) {
  1318. "use strict";
  1319. var d = "function"
  1320. , p = "undefined"
  1321. , f = "object"
  1322. , e = "major"
  1323. , t = "model"
  1324. , n = "name"
  1325. , r = "type"
  1326. , o = "vendor"
  1327. , a = "version"
  1328. , s = "architecture"
  1329. , l = "console"
  1330. , c = "mobile"
  1331. , h = "tablet"
  1332. , g = {
  1333. has: function(e, t) {
  1334. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1335. },
  1336. lowerize: function(e) {
  1337. return e.toLowerCase()
  1338. }
  1339. }
  1340. , m = {
  1341. rgx: function() {
  1342. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1343. var c = l[s]
  1344. , h = l[s + 1];
  1345. if (typeof e == p)
  1346. for (n in e = {},
  1347. h)
  1348. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1349. for (t = i = 0; t < c.length; t++)
  1350. if (o = c[t].exec(this.getUA())) {
  1351. for (n = 0; n < h.length; n++)
  1352. a = o[++i],
  1353. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1354. break
  1355. }
  1356. if (o)
  1357. break
  1358. }
  1359. return e
  1360. },
  1361. str: function(e, t) {
  1362. for (var i in t)
  1363. if (typeof t[i] == f && 0 < t[i].length) {
  1364. for (var n = 0; n < t[i].length; n++)
  1365. if (g.has(t[i][n], e))
  1366. return "?" === i ? u : i
  1367. } else if (g.has(t[i], e))
  1368. return "?" === i ? u : i;
  1369. return e
  1370. }
  1371. }
  1372. , v = {
  1373. browser: {
  1374. oldsafari: {
  1375. major: {
  1376. 1: ["/8", "/1", "/3"],
  1377. 2: "/4",
  1378. "?": "/"
  1379. },
  1380. version: {
  1381. "1.0": "/8",
  1382. 1.2: "/1",
  1383. 1.3: "/3",
  1384. "2.0": "/412",
  1385. "2.0.2": "/416",
  1386. "2.0.3": "/417",
  1387. "2.0.4": "/419",
  1388. "?": "/"
  1389. }
  1390. }
  1391. },
  1392. device: {
  1393. sprint: {
  1394. model: {
  1395. "Evo Shift 4G": "7373KT"
  1396. },
  1397. vendor: {
  1398. HTC: "APA",
  1399. Sprint: "Sprint"
  1400. }
  1401. }
  1402. },
  1403. os: {
  1404. windows: {
  1405. version: {
  1406. ME: "4.90",
  1407. "NT 3.11": "NT3.51",
  1408. "NT 4.0": "NT4.0",
  1409. 2e3: "NT 5.0",
  1410. XP: ["NT 5.1", "NT 5.2"],
  1411. Vista: "NT 6.0",
  1412. 7: "NT 6.1",
  1413. 8: "NT 6.2",
  1414. 8.1: "NT 6.3",
  1415. RT: "ARM"
  1416. }
  1417. }
  1418. }
  1419. }
  1420. , y = {
  1421. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1422. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1423. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1424. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1425. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1426. }
  1427. , A = function(e) {
  1428. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1429. return this instanceof A ? (this.getBrowser = function() {
  1430. return m.rgx.apply(this, y.browser)
  1431. }
  1432. ,
  1433. this.getCPU = function() {
  1434. return m.rgx.apply(this, y.cpu)
  1435. }
  1436. ,
  1437. this.getDevice = function() {
  1438. return m.rgx.apply(this, y.device)
  1439. }
  1440. ,
  1441. this.getEngine = function() {
  1442. return m.rgx.apply(this, y.engine)
  1443. }
  1444. ,
  1445. this.getOS = function() {
  1446. return m.rgx.apply(this, y.os)
  1447. }
  1448. ,
  1449. this.getResult = function() {
  1450. return {
  1451. ua: this.getUA(),
  1452. browser: this.getBrowser(),
  1453. engine: this.getEngine(),
  1454. os: this.getOS(),
  1455. device: this.getDevice(),
  1456. cpu: this.getCPU()
  1457. }
  1458. }
  1459. ,
  1460. this.getUA = function() {
  1461. return t
  1462. }
  1463. ,
  1464. this.setUA = function(e) {
  1465. return t = e,
  1466. this
  1467. }
  1468. ,
  1469. void this.setUA(t)) : new A(e).getResult()
  1470. };
  1471. if (typeof exports != p)
  1472. typeof module != p && module.exports && (exports = module.exports = A),
  1473. exports.UAParser = A;
  1474. else if (i.UAParser = A,
  1475. typeof define == d && define.amd && define(function() {
  1476. return A
  1477. }),
  1478. typeof i.jQuery != p) {
  1479. var C = i.jQuery
  1480. , I = new A;
  1481. C.ua = I.getResult(),
  1482. C.ua.get = function() {
  1483. return I.getUA()
  1484. }
  1485. ,
  1486. C.ua.set = function(e) {
  1487. I.setUA(e);
  1488. var t = I.getResult();
  1489. for (var i in t)
  1490. C.ua[i] = t[i]
  1491. }
  1492. }
  1493. }(this),
  1494. window.Modernizr = function(e, t) {
  1495. function i(e, t) {
  1496. return typeof e === t
  1497. }
  1498. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1499. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1500. return t in e && i(e.constructor.prototype[t], "undefined")
  1501. }
  1502. : function(e, t) {
  1503. return p.call(e, t)
  1504. }
  1505. ,
  1506. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1507. var r = this;
  1508. if ("function" != typeof r)
  1509. throw new TypeError;
  1510. var o = d.call(arguments, 1)
  1511. , a = function() {
  1512. if (this instanceof a) {
  1513. function e() {}
  1514. e.prototype = r.prototype;
  1515. var t = new e
  1516. , i = r.apply(t, o.concat(d.call(arguments)));
  1517. return Object(i) === i ? i : t
  1518. }
  1519. return r.apply(n, o.concat(d.call(arguments)))
  1520. };
  1521. return a
  1522. }
  1523. ),
  1524. h.webgl = function() {
  1525. return !!e.WebGLRenderingContext
  1526. }
  1527. ,
  1528. h)
  1529. r(h, f) && (n = f.toLowerCase(),
  1530. a[n] = h[f](),
  1531. u.push((a[n] ? "" : "no-") + n));
  1532. return a.addTest = function(e, t) {
  1533. if ("object" == typeof e)
  1534. for (var i in e)
  1535. r(e, i) && a.addTest(i, e[i]);
  1536. else {
  1537. if (e = e.toLowerCase(),
  1538. void 0 !== a[e])
  1539. return a;
  1540. t = "function" == typeof t ? t() : t,
  1541. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1542. a[e] = t
  1543. }
  1544. return a
  1545. }
  1546. ,
  1547. o = "",
  1548. c.cssText = o,
  1549. l = null,
  1550. a._version = "2.8.2",
  1551. a
  1552. }(this, this.document),
  1553. function(xe, e, Se) {
  1554. "use strict";
  1555. function Me(s, e, n) {
  1556. function a(e) {
  1557. var t = Q.length;
  1558. if (G.old = xe.extend({}, G),
  1559. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1560. Y = W[F.horizontal ? "width" : "height"](),
  1561. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1562. Q.length = 0,
  1563. G.start = 0,
  1564. G.end = nt(z - H, 0),
  1565. le) {
  1566. $.length,
  1567. J = U.children(F.itemSelector),
  1568. $.length = 0;
  1569. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1570. z = 0,
  1571. J.each(function(e, t) {
  1572. var i = xe(t)
  1573. , n = t.getBoundingClientRect()
  1574. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1575. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1576. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1577. , s = r + o + a
  1578. , l = !o || !a
  1579. , c = {};
  1580. c.el = t,
  1581. c.size = l ? r : s,
  1582. c.half = c.size / 2,
  1583. c.start = z + (l ? o : 0),
  1584. c.center = c.start - it(H / 2 - c.size / 2),
  1585. c.end = c.start - H + c.size,
  1586. e || (z += u),
  1587. z += s,
  1588. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1589. e === g && (c.end += d,
  1590. z += d,
  1591. f = l ? a : 0),
  1592. $.push(c),
  1593. h = c
  1594. }),
  1595. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1596. z -= f,
  1597. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1598. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1599. }
  1600. if (G.center = it(G.end / 2 + G.start / 2),
  1601. v(),
  1602. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1603. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1604. X.end = Y - q,
  1605. _e || c()),
  1606. !V && 0 < H) {
  1607. var n = G.start
  1608. , r = "";
  1609. if (le)
  1610. xe.each($, function(e, t) {
  1611. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1612. Q.push(n),
  1613. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1614. });
  1615. else
  1616. for (; n - H < G.end; )
  1617. Q.push(n),
  1618. n += H;
  1619. if (Z[0] && t !== Q.length) {
  1620. for (var o = 0; o < Q.length; o++)
  1621. r += F.pageBuilder.call(B, o);
  1622. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1623. }
  1624. }
  1625. if (ee.slideeSize = z,
  1626. ee.frameSize = H,
  1627. ee.sbSize = Y,
  1628. ee.handleSize = q,
  1629. le) {
  1630. e && null != F.startAt && (m(F.startAt),
  1631. B[se ? "toCenter" : "toStart"](F.startAt));
  1632. var a = $[ee.activeItem];
  1633. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1634. } else
  1635. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1636. L("load")
  1637. }
  1638. function l(e, t, i) {
  1639. if (le && Ie.released && !i) {
  1640. var n = d(e)
  1641. , r = e > G.start && e < G.end;
  1642. se ? (r && (e = $[n.centerItem].center),
  1643. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1644. }
  1645. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1646. Ae.start = +new Date,
  1647. Ae.time = 0,
  1648. Ae.from = G.cur,
  1649. Ae.to = e,
  1650. Ae.delta = e - G.cur,
  1651. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1652. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1653. Ie.tweese = 0,
  1654. e !== G.dest && (G.dest = e,
  1655. L("change"),
  1656. _e || o()),
  1657. g(),
  1658. v(),
  1659. p(),
  1660. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1661. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1662. L("activePage", ye.page))
  1663. }
  1664. function o() {
  1665. if (B.initialized) {
  1666. if (!_e)
  1667. return _e = Ge(o),
  1668. void (Ie.released && L("moveStart"));
  1669. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1670. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1671. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1672. Ae.to === G.cur ? (G.cur = Ae.to,
  1673. Ie.tweese = _e = 0) : _e = Ge(o),
  1674. L("move"),
  1675. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1676. !_e && Ie.released && L("moveEnd"),
  1677. c()
  1678. }
  1679. }
  1680. function c() {
  1681. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1682. X.cur = Fe(it(X.cur), X.start, X.end),
  1683. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1684. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1685. }
  1686. function t() {
  1687. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1688. Te = Ie.init ? Ge(t) : 0,
  1689. Ce.now = +new Date,
  1690. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1691. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1692. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1693. Ce.lastTime = Ce.now
  1694. }
  1695. function i(e, t, i) {
  1696. if ("boolean" === Re(t) && (i = t,
  1697. t = Se),
  1698. t === Se)
  1699. l(G[e], i);
  1700. else {
  1701. if (se && "center" !== e)
  1702. return;
  1703. var n = B.getPos(t);
  1704. n && l(n[e], i, !se)
  1705. }
  1706. }
  1707. function h(e) {
  1708. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1709. }
  1710. function u(e) {
  1711. return h(De(e) && e < 0 ? e + $.length : e)
  1712. }
  1713. function m(e, t) {
  1714. var i = h(e);
  1715. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1716. J.eq(i).addClass(F.activeClass),
  1717. ye.active = ee.activeItem = i,
  1718. p(),
  1719. L("active", i)),
  1720. i)
  1721. }
  1722. function d(e) {
  1723. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1724. var t = {}
  1725. , i = ae ? 0 : H / 2;
  1726. if (!V)
  1727. for (var n = 0, r = Q.length; n < r; n++) {
  1728. if (e >= G.end || n === Q.length - 1) {
  1729. t.activePage = Q.length - 1;
  1730. break
  1731. }
  1732. if (e <= Q[n] + i) {
  1733. t.activePage = n;
  1734. break
  1735. }
  1736. }
  1737. if (le) {
  1738. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1739. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1740. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1741. l === c - 1 || e <= $[l].end + $[l].half) {
  1742. a = l;
  1743. break
  1744. }
  1745. t.firstItem = De(o) ? o : 0,
  1746. t.centerItem = De(s) ? s : t.firstItem,
  1747. t.lastItem = De(a) ? a : t.centerItem
  1748. }
  1749. return t
  1750. }
  1751. function v(e) {
  1752. xe.extend(ee, d(e))
  1753. }
  1754. function p() {
  1755. var e = G.dest <= G.start
  1756. , t = G.dest >= G.end
  1757. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1758. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1759. ge.is("button,input") && ge.prop("disabled", e),
  1760. me.is("button,input") && me.prop("disabled", t),
  1761. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1762. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1763. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1764. de.is("button,input") && de.prop("disabled", e),
  1765. ue.is("button,input") && ue.prop("disabled", t)),
  1766. le && null != ee.activeItem) {
  1767. var n = 0 === ee.activeItem
  1768. , r = ee.activeItem >= $.length - 1
  1769. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1770. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1771. pe.is("button,input") && pe.prop("disabled", n),
  1772. fe.is("button,input") && fe.prop("disabled", r),
  1773. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1774. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1775. }
  1776. }
  1777. function r(e, t, i) {
  1778. if (e = u(e),
  1779. t = u(t),
  1780. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1781. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1782. var n = e < t ? e : i ? t : t - 1
  1783. , r = t < e ? e : i ? t + 1 : t
  1784. , o = t < e;
  1785. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1786. a()
  1787. }
  1788. }
  1789. function f(e, t) {
  1790. for (var i = 0, n = ve[e].length; i < n; i++)
  1791. if (ve[e][i] === t)
  1792. return i;
  1793. return -1
  1794. }
  1795. function g() {
  1796. Ie.released && !B.isPaused && B.resume()
  1797. }
  1798. function y(e) {
  1799. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1800. }
  1801. function A() {
  1802. Ie.history[0] = Ie.history[1],
  1803. Ie.history[1] = Ie.history[2],
  1804. Ie.history[2] = Ie.history[3],
  1805. Ie.history[3] = Ie.delta
  1806. }
  1807. function C(e) {
  1808. Ie.released = 0,
  1809. Ie.source = e,
  1810. Ie.slidee = "slidee" === e
  1811. }
  1812. function I(e) {
  1813. var t = "touchstart" === e.type
  1814. , i = e.data.source
  1815. , n = "slidee" === i;
  1816. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1817. C(i),
  1818. Ie.init = 0,
  1819. Ie.$source = xe(e.target),
  1820. Ie.touch = t,
  1821. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1822. Ie.initX = Ie.pointer.pageX,
  1823. Ie.initY = Ie.pointer.pageY,
  1824. Ie.initPos = n ? G.cur : X.cur,
  1825. Ie.start = +new Date,
  1826. Ie.time = 0,
  1827. Ie.path = 0,
  1828. Ie.delta = 0,
  1829. Ie.locked = 0,
  1830. Ie.history = [0, 0, 0, 0],
  1831. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1832. We.on(t ? qe : Ye, E),
  1833. B.pause(1),
  1834. (n ? U : j).addClass(F.draggedClass),
  1835. L("moveStart"),
  1836. n && (be = setInterval(A, 10)))
  1837. }
  1838. function E(e) {
  1839. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1840. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1841. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1842. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1843. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1844. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1845. Ie.released || !(Ie.path < 1)) {
  1846. if (!Ie.init) {
  1847. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1848. return _();
  1849. Ie.init = 1
  1850. }
  1851. Pe(e),
  1852. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1853. Ie.$source.on(Ze, Oe)),
  1854. Ie.released && (_(),
  1855. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1856. Ie.delta += Ie.swing,
  1857. Ie.tweese = 10 < $e(Ie.swing))),
  1858. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1859. }
  1860. }
  1861. function _() {
  1862. clearInterval(be),
  1863. Ie.released = !0,
  1864. We.off(Ie.touch ? qe : Ye, E),
  1865. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1866. setTimeout(function() {
  1867. Ie.$source.off(Ze, Oe)
  1868. }),
  1869. G.cur === G.dest && Ie.init && L("moveEnd"),
  1870. B.resume(1),
  1871. Ie.init = 0
  1872. }
  1873. function b(e) {
  1874. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1875. }
  1876. function w() {
  1877. B.stop(),
  1878. We.off("mouseup", w)
  1879. }
  1880. function T(e) {
  1881. switch (Pe(e),
  1882. this) {
  1883. case ue[0]:
  1884. case de[0]:
  1885. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1886. We.on("mouseup", w);
  1887. break;
  1888. case pe[0]:
  1889. B.prev();
  1890. break;
  1891. case fe[0]:
  1892. B.next();
  1893. break;
  1894. case ge[0]:
  1895. B.prevPage();
  1896. break;
  1897. case me[0]:
  1898. B.nextPage()
  1899. }
  1900. }
  1901. function x(e) {
  1902. e.originalEvent[He] = B;
  1903. var t = +new Date;
  1904. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1905. ot = t;
  1906. else if (F.scrollBy && G.start !== G.end) {
  1907. var i = function(e) {
  1908. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1909. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1910. le ? (Ue = +new Date,
  1911. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1912. Ee.last = Ue,
  1913. Ee.delta += Ee.curDelta,
  1914. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1915. Ee.delta %= 1),
  1916. Ee.finalDelta) : Ee.curDelta
  1917. }(e.originalEvent);
  1918. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1919. B.slideBy(F.scrollBy * i)
  1920. }
  1921. }
  1922. function S(e) {
  1923. F.clickBar && e.target === W[0] && (Pe(e),
  1924. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1925. }
  1926. function M(e) {
  1927. if (F.keyboardNavBy)
  1928. switch (e.which) {
  1929. case F.horizontal ? 37 : 38:
  1930. Pe(e),
  1931. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1932. break;
  1933. case F.horizontal ? 39 : 40:
  1934. Pe(e),
  1935. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1936. }
  1937. }
  1938. function R(e) {
  1939. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1940. }
  1941. function P() {
  1942. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1943. }
  1944. function O(e) {
  1945. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1946. }
  1947. function L(e, t) {
  1948. if (ve[e]) {
  1949. for (N = ve[e].length,
  1950. Je.length = 0,
  1951. D = 0; D < N; D++)
  1952. Je.push(ve[e][D]);
  1953. for (D = 0; D < N; D++)
  1954. Je[D].call(B, e, t)
  1955. }
  1956. }
  1957. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1958. start: 0,
  1959. center: 0,
  1960. end: 0,
  1961. cur: 0,
  1962. dest: 0
  1963. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1964. start: 0,
  1965. end: 0,
  1966. cur: 0
  1967. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1968. firstItem: 0,
  1969. lastItem: 0,
  1970. centerItem: 0,
  1971. activeItem: null,
  1972. activePage: 0
  1973. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1974. released: 1
  1975. }, Ee = {
  1976. last: 0,
  1977. delta: 0,
  1978. resetTime: 200
  1979. }, _e = 0, be = 0, we = 0, Te = 0;
  1980. V || (s = k[0]),
  1981. B.initialized = 0,
  1982. B.frame = s,
  1983. B.slidee = U[0],
  1984. B.pos = G,
  1985. B.rel = ee,
  1986. B.items = $,
  1987. B.pages = Q,
  1988. B.isPaused = 0,
  1989. B.options = F,
  1990. B.dragging = Ie,
  1991. B.reload = function() {
  1992. a()
  1993. }
  1994. ,
  1995. B.getPos = function(e) {
  1996. if (le) {
  1997. var t = h(e);
  1998. return -1 !== t && $[t]
  1999. }
  2000. var i = U.find(e).eq(0);
  2001. if (i[0]) {
  2002. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2003. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2004. return {
  2005. start: n,
  2006. center: n - H / 2 + r / 2,
  2007. end: n - H + r,
  2008. size: r
  2009. }
  2010. }
  2011. return !1
  2012. }
  2013. ,
  2014. B.moveBy = function(e) {
  2015. Ce.speed = e,
  2016. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2017. Ce.startPos = G.cur,
  2018. C("button"),
  2019. Ie.init = 1,
  2020. L("moveStart"),
  2021. ze(Te),
  2022. t())
  2023. }
  2024. ,
  2025. B.stop = function() {
  2026. "button" === Ie.source && (Ie.init = 0,
  2027. Ie.released = 1)
  2028. }
  2029. ,
  2030. B.prev = function() {
  2031. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2032. }
  2033. ,
  2034. B.next = function() {
  2035. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2036. }
  2037. ,
  2038. B.prevPage = function() {
  2039. B.activatePage(ee.activePage - 1)
  2040. }
  2041. ,
  2042. B.nextPage = function() {
  2043. B.activatePage(ee.activePage + 1)
  2044. }
  2045. ,
  2046. B.slideBy = function(e, t) {
  2047. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2048. }
  2049. ,
  2050. B.slideTo = function(e, t) {
  2051. l(e, t)
  2052. }
  2053. ,
  2054. B.toStart = function(e, t) {
  2055. i("start", e, t)
  2056. }
  2057. ,
  2058. B.toEnd = function(e, t) {
  2059. i("end", e, t)
  2060. }
  2061. ,
  2062. B.toCenter = function(e, t) {
  2063. i("center", e, t)
  2064. }
  2065. ,
  2066. B.getIndex = h,
  2067. B.activate = function(e, t) {
  2068. var i = m(e);
  2069. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2070. }
  2071. ,
  2072. B.activatePage = function(e, t) {
  2073. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2074. }
  2075. ,
  2076. B.resume = function(e) {
  2077. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2078. we ? we = clearTimeout(we) : L("resume"),
  2079. we = setTimeout(function() {
  2080. switch (L("cycle"),
  2081. F.cycleBy) {
  2082. case "items":
  2083. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2084. break;
  2085. case "pages":
  2086. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2087. }
  2088. }, F.cycleInterval))
  2089. }
  2090. ,
  2091. B.pause = function(e) {
  2092. e < B.isPaused || (B.isPaused = e || 100,
  2093. we && (we = clearTimeout(we),
  2094. L("pause")))
  2095. }
  2096. ,
  2097. B.toggle = function() {
  2098. B[we ? "pause" : "resume"]()
  2099. }
  2100. ,
  2101. B.set = function(e, t) {
  2102. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2103. }
  2104. ,
  2105. B.add = function(e, t) {
  2106. var i = xe(e);
  2107. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2108. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2109. a()
  2110. }
  2111. ,
  2112. B.remove = function(e) {
  2113. if (le) {
  2114. var t = u(e);
  2115. if (-1 < t) {
  2116. J.eq(t).remove();
  2117. var i = t === ee.activeItem;
  2118. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2119. a(),
  2120. i && (ye.active = null,
  2121. B.activate(ee.activeItem))
  2122. }
  2123. } else
  2124. xe(e).remove(),
  2125. a()
  2126. }
  2127. ,
  2128. B.moveAfter = function(e, t) {
  2129. r(e, t, 1)
  2130. }
  2131. ,
  2132. B.moveBefore = function(e, t) {
  2133. r(e, t)
  2134. }
  2135. ,
  2136. B.on = function(e, t) {
  2137. if ("object" === Re(e))
  2138. for (var i in e)
  2139. e.hasOwnProperty(i) && B.on(i, e[i]);
  2140. else if ("function" === Re(t))
  2141. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2142. ve[n[r]] = ve[n[r]] || [],
  2143. -1 === f(n[r], t) && ve[n[r]].push(t);
  2144. else if ("array" === Re(t))
  2145. for (var a = 0, s = t.length; a < s; a++)
  2146. B.on(e, t[a])
  2147. }
  2148. ,
  2149. B.one = function(t, i) {
  2150. B.on(t, function e() {
  2151. i.apply(B, arguments),
  2152. B.off(t, e)
  2153. })
  2154. }
  2155. ,
  2156. B.off = function(e, t) {
  2157. if (t instanceof Array)
  2158. for (var i = 0, n = t.length; i < n; i++)
  2159. B.off(e, t[i]);
  2160. else
  2161. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2162. if (ve[r[o]] = ve[r[o]] || [],
  2163. null == t)
  2164. ve[r[o]].length = 0;
  2165. else {
  2166. var s = f(r[o], t);
  2167. -1 !== s && ve[r[o]].splice(s, 1)
  2168. }
  2169. }
  2170. ,
  2171. B.destroy = function() {
  2172. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2173. We.off("keydown", M),
  2174. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2175. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2176. Z.empty(),
  2177. V || (k.off("." + He),
  2178. te.restore(),
  2179. ie.restore(),
  2180. ne.restore(),
  2181. re.restore(),
  2182. xe.removeData(s, He)),
  2183. $.length = Q.length = 0,
  2184. ye = {},
  2185. B.initialized = 0,
  2186. B
  2187. }
  2188. ,
  2189. B.init = function() {
  2190. if (!B.initialized) {
  2191. B.on(n);
  2192. var e = ["overflow", "position"]
  2193. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2194. te.save.apply(te, e),
  2195. ne.save.apply(ne, e),
  2196. ie.save.apply(ie, t),
  2197. re.save.apply(re, t);
  2198. var i = j;
  2199. return V || (i = i.add(U),
  2200. k.css("overflow", "hidden"),
  2201. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2202. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2203. i.css({
  2204. position: "absolute"
  2205. })),
  2206. F.forward && ue.on(Ke, T),
  2207. F.backward && de.on(Ke, T),
  2208. F.prev && pe.on(Ze, T),
  2209. F.next && fe.on(Ze, T),
  2210. F.prevPage && ge.on(Ze, T),
  2211. F.nextPage && me.on(Ze, T),
  2212. ce.on(Xe, x),
  2213. W[0] && W.on(Ze, S),
  2214. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2215. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2216. he.on(je, {
  2217. source: "slidee"
  2218. }, I),
  2219. j && j.on(je, {
  2220. source: "handle"
  2221. }, I),
  2222. We.on("keydown", M),
  2223. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2224. k.on("scroll." + He, Le)),
  2225. B.initialized = 1,
  2226. a(!0),
  2227. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2228. B
  2229. }
  2230. }
  2231. }
  2232. function Re(e) {
  2233. 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
  2234. }
  2235. function Pe(e, t) {
  2236. e.preventDefault(),
  2237. t && e.stopPropagation()
  2238. }
  2239. function Oe(e) {
  2240. Pe(e, 1),
  2241. xe(this).off(e.type, Oe)
  2242. }
  2243. function Le() {
  2244. this.scrollLeft = 0,
  2245. this.scrollTop = 0
  2246. }
  2247. function De(e) {
  2248. return !isNaN(parseFloat(e)) && isFinite(e)
  2249. }
  2250. function Ne(e, t) {
  2251. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2252. }
  2253. function Fe(e, t, i) {
  2254. return e < t ? t : i < e ? i : e
  2255. }
  2256. function Be(t) {
  2257. var i = {
  2258. style: {},
  2259. save: function() {
  2260. if (t && t.nodeType) {
  2261. for (var e = 0; e < arguments.length; e++)
  2262. i.style[arguments[e]] = t.style[arguments[e]];
  2263. return i
  2264. }
  2265. },
  2266. restore: function() {
  2267. if (t && t.nodeType) {
  2268. for (var e in i.style)
  2269. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2270. return i
  2271. }
  2272. }
  2273. };
  2274. return i
  2275. }
  2276. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2277. function t(e) {
  2278. for (var t = 0, i = r.length; t < i; t++) {
  2279. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2280. if (null != o.style[n])
  2281. return n
  2282. }
  2283. }
  2284. We.on(Xe, function(e) {
  2285. var t = e.originalEvent[He]
  2286. , i = +new Date;
  2287. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2288. }),
  2289. function(t) {
  2290. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2291. var t = (new Date).getTime()
  2292. , i = Math.max(0, 16 - (t - r))
  2293. , n = setTimeout(e, i);
  2294. return r = t,
  2295. n
  2296. }
  2297. ;
  2298. var r = (new Date).getTime()
  2299. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2300. ze = function(e) {
  2301. i.call(t, e)
  2302. }
  2303. }(window),
  2304. r = ["", "webkit", "moz", "ms", "o"],
  2305. o = document.createElement("div"),
  2306. Ve = t("transform"),
  2307. ke = t("perspective") ? "translateZ(0) " : "",
  2308. e.Sly = Me,
  2309. xe.fn.sly = function(n, r) {
  2310. var o, a;
  2311. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2312. a = Array.prototype.slice.call(arguments, 1)),
  2313. n = {}),
  2314. this.each(function(e, t) {
  2315. var i = xe.data(t, He);
  2316. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2317. })
  2318. }
  2319. ,
  2320. Me.defaults = {
  2321. slidee: null,
  2322. horizontal: !1,
  2323. itemNav: null,
  2324. itemSelector: null,
  2325. smart: !1,
  2326. activateOn: null,
  2327. activateMiddle: !1,
  2328. scrollSource: null,
  2329. scrollBy: 0,
  2330. scrollHijack: 300,
  2331. scrollTrap: !1,
  2332. dragSource: null,
  2333. mouseDragging: !1,
  2334. touchDragging: !1,
  2335. releaseSwing: !1,
  2336. swingSpeed: .2,
  2337. elasticBounds: !1,
  2338. interactive: null,
  2339. scrollBar: null,
  2340. dragHandle: !1,
  2341. dynamicHandle: !1,
  2342. minHandleSize: 50,
  2343. clickBar: !1,
  2344. syncSpeed: .5,
  2345. pagesBar: null,
  2346. activatePageOn: null,
  2347. pageBuilder: function(e) {
  2348. return "<li>" + (e + 1) + "</li>"
  2349. },
  2350. forward: null,
  2351. backward: null,
  2352. prev: null,
  2353. next: null,
  2354. prevPage: null,
  2355. nextPage: null,
  2356. cycleBy: null,
  2357. cycleInterval: 5e3,
  2358. pauseOnHover: !1,
  2359. startPaused: !1,
  2360. moveBy: 300,
  2361. speed: 0,
  2362. easing: "swing",
  2363. startAt: null,
  2364. keyboardNavBy: null,
  2365. draggedClass: "dragged",
  2366. activeClass: "active",
  2367. disabledClass: "disabled"
  2368. }
  2369. }(jQuery, window),
  2370. function o(a, s, l) {
  2371. function c(i, e) {
  2372. if (!s[i]) {
  2373. if (!a[i]) {
  2374. var t = "function" == typeof require && require;
  2375. if (!e && t)
  2376. return t(i, !0);
  2377. if (h)
  2378. return h(i, !0);
  2379. var n = new Error("Cannot find module '" + i + "'");
  2380. throw n.code = "MODULE_NOT_FOUND",
  2381. n
  2382. }
  2383. var r = s[i] = {
  2384. exports: {}
  2385. };
  2386. a[i][0].call(r.exports, function(e) {
  2387. var t = a[i][1][e];
  2388. return c(t || e)
  2389. }, r, r.exports, o, a, s, l)
  2390. }
  2391. return s[i].exports
  2392. }
  2393. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2394. c(l[e]);
  2395. return c
  2396. }({
  2397. 1: [function(p, f, e) {
  2398. (function(e) {
  2399. "use strict";
  2400. function t(e) {
  2401. this.player = null,
  2402. this.director = null,
  2403. this.modelManager = null,
  2404. this.container = null,
  2405. this.tagManager = null,
  2406. this.fadeInSpeed = e,
  2407. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2408. }
  2409. var r = p("three")
  2410. , i = p("./util/logger")
  2411. , n = (p("./util/common"),
  2412. p("./enum/PlayerEvents"))
  2413. , o = p("./enum/DirectorEvents")
  2414. , a = p("./settings")
  2415. , s = p("./enum/Viewmode")
  2416. , l = (p("./enum/WarpStyle"),
  2417. p("./enum/BlackoutStyle"),
  2418. p("./enum/ModelManagerEvents"))
  2419. , c = p("./enum/tagEvents")
  2420. , h = p("./util/transitions")
  2421. , u = p("./util/lerp")
  2422. , d = new i(e);
  2423. window.THREE = r,
  2424. t.prototype.init = function(e, t, i, n, r) {
  2425. (window.app = this).player = t,
  2426. this.director = e,
  2427. this.modelManager = i,
  2428. this.tagManager = n,
  2429. this.container = r,
  2430. this.updateModel(),
  2431. this.bindEvents()
  2432. }
  2433. ,
  2434. t.prototype.bindEvents = function() {
  2435. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2436. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2437. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2438. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2439. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2440. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2441. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2442. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2443. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2444. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2445. }
  2446. ,
  2447. t.prototype.updateModel = function() {
  2448. this.model = this.modelManager.getActiveModel()
  2449. }
  2450. ,
  2451. t.prototype.handleWarpStarted = function() {
  2452. this.hidePlayerReticule()
  2453. }
  2454. ,
  2455. t.prototype.ontagActivated = function() {
  2456. this.hidePlayerReticule()
  2457. }
  2458. ,
  2459. t.prototype.onNavigationTotag = function() {
  2460. this.hidePlayerReticule()
  2461. }
  2462. ,
  2463. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2464. var n = this.modelManager.getActiveModel()
  2465. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2466. n.fadePanoMarkers(r),
  2467. n.setMode(t)
  2468. }
  2469. ,
  2470. t.prototype.handlePlayerModeChanged = function(e, t) {
  2471. var i = this.modelManager.getActiveModel()
  2472. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2473. i.setSide(n),
  2474. i.setMode(t)
  2475. }
  2476. ,
  2477. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2478. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2479. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2480. }
  2481. ,
  2482. t.prototype.handleActionInterruption = function() {}
  2483. ,
  2484. t.prototype.handleStartInside = function(e) {
  2485. var t = a[this.player.mode]
  2486. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2487. this.fadeIn(this.fadeInSpeed),
  2488. this.model.alpha = 0,
  2489. this.model.skybox.material.uniforms.opacity.value = 1,
  2490. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2491. var n = this.player.reticule;
  2492. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2493. }
  2494. ,
  2495. t.prototype.handleStartOutside = function(e) {
  2496. this.fadeIn(e)
  2497. }
  2498. ,
  2499. t.prototype.fadeIn = function(e) {
  2500. null != e || (e = 2e3,
  2501. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2502. $(this.container).fadeIn(e)
  2503. }
  2504. ,
  2505. t.prototype.hidePlayerReticule = function() {
  2506. this.player.reticule.hide()
  2507. }
  2508. ,
  2509. f.exports = t
  2510. }
  2511. ).call(this, "/js/DisplayController.js")
  2512. }
  2513. , {
  2514. "./enum/BlackoutStyle": 18,
  2515. "./enum/DirectorEvents": 23,
  2516. "./enum/tagEvents": 32,
  2517. "./enum/ModelManagerEvents": 33,
  2518. "./enum/PlayerEvents": 40,
  2519. "./enum/Viewmode": 51,
  2520. "./enum/WarpStyle": 52,
  2521. "./settings": 166,
  2522. "./util/common": 185,
  2523. "./util/lerp": 188,
  2524. "./util/logger": 189,
  2525. "./util/transitions": 195,
  2526. three: 217
  2527. }],
  2528. 2: [function(e, t, i) {
  2529. "use strict";
  2530. function n() {
  2531. this.baseStartTime = performance.timing.navigationStart,
  2532. this.loadingStartTime = null,
  2533. this.waitingStartTime = null,
  2534. this.appReadyTime = null
  2535. }
  2536. n.prototype.setBaseStartTime = function(e) {
  2537. this.baseStartTime = e || Date.now()
  2538. }
  2539. ,
  2540. n.prototype.setWaitingStartTime = function(e) {
  2541. this.waitingStartTime = e || Date.now()
  2542. }
  2543. ,
  2544. n.prototype.setLoadingStartTime = function(e) {
  2545. this.loadingStartTime = e || Date.now()
  2546. }
  2547. ,
  2548. n.prototype.setAppReadyTime = function(e) {
  2549. this.appReadyTime = e || Date.now()
  2550. }
  2551. ,
  2552. n.prototype.calcFullLoadingTime = function() {
  2553. var e = this.appReadyTime - this.baseStartTime;
  2554. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2555. e
  2556. }
  2557. ,
  2558. t.exports = n
  2559. }
  2560. , {}],
  2561. 3: [function(i, n, e) {
  2562. (function(e) {
  2563. "use strict";
  2564. function a() {
  2565. return 100 * Math.random()
  2566. }
  2567. var t = i("./util/logger")
  2568. , s = i("./util/browser")
  2569. , l = new t(e)
  2570. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2571. initialized: !1,
  2572. init: function(e, t) {
  2573. if (t = t || {},
  2574. !this.initialized) {
  2575. for (var i in this.initialized = !0,
  2576. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2577. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2578. e) {
  2579. var n = i.match("^sc_tilegen_([0-9]+)$");
  2580. n && (c.tilegen = a() < parseInt(n[1]));
  2581. var r = i.match("^sc_imgopt_([0-9]+)$");
  2582. r && (c.imgopt = a() < parseInt(r[1]))
  2583. }
  2584. for (var o in t)
  2585. c[o] = t[o],
  2586. l.debug("A/B override:", o, c[o])
  2587. }
  2588. },
  2589. changeIfTileGenerating: function(e) {
  2590. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2591. e += ""),
  2592. e
  2593. },
  2594. changeIfImageOptimzing: function(e) {
  2595. if(e.includes("blob:http"))return e;//add
  2596. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2597. e += ""),
  2598. e
  2599. },
  2600. tilegen: !1,
  2601. imgopt: !1
  2602. };
  2603. n.exports = c
  2604. }
  2605. ).call(this, "/js/ab.js")
  2606. }
  2607. , {
  2608. "./util/browser": 182,
  2609. "./util/logger": 189
  2610. }],
  2611. 4: [function(u, d, e) {
  2612. (function(e) {
  2613. "use strict";
  2614. function r(n, e, t, i) {
  2615. function r(e) {
  2616. a[e.sid] = !0;
  2617. var t = e.billboard.media && e.billboard.media.type
  2618. , i = {
  2619. tag_id: e.sid,
  2620. tags_visited: Object.keys(a).length,
  2621. tag_count: Object.keys(n.tags).length,
  2622. tag_view_count: ++d,
  2623. has_media: !!t
  2624. };
  2625. t && (i.media_type = t),
  2626. g("tag_opened", i)
  2627. }
  2628. var o, a = {}, s = Date.now() - P, l = null;
  2629. i && (l = Date.now() - window.navigationStart);
  2630. try {
  2631. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2632. } catch (n) {
  2633. o = !1
  2634. }
  2635. var c, h = n.supportsVR;
  2636. h || (c = "VR disabled at the model/account level",
  2637. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2638. g("model_loaded", {
  2639. duration: s,
  2640. duration_from_navigation_start: l,
  2641. has_hlr: o,
  2642. has_vr: h,
  2643. vr_reason: c
  2644. });
  2645. var u = 0;
  2646. n.panos.forEach(function(e) {
  2647. e.on("enter", function() {
  2648. f("pano_viewed", {
  2649. pano_id: e.id,
  2650. pano_view_count: ++u,
  2651. alignment_type: e.alignmentType,
  2652. interaction_source: R,
  2653. navigation_source: v
  2654. })
  2655. })
  2656. });
  2657. var d = 0;
  2658. for (var p in n.tags)
  2659. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2660. e.on("tour_auto", function(e) {
  2661. v = "tour_" + e
  2662. }),
  2663. e.on("tour_manual", function(e) {
  2664. R = "gui-" + e,
  2665. v = "tour_manual"
  2666. }),
  2667. t.on(C.InteractionKey, function() {
  2668. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2669. }),
  2670. t.on(C.InteractionDirect, function() {
  2671. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2672. }),
  2673. function(t) {
  2674. I.on(T.OPENED, function() {
  2675. f("showcase_share_intent", {
  2676. pano_id: t.currentPano && t.currentPano.id
  2677. })
  2678. }),
  2679. I.on(T.LINK_CLICKED, function(e) {
  2680. f("showcase_share_action", {
  2681. channel: e.channel,
  2682. pano_id: t.currentPano && t.currentPano.id
  2683. })
  2684. }),
  2685. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2686. f("showcase_share_origin_link_clicked")
  2687. })
  2688. }(e),
  2689. function() {
  2690. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2691. gui_action: "click_vr_button"
  2692. })),
  2693. _.on(S.LAUNCH, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: "launch_vr",
  2696. vr_platform: e.vr_platform,
  2697. vr_app: e.vr_app
  2698. })
  2699. }),
  2700. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2701. gui_action: "vr_modal_prev"
  2702. })),
  2703. _.on(S.NEXT, function(e) {
  2704. f("showcase_gui", {
  2705. gui_action: e.nextAction
  2706. })
  2707. }),
  2708. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2709. gui_action: "vr_modal_close"
  2710. })),
  2711. _.on(S.falseICECHOSEN, function(e) {
  2712. f("showcase_gui", {
  2713. gui_action: e.name + " "
  2714. })
  2715. }),
  2716. _.on(S.STORE, function(e) {
  2717. f("showcase_gui", {
  2718. gui_action: "launch_store",
  2719. store: e
  2720. })
  2721. })
  2722. }()
  2723. }
  2724. function f(e, t) {
  2725. if (t = t || {},
  2726. i)
  2727. try {
  2728. window.analytics.track(e, s.extendObject(t, c), {
  2729. context: {
  2730. app: {
  2731. name: "showcase",
  2732. version: "2.25.6-0-gd87e5b1"
  2733. },
  2734. screen: {
  2735. width: window.screen.width,
  2736. height: window.screen.height,
  2737. density: window.devicePixelRatio
  2738. }
  2739. }
  2740. })
  2741. } catch (t) {
  2742. console.warn("Failed to send data to segment for " + e)
  2743. }
  2744. }
  2745. function g(e, t) {
  2746. f(e, t = t || {})
  2747. }
  2748. function m(e, t) {
  2749. R = e === C.InteractionGui ? "gui-" + t : e,
  2750. v = "self_guided"
  2751. }
  2752. var v, o, a = (u("three"),
  2753. u("./util/ajax"),
  2754. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2755. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2756. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2757. d.exports = {
  2758. report: function(e, t, i, n) {
  2759. !function(e, t) {
  2760. if (o)
  2761. try {
  2762. o.addEvent(e, s.extendObject({
  2763. host: window.location.host,
  2764. keen: {
  2765. addons: [{
  2766. name: "keen:ua_parser",
  2767. input: {
  2768. ua_string: "user_agent"
  2769. },
  2770. output: "parsed_user_agent"
  2771. }]
  2772. },
  2773. user_agent: "${keen.user_agent}",
  2774. referrer: {
  2775. url: s.normalizeUrl(document.referrer),
  2776. domain: s.domainFromUrl(document.referrer),
  2777. url_original: document.referrer
  2778. },
  2779. embedded: y.inIframe(),
  2780. is_mobile: y.isMobile(),
  2781. version: "2.25.6-0-gd87e5b1"
  2782. }, t))
  2783. } catch (e) {
  2784. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2785. }
  2786. }("Session starts", {
  2787. model: e,
  2788. status: t,
  2789. loadtime: Date.now() - (P || Date.now()),
  2790. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2791. autoplay: i,
  2792. quickstart: n,
  2793. ab_tilegen: a.tilegen,
  2794. ab_imgopt: a.imgopt
  2795. })
  2796. },
  2797. impression: function(e) {
  2798. g("impression", {
  2799. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2800. url_params: (void 0 !== e.immediate && e.immediate,
  2801. window.location.search.substr(1).split("&"))
  2802. })
  2803. },
  2804. initKeen: function(e) {
  2805. return e.token && e.appId ? void (o = new Keen({
  2806. projectId: e.appId,
  2807. writeKey: e.token,
  2808. readKey: "",
  2809. requestType: "xhr"
  2810. })) : void l.warn("no keen token/appId")
  2811. },
  2812. initSegment: function(e) {
  2813. return e.token ? (i = e.token,
  2814. window.analytics.load(e.token),
  2815. c = {
  2816. model_id: e.model,
  2817. start_source: e.startSource,
  2818. autoplay: e.autoplay,
  2819. quickstart: e.quickstart,
  2820. language_tag: t.languageTag,
  2821. is_mobile: y.isMobile(),
  2822. iframe: y.inIframe(),
  2823. aspect_ratio: y.aspectRatio(),
  2824. session_id: h,
  2825. window: {
  2826. width: $("#player").width(),
  2827. height: $("#player").height()
  2828. },
  2829. platform: {
  2830. browser: {
  2831. name: $.ua.browser.name,
  2832. major: $.ua.browser.major,
  2833. version: $.ua.browser.version
  2834. },
  2835. os: {
  2836. name: $.ua.os.name,
  2837. version: $.ua.os.version
  2838. },
  2839. device: {
  2840. vendor: $.ua.device.vendor,
  2841. model: $.ua.device.model,
  2842. type: $.ua.device.type
  2843. }
  2844. }
  2845. },
  2846. n = Math.random() < t.analytics.sessionTrackingRate,
  2847. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2848. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2849. },
  2850. sessionStart: function(e) {
  2851. l.debug("analytics user_session_start"),
  2852. f("session_started"),
  2853. P = Date.now(),
  2854. window.addEventListener("unload", function() {
  2855. !function(e, t) {
  2856. if (t = t || {},
  2857. navigator.sendBeacon && i)
  2858. try {
  2859. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2860. event: e,
  2861. anonymousId: window.analytics.user().anonymousId(),
  2862. properties: s.extendObject(t, c),
  2863. writeKey: i,
  2864. sentAt: Date.now(),
  2865. type: "track",
  2866. context: {
  2867. userAgent: y.userAgent(),
  2868. library: {
  2869. name: "showcase-beacon",
  2870. version: "2.25.6-0-gd87e5b1"
  2871. },
  2872. app: {
  2873. name: "showcase",
  2874. version: "2.25.6-0-gd87e5b1"
  2875. }
  2876. }
  2877. }))
  2878. } catch (e) {
  2879. console.warn("Failed to send async segment request")
  2880. }
  2881. }("session_ended", {
  2882. duration: Date.now() - P
  2883. })
  2884. })
  2885. },
  2886. modelLoaded: function(e, t, i, n) {
  2887. r(e, t, i, n)
  2888. },
  2889. loadComplete: function(e) {
  2890. f("load_times", {
  2891. time_to_app_start: e
  2892. })
  2893. },
  2894. track: function(e, t) {
  2895. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2896. f(e, t))
  2897. },
  2898. trackAlways: function(e, t) {
  2899. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2900. f(e, t)
  2901. },
  2902. getSessionId: function() {
  2903. return h
  2904. },
  2905. updateInteraction: m
  2906. }
  2907. }
  2908. ).call(this, "/js/analytics.js")
  2909. }
  2910. , {
  2911. "./ab": 3,
  2912. "./enum/ControlEvents": 21,
  2913. "./enum/PlayerEvents": 40,
  2914. "./enum/VROption": 47,
  2915. "./enum/VRPlatforms": 49,
  2916. "./enum/Viewmode": 51,
  2917. "./gui/sharing/ShareEvents": 76,
  2918. "./gui/sharing/modal": 77,
  2919. "./gui/title/TitleEvents": 80,
  2920. "./gui/title/titleBar": 82,
  2921. "./gui/vr/vrEvent": 85,
  2922. "./gui/vr/vrModal": 87,
  2923. "./localization/localize": 108,
  2924. "./tag/Billboard/BillboardEvent": 120,
  2925. "./settings": 166,
  2926. "./util/ajax": 181,
  2927. "./util/browser": 182,
  2928. "./util/common": 185,
  2929. "./util/logger": 189,
  2930. three: 217
  2931. }],
  2932. 5: [function(e, t, i) {
  2933. "use strict";
  2934. function n() {
  2935. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2936. this.controls = null
  2937. }
  2938. var r = e("three")
  2939. , o = e("../constants")
  2940. , a = e("../util/cameraLight");
  2941. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2942. this.aspect = e,
  2943. this.updateProjectionMatrix()
  2944. }
  2945. ,
  2946. t.exports = n
  2947. }
  2948. , {
  2949. "../constants": 8,
  2950. "../util/cameraLight": 184,
  2951. three: 217
  2952. }],
  2953. 6: [function(e, t, i) {
  2954. "use strict";
  2955. function n() {
  2956. var e = $("#player").width() / $("#player").height();
  2957. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2958. this.controls = null,
  2959. this.updateAspect(e)
  2960. }
  2961. var r = e("three")
  2962. , o = e("../constants");
  2963. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2964. this.aspect = e,
  2965. this.top = o.orthoBase / e,
  2966. this.bottom = -o.orthoBase / e,
  2967. this.updateProjectionMatrix()
  2968. }
  2969. ,
  2970. t.exports = n
  2971. }
  2972. , {
  2973. "../constants": 8,
  2974. three: 217
  2975. }],
  2976. 7: [function(e, t, i) {
  2977. "use strict";
  2978. function n() {
  2979. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2980. this.controls = null
  2981. }
  2982. var r = e("three")
  2983. , o = e("../settings")
  2984. , a = e("../util/cameraLight");
  2985. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2986. this.aspect = e,
  2987. this.updateProjectionMatrix()
  2988. }
  2989. ,
  2990. t.exports = n
  2991. }
  2992. , {
  2993. "../settings": 166,
  2994. "../util/cameraLight": 184,
  2995. three: 217
  2996. }],
  2997. 8: [function(e, t, i) {
  2998. "use strict";
  2999. t.exports = {
  3000. signedUrlDefaultExpireTime: 24e4,
  3001. signedUrlCheckInterval: 1e4,
  3002. signedUrlRefreshBuffer: 15e3,
  3003. dollhouseFOV: 70,
  3004. dollhouseNear: .1,//1,
  3005. dollhouseFar: 5e3,
  3006. insideFOV: 70,
  3007. insideFOVMax: 120,
  3008. insideNear: .1,
  3009. insideFar: 5e3,
  3010. insideLookSpeed: .12,
  3011. insideLookLimitUp: 40,
  3012. insideLookLimitDown: -40,
  3013. orthoNear: 1,
  3014. orthoFar: 5e3,
  3015. orthoBase: 10,
  3016. narrowLandscapeHeight: 290,
  3017. reallyNarrowLandscapeHeight: 250,
  3018. visionTilingStartDate: new Date("8/26/2016"),
  3019. visionTilingStartVersion: "1.1.407.13667",
  3020. windowHeightHighQualityThreshold: 900,
  3021. tourStepDelayDefault: 3500,
  3022. tourStepDelaySlideShow: 5e3,
  3023. workshopApsect: 9 / 16,
  3024. highQualityMaxZoom: 2,
  3025. ultraHighQualityMaxZoom: 3
  3026. }
  3027. }
  3028. , {}],
  3029. 9: [function(e, t, i) {
  3030. "use strict";
  3031. function n() {
  3032. this.activeControl = null,
  3033. this.controls = {},
  3034. this.cameras = {}
  3035. }
  3036. var a = e("./PanoramaControls")
  3037. , s = e("./DollhouseControls")
  3038. , l = e("./FloorplanControls")
  3039. , c = e("../cameras/PanoramaCamera")
  3040. , h = e("../cameras/DollhouseCamera")
  3041. , u = e("../cameras/FloorplanCamera")
  3042. , r = e("events").EventEmitter
  3043. , d = e("../enum/ControlEvents")
  3044. , o = e("../enum/ModelManagerEvents")
  3045. , p = e("../enum/Viewmode")
  3046. , f = e("../settings");
  3047. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3048. this.setUpControls(),
  3049. this.bindEvents(e, t)
  3050. }
  3051. ,
  3052. n.prototype.activateControls = function(e) {
  3053. this.activeControl && (this.activeControl.reset(),
  3054. this.activeControl.enabled = !1),
  3055. this.controls[e] && (this.controls[e].enabled = !0),
  3056. this.activeControl = this.controls[e]
  3057. }
  3058. ,
  3059. n.prototype.setUpControls = function() {
  3060. var i = {}
  3061. , n = {}
  3062. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3063. , r = [c, h, u]
  3064. , o = [a, s, l];
  3065. e.forEach(function(e, t) {
  3066. i[e] = new r[t],
  3067. n[e] = new o[t](i[e]),
  3068. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3069. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3070. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3071. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3072. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3073. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3074. }
  3075. .bind(this)),
  3076. this.controls = n,
  3077. this.cameras = i
  3078. }
  3079. ,
  3080. n.prototype.bindEvents = function(e, t) {
  3081. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3082. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3083. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3084. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3085. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3086. passive: !1
  3087. }),
  3088. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3089. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3090. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3091. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3092. e.addEventListener("contextmenu", function(e) {
  3093. e.preventDefault()
  3094. }),
  3095. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3096. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3097. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3098. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3099. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3100. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3101. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3102. t.on(o.ActiveModelChanged, function(e) {
  3103. this.setModelForControls(e.model)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.setModelForControls = function(e) {
  3109. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3110. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3111. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3112. this.controls[e].setBounds(t)
  3113. }
  3114. .bind(this))
  3115. }
  3116. ,
  3117. n.prototype.onMouseDown = function(e) {
  3118. e.preventDefault(),
  3119. this.activeControl && this.activeControl.onMouseDown(e)
  3120. }
  3121. ,
  3122. n.prototype.onMouseMove = function(e) {
  3123. e.preventDefault(),
  3124. this.activeControl && this.activeControl.onMouseMove(e)
  3125. }
  3126. ,
  3127. n.prototype.onMouseUp = function(e) {
  3128. e.preventDefault(),
  3129. this.activeControl && this.activeControl.onMouseUp(e)
  3130. }
  3131. ,
  3132. n.prototype.onMouseOver = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onMouseOver(e)
  3135. }
  3136. ,
  3137. n.prototype.onMouseWheel = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onMouseWheel(e)
  3140. }
  3141. ,
  3142. n.prototype.onTouchStart = function(e) {
  3143. e.preventDefault(),
  3144. this.activeControl && this.activeControl.onTouchStart(e),
  3145. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3146. $("#hotListContent ul .active").removeClass("active"),
  3147. $("#hotList")[0].classList.remove("active")
  3148. }
  3149. ,
  3150. n.prototype.onTouchMove = function(e) {
  3151. e.preventDefault(),
  3152. this.activeControl && this.activeControl.onTouchMove(e)
  3153. }
  3154. ,
  3155. n.prototype.onTouchEnd = function(e) {
  3156. e.preventDefault(),
  3157. this.activeControl && this.activeControl.onTouchEnd(e)
  3158. }
  3159. ,
  3160. n.prototype.onPointerDown = function(e) {
  3161. if (e.preventDefault(),
  3162. this.activeControl)
  3163. switch (e.pointerType) {
  3164. case "mouse":
  3165. this.activeControl.onMouseDown(e);
  3166. break;
  3167. default:
  3168. this.activeControl.onPointerDown(e)
  3169. }
  3170. }
  3171. ,
  3172. n.prototype.onPointerMove = function(e) {
  3173. if (e.preventDefault(),
  3174. this.activeControl)
  3175. switch (e.pointerType) {
  3176. case "mouse":
  3177. this.activeControl.onMouseMove(e);
  3178. break;
  3179. default:
  3180. this.activeControl.onPointerMove(e)
  3181. }
  3182. }
  3183. ,
  3184. n.prototype.onPointerUp = function(e) {
  3185. if (e.preventDefault(),
  3186. this.activeControl)
  3187. switch (e.pointerType) {
  3188. case "mouse":
  3189. this.activeControl.onMouseUp(e);
  3190. break;
  3191. default:
  3192. this.activeControl.onPointerUp(e)
  3193. }
  3194. }
  3195. ,
  3196. n.prototype.onPointerCancel = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3199. }
  3200. ,
  3201. n.prototype.onKeyDown = function(e) {
  3202. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3203. this.activeControl && this.activeControl.onKeyDown(e))
  3204. }
  3205. ,
  3206. n.prototype.onKeyUp = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onKeyUp(e)
  3209. }
  3210. ,
  3211. t.exports = n
  3212. }
  3213. , {
  3214. "../cameras/DollhouseCamera": 5,
  3215. "../cameras/FloorplanCamera": 6,
  3216. "../cameras/PanoramaCamera": 7,
  3217. "../enum/ControlEvents": 21,
  3218. "../enum/ModelManagerEvents": 33,
  3219. "../enum/Viewmode": 51,
  3220. "../settings": 166,
  3221. "./DollhouseControls": 10,
  3222. "./FloorplanControls": 11,
  3223. "./PanoramaControls": 13,
  3224. events: 202
  3225. }],
  3226. 10: [function(e, t, i) {
  3227. "use strict";
  3228. function n(e) {
  3229. a.call(this, e),
  3230. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3231. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3232. this.minDistance = o.dollhouseDefault.minDistance,
  3233. this.maxDistance = o.dollhouseDefault.maxDistance,
  3234. this.adjustedMinDistance = this.minDistance,
  3235. this.adjustedMaxDistance = this.maxDistance
  3236. }
  3237. var r = e("three")
  3238. , o = e("../settings")
  3239. , a = e("./OutsideControls");
  3240. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3241. this.camera.updateMatrix();
  3242. var i = this.camera.position.clone().sub(this.target).length();
  3243. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3244. this.panLeft(2 * e * i / $("#player").height()),
  3245. this.panUp(-2 * t * i / $("#player").height())
  3246. }
  3247. ,
  3248. n.prototype.updateZoom = function() {
  3249. return this.offset.length() * this.scale
  3250. }
  3251. ,
  3252. n.prototype.setZoomBounds = function(e) {
  3253. var t = e.min.distanceTo(e.max);
  3254. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3255. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3256. this.minDistance = this.adjustedMinDistance,
  3257. this.maxDistance = this.adjustedMaxDistance
  3258. }
  3259. ,
  3260. n.prototype.resetRanges = function(e, t) {
  3261. e ? (this.minDistance = Math.min(e, this.minDistance),
  3262. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3263. this.maxDistance = this.adjustedMaxDistance),
  3264. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3265. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3266. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3267. }
  3268. ,
  3269. n.prototype.toJSON = function() {
  3270. return a.prototype.toJSON.call(this)
  3271. }
  3272. ,
  3273. t.exports = n
  3274. }
  3275. , {
  3276. "../settings": 166,
  3277. "./OutsideControls": 12,
  3278. three: 217
  3279. }],
  3280. 11: [function(e, t, i) {
  3281. "use strict";
  3282. function n(e) {
  3283. c.call(this, e),
  3284. this.minDistance = 15,
  3285. this.maxDistance = 50,
  3286. this.noRotateUpDown = !0,
  3287. this.minPolarAngle = 0,
  3288. this.maxPolarAngle = 0,
  3289. this.mouseActions[u.LEFT] = h.PAN,
  3290. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3291. this.mouseActions[u.RIGHT] = h.ROTATE,
  3292. this.touchActions[1] = h.PAN,
  3293. this.touchActions[2] = h.ROTATE_DOLLY,
  3294. this.absoluteScale = 1,
  3295. this.currentScale = 1
  3296. }
  3297. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3298. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3299. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3300. this.currentScale = this.absoluteScale
  3301. }
  3302. ,
  3303. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3304. var t = Math.max(modelSize.x, modelSize.z)
  3305. , i = Math.min(modelSize.x, modelSize.z)
  3306. , n = Math.max(t, i * this.camera.aspect)
  3307. , r = Math.max(i, t * this.camera.aspect);
  3308. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3309. return absoluteScale
  3310. },
  3311. n.prototype.rotateToView = function(e, t) {
  3312. var i = 0;
  3313. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3314. this.rotateLeft(i),
  3315. this.update(0)
  3316. }
  3317. ,
  3318. n.prototype.pan = function(e, t) {
  3319. this.camera.updateMatrix(),
  3320. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3321. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3322. }
  3323. ,
  3324. n.prototype.updateZoom = function() {
  3325. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3326. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3327. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3328. this.camera.left = -l.orthoBase * this.currentScale,
  3329. this.camera.right = l.orthoBase * this.currentScale,
  3330. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3331. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3332. this.camera.updateProjectionMatrix(),
  3333. this.offset.length()
  3334. }
  3335. ,
  3336. n.prototype.toJSON = (r = new s.Quaternion,
  3337. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3338. a = new s.Quaternion,
  3339. function() {
  3340. var e = c.prototype.toJSON.call(this);
  3341. return r.copy(e.camera_quaternion),
  3342. a.copy(o),
  3343. a.multiply(r),
  3344. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3345. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3346. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3347. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3348. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3349. e
  3350. }
  3351. ),
  3352. t.exports = n
  3353. }
  3354. , {
  3355. "../enum/ControlActions": 20,
  3356. "../enum/MouseButton": 34,
  3357. "../settings": 166,
  3358. "../util/browser": 182,
  3359. "../util/math": 190,
  3360. "./OutsideControls": 12,
  3361. three: 217
  3362. }],
  3363. 12: [function(e, t, i) {
  3364. "use strict";
  3365. function n(e) {
  3366. this.camera = e,
  3367. (this.camera.controls = this).enabled = !1,
  3368. this.target = new a.Vector3,
  3369. this.targetBounds = new a.Box3,
  3370. this.zoomSpeed = 2,//编辑时缩放快一些
  3371. this.minDistance = 0,
  3372. this.maxDistance = 1 / 0,
  3373. this.noRotateUpDown = !1,
  3374. this.rotateSpeed = 1,
  3375. this.keyboardZoomSpeed = 0,
  3376. this.keyPanSpeed = 7,
  3377. this.autoRotate = !1,
  3378. this.autoRotateSpeed = 2,
  3379. this.autoPan = !1,
  3380. this.autoPanPosition = new a.Vector3,
  3381. this.minPolarAngle = a.Math.degToRad(25),
  3382. this.maxPolarAngle = a.Math.degToRad(65),
  3383. this.rotationAcceleration = new a.Vector2,
  3384. this.rotationSpeed = new a.Vector2,
  3385. this.panAcceleration = new a.Vector2,
  3386. this.panSpeed = new a.Vector2,
  3387. this.rotateStart = new a.Vector2,
  3388. this.rotateEnd = new a.Vector2,
  3389. this.rotateDelta = new a.Vector2,
  3390. this.panStart = new a.Vector2,
  3391. this.panEnd = new a.Vector2,
  3392. this.panDelta = new a.Vector2,
  3393. this.panOffset = new a.Vector3,
  3394. this.offset = new a.Vector3,
  3395. this.dollyStart = new a.Vector2,
  3396. this.dollyEnd = new a.Vector2,
  3397. this.dollyDelta = new a.Vector2,
  3398. this.phiDelta = 0,
  3399. this.thetaDelta = 0,
  3400. this.scale = 1,
  3401. this.panVector = new a.Vector3,
  3402. this.lastPosition = new a.Vector3,
  3403. this.state = u.NONE,
  3404. this.mouseActions = {},
  3405. this.mouseActions[d.LEFT] = u.ROTATE,
  3406. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3407. this.mouseActions[d.RIGHT] = u.PAN,
  3408. this.touchActions = {},
  3409. this.touchActions[1] = u.ROTATE,
  3410. this.touchActions[2] = u.PAN_DOLLY,
  3411. this.lastMoveTime = 0,
  3412. this.pointersLimit = 2,
  3413. this.pointers = []
  3414. }
  3415. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3416. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3417. this.targetBounds = e
  3418. }
  3419. ,
  3420. n.prototype.isEngaged = function() {
  3421. return this.state !== u.NONE
  3422. }
  3423. ,
  3424. n.prototype.rotateLeft = function(e) {
  3425. void 0 === e && (e = this.getAutoRotationAngle()),
  3426. this.thetaDelta -= e
  3427. }
  3428. ,
  3429. n.prototype.rotateUp = function(e) {
  3430. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3431. this.phiDelta -= e)
  3432. }
  3433. ,
  3434. n.prototype.panLeft = function(e) {
  3435. var t = this.camera.matrix.elements;
  3436. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3437. this.panOffset.multiplyScalar(-e),
  3438. this.panVector.add(this.panOffset)
  3439. }
  3440. ,
  3441. n.prototype.panUp = function(e) {
  3442. var t = this.camera.matrix.elements;
  3443. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3444. this.panOffset.multiplyScalar(-e),
  3445. this.panVector.add(this.panOffset)
  3446. }
  3447. ,
  3448. n.prototype.startRotating = function(e, t) {
  3449. e && this.navRotationAcc("x", e),
  3450. t && this.navRotationAcc("y", t)
  3451. }
  3452. ,
  3453. n.prototype.stopRotating = function(e) {
  3454. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3455. this.navRotationAcc("x", 0),
  3456. this.navRotationAcc("y", 0)
  3457. }
  3458. ,
  3459. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3460. o = new a.Vector3,
  3461. function(e, t) {
  3462. r.copy(this.camera.position),
  3463. void 0 === e && null === e || r.setX(e),
  3464. void 0 === t && null === t || r.setZ(t);
  3465. var i = this.camera.position.distanceTo(this.target)
  3466. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3467. this.targetClamped = !1,
  3468. o.copy(r).addScaledVector(n, i),
  3469. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3470. r.copy(o).addScaledVector(n, -i),
  3471. this.targetClamped = !0),
  3472. this.autoPanPosition.x = r.x,
  3473. this.autoPanPosition.z = r.z,
  3474. this.autoPan && this.stopAutoPanning()
  3475. }
  3476. ),
  3477. n.prototype.stopAutoPanning = function() {
  3478. var e = this.autoPan;
  3479. this.autoPan = !1,
  3480. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3481. }
  3482. ,
  3483. n.prototype.dollyIn = function(e) {
  3484. void 0 === e && (e = this.getZoomScale()),
  3485. this.scale /= e
  3486. }
  3487. ,
  3488. n.prototype.dollyOut = function(e) {
  3489. void 0 === e && (e = this.getZoomScale()),
  3490. this.scale *= e
  3491. }
  3492. ,
  3493. n.prototype.updatePan = function(e) {
  3494. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3495. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3496. this.autoPan) {
  3497. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3498. t.setY(0).clampLength(0, 50 * e),
  3499. this.target.add(t),
  3500. this.camera.position.add(t),
  3501. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3502. this.stopAutoPanning())
  3503. }
  3504. }
  3505. ,
  3506. n.prototype.update = function(e) {
  3507. e = e || 1 / 60,
  3508. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3509. this.rotateLeft(-this.rotationSpeed.x),
  3510. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3511. this.updatePan(e);
  3512. var t = this.camera.position;
  3513. this.offset.copy(t).sub(this.target);
  3514. var i = Math.atan2(this.offset.x, this.offset.z)
  3515. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3516. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3517. i += this.thetaDelta,
  3518. n += this.phiDelta,
  3519. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3520. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3521. var r = this.updateZoom();
  3522. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3523. this.target.add(this.panVector),
  3524. this.targetBounds.clampPoint(this.target, this.target),
  3525. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3526. this.offset.y = r * Math.cos(n),
  3527. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3528. t.copy(this.target).add(this.offset),
  3529. this.camera.lookAt(this.target),
  3530. this.thetaDelta = 0,
  3531. this.phiDelta = 0,
  3532. this.scale = 1,
  3533. this.panVector.set(0, 0, 0),
  3534. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3535. }
  3536. ,
  3537. n.prototype.getAutoRotationAngle = function() {
  3538. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3539. }
  3540. ,
  3541. n.prototype.getZoomScale = function() {
  3542. return Math.pow(.95, this.zoomSpeed)
  3543. }
  3544. ,
  3545. n.prototype.onMouseDown = function(e) {
  3546. if (this.enabled) {
  3547. switch (e.preventDefault(),
  3548. this.stopAutoPanning(),
  3549. this.mouseDown = !0,
  3550. this.state = this.mouseActions[e.button],
  3551. this.state) {
  3552. case u.ROTATE:
  3553. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3554. this.rotationSpeed.set(0, 0);
  3555. break;
  3556. case u.DOLLY:
  3557. this.dollyStart.set(e.clientX, e.clientY);
  3558. break;
  3559. case u.PAN:
  3560. this.panStart.set(e.clientX, e.clientY)
  3561. }
  3562. this.emit(f.InputStart, "mouse")
  3563. }
  3564. }
  3565. ,
  3566. n.prototype.onMouseMove = function(e) {
  3567. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3568. switch (e.preventDefault(),
  3569. this.state) {
  3570. case u.ROTATE:
  3571. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3572. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3573. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3574. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3575. this.rotateStart.copy(this.rotateEnd);
  3576. break;
  3577. case u.DOLLY:
  3578. this.dollyEnd.set(e.clientX, e.clientY),
  3579. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3580. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3581. this.dollyStart.copy(this.dollyEnd);
  3582. break;
  3583. case u.PAN:
  3584. this.panEnd.set(e.clientX, e.clientY),
  3585. this.panDelta.subVectors(this.panEnd, this.panStart),
  3586. this.pan(this.panDelta.x, this.panDelta.y),
  3587. this.panStart.copy(this.panEnd)
  3588. }
  3589. this.emit(f.Move, "mouse"),
  3590. this.lastMoveTime = e.timeStamp,
  3591. this.update()
  3592. }
  3593. }
  3594. ,
  3595. n.prototype.onMouseUp = function(e) {
  3596. this.enabled && (this.mouseDown = !1,
  3597. this.state = u.NONE,
  3598. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3599. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3600. this.update(),
  3601. this.rotationAcceleration.set(0, 0),
  3602. this.rotateDelta.set(0, 0)))
  3603. }
  3604. ,
  3605. n.prototype.onMouseOver = function(e) {
  3606. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3607. }
  3608. ,
  3609. n.prototype.onMouseWheel = function(e) {
  3610. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3611. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3612. this.update())
  3613. }
  3614. ,
  3615. n.prototype.onKeyDown = function(e) {
  3616. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3617. this.handleKeyDown(e.which)))
  3618. }
  3619. ,
  3620. n.prototype.navRotationAcc = function(e, t) {
  3621. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3622. }
  3623. ,
  3624. n.prototype.navPanAcc = function(e, t) {
  3625. this.stopAutoPanning(),
  3626. this.panAcceleration[e] = t
  3627. }
  3628. ,
  3629. n.prototype.handleKeyDown = function(e) {
  3630. var t = !0;
  3631. switch (e) {
  3632. case p.UPARROW:
  3633. case p.I:
  3634. this.navRotationAcc("y", 1);
  3635. break;
  3636. case p.DOWNARROW:
  3637. case p.K:
  3638. this.navRotationAcc("y", -1);
  3639. break;
  3640. case p.LEFTARROW:
  3641. case p.J:
  3642. this.navRotationAcc("x", -1);
  3643. break;
  3644. case p.RIGHTARROW:
  3645. case p.L:
  3646. this.navRotationAcc("x", 1);
  3647. break;
  3648. case p.W:
  3649. this.navPanAcc("y", 1);
  3650. break;
  3651. case p.S:
  3652. this.navPanAcc("y", -1);
  3653. break;
  3654. case p.A:
  3655. this.navPanAcc("x", -1);
  3656. break;
  3657. case p.D:
  3658. this.navPanAcc("x", 1);
  3659. break;
  3660. default:
  3661. t = !1
  3662. }
  3663. t && this.emit(f.Move, "key")
  3664. }
  3665. ,
  3666. n.prototype.onKeyUp = function(e) {
  3667. this.enabled && (e.preventDefault(),
  3668. e.stopPropagation(),
  3669. this.handleKeyUp(e.which))
  3670. }
  3671. ,
  3672. n.prototype.handleKeyUp = function(e) {
  3673. switch (e) {
  3674. case p.I:
  3675. case p.K:
  3676. case p.UPARROW:
  3677. case p.DOWNARROW:
  3678. this.keyboardZoomSpeed = 0,
  3679. this.rotationAcceleration.y = 0;
  3680. break;
  3681. case p.J:
  3682. case p.L:
  3683. case p.LEFTARROW:
  3684. case p.RIGHTARROW:
  3685. this.rotationAcceleration.x = 0;
  3686. break;
  3687. case p.S:
  3688. case p.W:
  3689. this.panAcceleration.y = 0;
  3690. break;
  3691. case p.A:
  3692. case p.D:
  3693. this.panAcceleration.x = 0
  3694. }
  3695. }
  3696. ,
  3697. n.prototype.onTouchStart = function(i) {
  3698. if (this.enabled || this.state === u.NONE) {
  3699. i.preventDefault(),
  3700. i.stopPropagation(),
  3701. this.stopAutoPanning();
  3702. var e = function() {
  3703. if (2 === i.touches.length) {
  3704. var e = i.touches[0].pageX - i.touches[1].pageX
  3705. , t = i.touches[0].pageY - i.touches[1].pageY;
  3706. this.dollyStart.set(e, t)
  3707. }
  3708. }
  3709. .bind(this)
  3710. , t = function() {
  3711. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3712. }
  3713. .bind(this)
  3714. , n = function() {
  3715. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3716. }
  3717. .bind(this);
  3718. switch (this.state = this.touchActions[i.touches.length],
  3719. this.state) {
  3720. case u.PAN_DOLLY:
  3721. e();
  3722. case u.PAN:
  3723. t();
  3724. break;
  3725. case u.ROTATE_DOLLY:
  3726. e();
  3727. case u.ROTATE:
  3728. n()
  3729. }
  3730. this.rotationSpeed.set(0, 0),
  3731. this.emit(f.InputStart, "touch")
  3732. }
  3733. }
  3734. ,
  3735. n.prototype.onTouchMove = function(a) {
  3736. if (this.enabled && this.state !== u.NONE) {
  3737. a.preventDefault(),
  3738. a.stopPropagation();
  3739. var s = function() {
  3740. var e = a.touches[0].pageX - a.touches[1].pageX
  3741. , t = a.touches[0].pageY - a.touches[1].pageY;
  3742. this.dollyEnd.set(e, t);
  3743. var i = this.dollyStart.length() - this.dollyEnd.length();
  3744. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3745. this.dollyStart.copy(this.dollyEnd)
  3746. }
  3747. .bind(this)
  3748. , e = function() {
  3749. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3750. this.panDelta.subVectors(this.panEnd, this.panStart),
  3751. this.pan(this.panDelta.x, this.panDelta.y),
  3752. this.panStart.copy(this.panEnd),
  3753. this.rotateDelta.set(0, 0)
  3754. }
  3755. .bind(this)
  3756. , l = function() {
  3757. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3758. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3759. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3760. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3761. this.rotateStart.copy(this.rotateEnd)
  3762. }
  3763. .bind(this)
  3764. , t = function() {
  3765. if (2 === a.touches.length) {
  3766. var e = window.devicePixelRatio || 1
  3767. , t = a.touches[1].pageX - a.touches[0].pageX
  3768. , i = a.touches[1].pageY - a.touches[0].pageY
  3769. , n = Math.sqrt(t * t + i * i);
  3770. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3771. this.state = u.DOLLY,
  3772. s();
  3773. else {
  3774. var r = h.average(a.touches, "pageX")
  3775. , o = h.average(a.touches, "pageY");
  3776. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3777. this.rotateStart.set(r, o),
  3778. l())
  3779. }
  3780. }
  3781. }
  3782. .bind(this);
  3783. switch (this.state) {
  3784. case u.PAN_DOLLY:
  3785. s();
  3786. case u.PAN:
  3787. e();
  3788. break;
  3789. case u.ROTATE_DOLLY:
  3790. t();
  3791. break;
  3792. case u.DOLLY:
  3793. s();
  3794. break;
  3795. case u.ROTATE:
  3796. l();
  3797. break;
  3798. default:
  3799. this.state = u.NONE
  3800. }
  3801. this.lastMoveTime = a.timeStamp,
  3802. this.emit(f.Move, "touch")
  3803. }
  3804. }
  3805. ,
  3806. n.prototype.onTouchEnd = function(e) {
  3807. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3808. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3809. this.state = u.NONE,
  3810. this.update(),
  3811. this.rotationAcceleration.set(0, 0),
  3812. this.rotateDelta.set(0, 0))
  3813. }
  3814. ,
  3815. n.prototype.onPointerDown = function(e) {
  3816. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3817. id: e.pointerId,
  3818. pageX: e.pageX,
  3819. pageY: e.pageY
  3820. }),
  3821. e.touches = this.pointers,
  3822. this.onTouchStart(e)),
  3823. this.emit(f.InputStart, "pointer"))
  3824. }
  3825. ,
  3826. n.prototype.onPointerMove = function(t) {
  3827. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3828. t.pointerId === e.id && (e.pageX = t.pageX,
  3829. e.pageY = t.pageY)
  3830. }),
  3831. t.touches = this.pointers,
  3832. this.onTouchMove(t))
  3833. }
  3834. ,
  3835. n.prototype.onPointerUp = function(i) {
  3836. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3837. i.pointerId === e.id && this.pointers.splice(t, 1)
  3838. }
  3839. .bind(this)),
  3840. i.touches = this.pointers,
  3841. this.onTouchEnd(i))
  3842. }
  3843. ,
  3844. n.prototype.reset = function() {
  3845. this.state = u.NONE,
  3846. this.stopAutoPanning(),
  3847. this.rotationSpeed.set(0, 0),
  3848. this.rotationAcceleration.set(0, 0),
  3849. this.panSpeed.set(0, 0),
  3850. this.panAcceleration.set(0, 0)
  3851. }
  3852. ,
  3853. n.prototype.toJSON = function() {
  3854. return {
  3855. camera_position: {
  3856. x: s.toPrecision(this.camera.position.x, 4),
  3857. y: s.toPrecision(this.camera.position.y, 4),
  3858. z: s.toPrecision(this.camera.position.z, 4)
  3859. },
  3860. camera_quaternion: {
  3861. x: s.toPrecision(this.camera.quaternion.x, 4),
  3862. y: s.toPrecision(this.camera.quaternion.y, 4),
  3863. z: s.toPrecision(this.camera.quaternion.z, 4),
  3864. w: s.toPrecision(this.camera.quaternion.w, 4)
  3865. }
  3866. }
  3867. }
  3868. ,
  3869. t.exports = n
  3870. }
  3871. , {
  3872. "../enum/ControlActions": 20,
  3873. "../enum/ControlEvents": 21,
  3874. "../enum/Keys": 30,
  3875. "../enum/MouseButton": 34,
  3876. "../enum/Vectors": 50,
  3877. "../settings": 166,
  3878. "../util/common": 185,
  3879. "../util/math": 190,
  3880. events: 202,
  3881. three: 217
  3882. }],
  3883. 13: [function(u, d, e) {
  3884. (function(e) {
  3885. "use strict";
  3886. function t(e) {
  3887. this.camera = e,
  3888. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3889. this.lookVector = new s.Vector3,
  3890. this.lookSpeed = .05,
  3891. this.rotationAcc = new s.Vector2,
  3892. this.rotationSpeed = new s.Vector2,
  3893. this.lat = 0,
  3894. this.lon = 0,
  3895. this.phi = 0,
  3896. this.theta = 0,
  3897. this.enabled = !1,
  3898. this.locked = !1,
  3899. this.pointer = new s.Vector2(0,0),
  3900. this.rotationHistory = [],
  3901. this.rotationDifference = new s.Vector2,
  3902. this.pointerDragOn = !1,
  3903. this.pointerDragStart = new s.Vector2(0,0),
  3904. this.pinchDistance = 0,
  3905. this.moveStart = new s.Vector2,
  3906. this.moveTolerance = .01,
  3907. this.pointersLimit = 2,
  3908. this.pointers = []
  3909. }
  3910. var s = u("three")
  3911. , i = u("../util/logger")
  3912. , n = u("../settings")
  3913. , r = u("../util/common")
  3914. , o = u("../util/math")
  3915. , a = (u("../enum/Vectors"),
  3916. u("../enum/MouseButton"))
  3917. , l = u("../enum/Keys")
  3918. , c = u("../enum/ControlEvents")
  3919. , h = u("events").EventEmitter;
  3920. new i(e),
  3921. (t.prototype = Object.create(h.prototype)).usable = function() {
  3922. return this.enabled && !this.locked
  3923. }
  3924. ,
  3925. t.prototype.lookAt = function(e) {
  3926. var t = this.camera.position.clone().sub(e)
  3927. , i = Math.atan(t.z / t.x);
  3928. i += t.x < 0 ? Math.PI : 0,
  3929. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3930. this.lon = s.Math.radToDeg(i) + 180;
  3931. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3932. , r = Math.atan(t.y / n);
  3933. this.lat = -s.Math.radToDeg(r)
  3934. }
  3935. ,
  3936. t.prototype.startRotationFrom = function(e, t) {
  3937. o.convertScreenPositionToNDC(e, t, this.pointer),
  3938. this.pointerDragOn = !0,
  3939. this.pointerDragStart.copy(this.pointer),
  3940. this.moveStart.copy(this.pointer),
  3941. this.rotationHistory = [],
  3942. this.rotationSpeed.set(0, 0)
  3943. }
  3944. ,
  3945. t.prototype.onMouseOver = function(e) {
  3946. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3947. }
  3948. ,
  3949. t.prototype.onTouchStart = function(e) {
  3950. if (this.usable()) {
  3951. switch (e.preventDefault(),
  3952. e.stopPropagation(),
  3953. e.touches.length) {
  3954. case 1:
  3955. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3956. break;
  3957. case 2:
  3958. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3959. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3960. this.pinchDistance = Math.sqrt(t * t + i * i)
  3961. }
  3962. this.emit(c.InputStart, "touch")
  3963. }
  3964. }
  3965. ,
  3966. t.prototype.onPointerDown = function(e) {
  3967. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3968. id: e.pointerId,
  3969. clientX: e.clientX,
  3970. clientY: e.clientY
  3971. }),
  3972. e.touches = this.pointers,
  3973. this.onTouchStart(e),
  3974. this.emit(c.InputStart, "pointer"))
  3975. }
  3976. ,
  3977. t.prototype.onMouseDown = function(e) {
  3978. if (this.usable()) {
  3979. switch (e.preventDefault(),
  3980. e.stopPropagation(),
  3981. e.button) {
  3982. case a.LEFT:
  3983. this.startRotationFrom(e.clientX, e.clientY)
  3984. }
  3985. this.emit(c.InputStart, "mouse")
  3986. }
  3987. }
  3988. ,
  3989. t.prototype.updateRotation = function() {
  3990. if (this.usable() && this.pointerDragOn) {
  3991. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3992. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3993. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3994. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3995. , r = Math.atan2(e.y, i)
  3996. , o = Math.atan2(t.y, n);
  3997. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3998. e.y = 0,
  3999. t.y = 0;
  4000. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4001. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4002. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4003. this.pointerDragStart.copy(this.pointer)
  4004. }
  4005. }
  4006. ,
  4007. t.prototype.onMouseMove = function(e) {
  4008. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4009. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  4010. }
  4011. ,
  4012. t.prototype.onTouchMove = function(e) {
  4013. if (this.usable())
  4014. switch (this.emit(c.Move, "touch"),
  4015. e.touches.length) {
  4016. case 1:
  4017. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4018. break;
  4019. case 2:
  4020. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4021. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4022. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4023. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4024. this.emit(c.Pinch, n),
  4025. this.pinchDistance -= n)
  4026. }
  4027. }
  4028. ,
  4029. t.prototype.onPointerMove = function(t) {
  4030. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4031. t.pointerId === e.id && (e.clientX = t.clientX,
  4032. e.clientY = t.clientY)
  4033. }),
  4034. t.touches = this.pointers,
  4035. this.onTouchMove(t))
  4036. }
  4037. ,
  4038. t.prototype.endRotation = function() {
  4039. this.pointerDragOn = !1;
  4040. var e = r.averageVectors(this.rotationHistory);
  4041. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4042. }
  4043. ,
  4044. t.prototype.onTouchEnd = function(e) {
  4045. this.usable() && (e.preventDefault(),
  4046. e.stopPropagation(),
  4047. this.endRotation())
  4048. }
  4049. ,
  4050. t.prototype.onMouseUp = function(e) {
  4051. this.usable() && (e.preventDefault(),
  4052. e.stopPropagation(),
  4053. this.endRotation())
  4054. }
  4055. ,
  4056. t.prototype.onPointerUp = function(i) {
  4057. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4058. i.pointerId === e.id && this.pointers.splice(t, 1)
  4059. }
  4060. .bind(this)),
  4061. i.touches = this.pointers,
  4062. this.onTouchEnd(i))
  4063. }
  4064. ,
  4065. t.prototype.update = function(e) {
  4066. for (this.lon,
  4067. this.lat,
  4068. this.updateRotation(),
  4069. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4070. this.rotationHistory.shift();
  4071. this.lon += this.rotationDifference.x,
  4072. this.lat += this.rotationDifference.y,
  4073. this.rotationDifference.set(0, 0),
  4074. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4075. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4076. this.lon += this.rotationSpeed.x * e,
  4077. this.lat += this.rotationSpeed.y * e,
  4078. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4079. this.phi = s.Math.degToRad(90 - this.lat),
  4080. this.theta = s.Math.degToRad(this.lon),
  4081. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4082. this.lookVector.y = Math.cos(this.phi),
  4083. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4084. this.target.copy(this.lookVector).add(this.camera.position),
  4085. this.camera.lookAt(this.target)
  4086. }
  4087. ,
  4088. t.prototype.onMouseWheel = function(e) {
  4089. if (this.usable()) {
  4090. var t = e.wheelDelta || -e.detail;
  4091. this.emit(c.InteractionDirect),
  4092. this.emit(c.Scroll, t)
  4093. }
  4094. }
  4095. ,
  4096. t.prototype.onKeyDown = function(e) {
  4097. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4098. this.handleKeyDown(e.which)))
  4099. }
  4100. ,
  4101. t.prototype.handleKeyDown = function(e) {
  4102. var t = function(e, t) {
  4103. this.rotationAcc[e] = t
  4104. }
  4105. .bind(this);
  4106. this.emit(c.InteractionKey);
  4107. var i = !0;
  4108. switch (e) {
  4109. case l.LEFTARROW:
  4110. case l.J:
  4111. t("x", -1);
  4112. break;
  4113. case l.RIGHTARROW:
  4114. case l.L:
  4115. t("x", 1);
  4116. break;
  4117. case l.I:
  4118. t("y", 1);
  4119. break;
  4120. case l.K:
  4121. t("y", -1);
  4122. break;
  4123. default:
  4124. i = !1
  4125. }
  4126. i && this.emit(c.Move, "key")
  4127. }
  4128. ,
  4129. t.prototype.onKeyUp = function(e) {
  4130. this.usable() && (e.preventDefault(),
  4131. e.stopPropagation(),
  4132. this.handleKeyUp(e.which))
  4133. }
  4134. ,
  4135. t.prototype.handleKeyUp = function(e) {
  4136. switch (e) {
  4137. case l.LEFTARROW:
  4138. case l.J:
  4139. case l.RIGHTARROW:
  4140. case l.L:
  4141. this.rotationAcc.x = 0;
  4142. break;
  4143. case l.I:
  4144. case l.K:
  4145. this.rotationAcc.y = 0
  4146. }
  4147. }
  4148. ,
  4149. t.prototype.startRotating = function(e, t) {
  4150. e && (this.rotationAcc.x = e),
  4151. t && (this.rotationAcc.y = t)
  4152. }
  4153. ,
  4154. t.prototype.stopRotating = function(e) {
  4155. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4156. this.rotationAcc.set(0, 0)
  4157. }
  4158. ,
  4159. t.prototype.reset = function() {
  4160. this.pointerDragOn = !1,
  4161. this.rotationAcc.set(0, 0),
  4162. this.rotationSpeed.set(0, 0),
  4163. this.pointers = []
  4164. }
  4165. ,
  4166. t.prototype.toJSON = function() {
  4167. return {
  4168. camera_position: {
  4169. x: o.toPrecision(this.camera.position.x, 4),
  4170. y: o.toPrecision(this.camera.position.y, 4),
  4171. z: o.toPrecision(this.camera.position.z, 4)
  4172. },
  4173. camera_quaternion: {
  4174. x: o.toPrecision(this.camera.quaternion.x, 4),
  4175. y: o.toPrecision(this.camera.quaternion.y, 4),
  4176. z: o.toPrecision(this.camera.quaternion.z, 4),
  4177. w: o.toPrecision(this.camera.quaternion.w, 4)
  4178. }
  4179. }
  4180. }
  4181. ,
  4182. t.prototype.setStateFromJSON = function(e) {
  4183. this.camera.position.copy(e.camera_position),
  4184. this.camera.quaternion.copy(e.camera_quaternion)
  4185. }
  4186. ,
  4187. d.exports = t
  4188. }
  4189. ).call(this, "/js/controls/PanoramaControls.js")
  4190. }
  4191. , {
  4192. "../enum/ControlEvents": 21,
  4193. "../enum/Keys": 30,
  4194. "../enum/MouseButton": 34,
  4195. "../enum/Vectors": 50,
  4196. "../settings": 166,
  4197. "../util/common": 185,
  4198. "../util/logger": 189,
  4199. "../util/math": 190,
  4200. events: 202,
  4201. three: 217
  4202. }],
  4203. 14: [function(t, i, e) {
  4204. (function(e) {
  4205. "use strict";
  4206. var c = t("three")
  4207. , h = t("../enum/Viewmode")
  4208. , u = new (t("../util/logger"))(e);
  4209. i.exports = {
  4210. serialize: function(e) {
  4211. return encodeURI(JSON.stringify(e))
  4212. },
  4213. deserialize: function(e) {
  4214. function t(e) {
  4215. return e.reduce(function(e, t) {
  4216. return e && "number" == typeof t && !isNaN(t)
  4217. }, !0)
  4218. }
  4219. try {
  4220. var i = JSON.parse(decodeURI(e))
  4221. , n = {
  4222. mode: h.fromInt(i.camera_mode),
  4223. panoId: i.scan_id,
  4224. position: (new c.Vector3).copy(i.camera_position),
  4225. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4226. zoom: i.ortho_zoom,
  4227. floorVisibility: i.floor_visibility
  4228. }
  4229. , r = n.position;
  4230. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4231. var o = n.quaternion;
  4232. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4233. n
  4234. } catch (i) {
  4235. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4236. try {
  4237. var a = e.split(",")
  4238. , s = {
  4239. x: parseFloat(a[2]),
  4240. y: parseFloat(a[3]),
  4241. z: parseFloat(a[4])
  4242. }
  4243. , l = {
  4244. x: parseFloat(a[5]),
  4245. y: parseFloat(a[6]),
  4246. z: parseFloat(a[7]),
  4247. w: parseFloat(a[8])
  4248. };
  4249. return t([s.x, s.y, s.z]) || (s.x = 0,
  4250. s.y = 0,
  4251. s.z = 0),
  4252. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4253. l.y = 0,
  4254. l.z = 0,
  4255. l.w = 1),
  4256. {
  4257. mode: h.fromInt(a[0]),
  4258. panoId: a[1],
  4259. position: (new c.Vector3).copy(s),
  4260. quaternion: (new c.Quaternion).copy(l)
  4261. }
  4262. } catch (t) {
  4263. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4264. }
  4265. }
  4266. return null
  4267. }
  4268. }
  4269. }
  4270. ).call(this, "/js/controls/serializer.js")
  4271. }
  4272. , {
  4273. "../enum/Viewmode": 51,
  4274. "../util/logger": 189,
  4275. three: 217
  4276. }],
  4277. 15: [function(C, I, e) {
  4278. (function(e) {
  4279. "use strict";
  4280. function t() {
  4281. this.endlessLoop = r.warp.loop,
  4282. this.clock = new i.Clock(!0),
  4283. this.model = null,
  4284. this.player = null,
  4285. this.currentItem = null,
  4286. this.destinationItem = null,
  4287. this.tourIsPlaying = !1,
  4288. this.transitionStage = v.None,
  4289. this.nextFunc = null,
  4290. this.onTheBus = !1,
  4291. this.tourInProgress = !1,
  4292. this.reachSource = null,
  4293. this.interrupted = !1,
  4294. this.nItems = 0,
  4295. this.walkingSectionPaused = !1
  4296. }
  4297. var i = C("three")
  4298. , n = C("./util/logger")
  4299. , r = C("./settings")
  4300. , o = C("./util/transitions")
  4301. , a = C("events").EventEmitter
  4302. , s = C("./enum/Viewmode")
  4303. , l = C("./analytics")
  4304. , c = C("./enum/WarpStyle")
  4305. , h = (o = C("./util/transitions"),
  4306. C("./model/ModelManager"),
  4307. C("./enum/ModelManagerEvents"))
  4308. , u = C("./enum/DirectorEvents")
  4309. , d = C("./enum/PlayerEvents")
  4310. , p = (C("./enum/ControlEvents"),
  4311. C("./enum/BlackoutStyle"))
  4312. , f = C("./enum/PathDiscardMode")
  4313. , g = C("./enum/PathDisplayMode")
  4314. , m = (C("./player"),
  4315. new n(e))
  4316. , v = Object.freeze({
  4317. None: 0,
  4318. Moving: 1,
  4319. Aiming: 2,
  4320. Interlude: 3
  4321. })
  4322. , y = Object.freeze({
  4323. Forward: 1,
  4324. NoChange: 0,
  4325. Backwards: -1
  4326. })
  4327. , A = o.getUniqueId();
  4328. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4329. this.player = e,
  4330. this.modelManager = t,
  4331. this.updateModel(),
  4332. this.resetAll(),
  4333. this.bindEvents()
  4334. }
  4335. ,
  4336. t.prototype.resetAll = function() {
  4337. if (this.currentItem = null,
  4338. this.destinationItem = null,
  4339. this.tourIsPlaying = !1,
  4340. this.bgmReplay(),
  4341. this.transitionStage = v.None,
  4342. this.nextFunc = null,
  4343. this.onTheBus = !1,
  4344. this.reachSource = null,
  4345. this.interrupted = !1,
  4346. this.model) {
  4347. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4348. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4349. } else
  4350. this.defaultWarpStyle = c.BLACK,
  4351. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4352. this.resetSpecialTransition()
  4353. }
  4354. ,
  4355. t.prototype.updateModel = function() {
  4356. this.model = this.modelManager.getActiveModel(),
  4357. this.nItems = this.model.heroLocations.length
  4358. }
  4359. ,
  4360. t.prototype.bindEvents = function() {
  4361. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4362. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4363. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4364. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4365. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4366. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4367. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4368. this.player.once(d.Move, function() {
  4369. o.cancelById(A)
  4370. })
  4371. }
  4372. ,
  4373. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4374. return e === c.WALK && (this.interrupt(p.NONE),
  4375. this.pauseWalkingSection(),
  4376. this.player.fastForwardActivePanoFlight(),
  4377. !0)
  4378. }
  4379. ,
  4380. t.prototype.handlePlayerMove = function(e) {
  4381. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4382. this.emit("update.controls")
  4383. }
  4384. ,
  4385. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4386. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4387. this.emit("update.controls"))
  4388. }
  4389. ,
  4390. t.prototype.handlePlayerModeChanged = function(e, t) {
  4391. this.intermediateState() || e === t || (this.onTheBus = !1,
  4392. this.emit("update.controls"))
  4393. }
  4394. ,
  4395. t.prototype.handlePlayerInputStart = function(e) {
  4396. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4397. }
  4398. ,
  4399. t.prototype.handlePlayerFlyingStarted = function() {
  4400. this.clearWalkingSectionPaused()
  4401. }
  4402. ,
  4403. t.prototype.describe = function() {
  4404. return {
  4405. nItems: this.nItems,
  4406. currentItem: this.currentItem,
  4407. destinationItem: this.destinationItem,
  4408. tourIsPlaying: this.tourIsPlaying,
  4409. onTheBus: this.onTheBus,
  4410. endlessLoop: this.endlessLoop,
  4411. viewMode: this.player.mode,
  4412. inTransition: this._inTransition(),
  4413. transitionStage: this.transitionStage,
  4414. tourInProgress: this.tourInProgress
  4415. }
  4416. }
  4417. ,
  4418. t.prototype._inTransition = function() {
  4419. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4420. }
  4421. ,
  4422. t.prototype.bounceable = function() {
  4423. var e = this.clock.getDelta();
  4424. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4425. }
  4426. ,
  4427. t.prototype.currentMoveDirection = function() {
  4428. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4429. }
  4430. ,
  4431. t.prototype.clearPath = function() {
  4432. this._inTransition() || this.player.path.discardPathObject()
  4433. }
  4434. ,
  4435. t.prototype.allFloors = function() {
  4436. this.model.toggleAllFloors()
  4437. }
  4438. ,
  4439. t.prototype.actionComplete = function(e) {
  4440. if (this.interrupted = !1,
  4441. this.transitionStage = v.None,
  4442. this.resetSpecialTransition(),
  4443. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4444. this.tourIsPlaying || (this.player.disablePreRendering(),
  4445. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4446. this.emit("update.controls"),
  4447. this.nextFunc) {
  4448. var t = this.nextFunc;
  4449. this.nextFunc = null,
  4450. t()
  4451. }
  4452. }
  4453. ,
  4454. t.prototype.awaitCompletion = function(e, t) {
  4455. this.nextFunc = t,
  4456. e()
  4457. }
  4458. ,
  4459. t.prototype.updateSuccessFunction = function(e) {
  4460. this.nextFunc = e
  4461. }
  4462. ,
  4463. t.prototype.interrupt = function(e, t) {
  4464. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4465. this.tourIsPlaying = !1,
  4466. this.bgmReplay(),
  4467. this.interrupted = !0,
  4468. this.nextFunc = null,
  4469. this.emit(u.ActionInterrupted),
  4470. null != e || (e = p.BEGINNING),
  4471. this.player.interruptAndFastForward(e, t),
  4472. !0)
  4473. }
  4474. ,
  4475. t.prototype.wouldInterrupt = function() {
  4476. return this.transitionStage !== v.None
  4477. }
  4478. ,
  4479. t.prototype.intermediateState = function() {
  4480. return this.transitionStage !== v.None
  4481. }
  4482. ,
  4483. t.prototype.isInterrupted = function() {
  4484. return this.interrupted
  4485. }
  4486. ,
  4487. t.prototype.pauseWalkingSection = function() {
  4488. this.walkingSectionPaused = !0
  4489. }
  4490. ,
  4491. t.prototype.clearWalkingSectionPaused = function() {
  4492. this.walkingSectionPaused = !1
  4493. }
  4494. ,
  4495. t.prototype.autoTour = function() {
  4496. var i = Date.now();
  4497. this.model.auxDataPromise.then(function() {
  4498. i = Date.now() - i;
  4499. var e = r.warp.auto
  4500. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4501. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4502. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4503. done: function() {
  4504. this.playTour()
  4505. }
  4506. .bind(this),
  4507. name: "_atr",
  4508. id: A
  4509. })
  4510. }
  4511. .bind(this))
  4512. }
  4513. ,
  4514. t.prototype.atDestinationPano = function() {
  4515. if (!this.player.currentPano || null === this.destinationItem)
  4516. return !1;
  4517. var e = this.player.currentPano.id;
  4518. if (void 0 === e)
  4519. return !1;
  4520. var t = this.model.heroLocations;
  4521. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4522. }
  4523. ,
  4524. t.prototype.redirectToItem = function(e, t) {
  4525. if (null != e)
  4526. if (this.wouldInterrupt())
  4527. if (this.player.mode !== s.TRANSITIONING) {
  4528. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4529. var i = function() {
  4530. o.setTimeout(function() {
  4531. this.setDestinationItem(e),
  4532. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4533. }
  4534. .bind(this), 0)
  4535. }
  4536. .bind(this);
  4537. this.interrupt(p.END, 0),
  4538. this.updateSuccessFunction(i)
  4539. } else
  4540. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4541. else
  4542. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4543. else
  4544. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4545. }
  4546. ,
  4547. t.prototype.useSpecialTransition = function(e) {
  4548. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4549. this.nextWarpStyle = c.BLACK
  4550. }
  4551. ,
  4552. t.prototype.resetSpecialTransition = function() {
  4553. this.nextWarpStyle = this.defaultWarpStyle
  4554. }
  4555. ,
  4556. t.prototype.arrivedAtDestination = function(e) {
  4557. if (this.player.flying || this.player.isWarping())
  4558. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4559. else {
  4560. this.transitionStage = v.Aiming;
  4561. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4562. this.player.model.fadePanoMarkers(0),
  4563. this.awaitCompletion(function() {
  4564. this.resetSpecialTransition(),
  4565. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4566. }
  4567. .bind(this), t)
  4568. }
  4569. }
  4570. ,
  4571. t.prototype.goToDestination = function(e, t, i, n) {
  4572. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4573. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4574. if (r && 0 < r.music.length) {
  4575. var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
  4576. g_tourAudio.src = manage.dealURL(o);
  4577. g_tourAudio.load(),
  4578. g_tourAudio.crossOrigin = "anonymous",
  4579. g_tourAudio.oncanplaythrough = function() {
  4580. g_tourAudio.play();
  4581. if(g_bgAudio && !g_bgAudio.paused){
  4582. manage.switchBgmState(false);
  4583. g_bgAudio.pauseByTour = true
  4584. }
  4585. g_playAudio = g_tourAudio;
  4586. }
  4587. }
  4588. }
  4589. if (this.onTheBus = !0,
  4590. this.emit("update.controls"),
  4591. this.player.updateLastView(),
  4592. n || !this.atDestinationPano())
  4593. if (this.player.flying || this.player.isWarping())
  4594. m.warn("Cannot go to new destination while player is flying or warping.");
  4595. else {
  4596. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4597. , s = null
  4598. , l = null;
  4599. if (a.isPano()) {
  4600. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4601. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4602. s = this.arrivedAtDestination.bind(this, !0)
  4603. } else
  4604. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4605. s = this.arrivedAtDestination.bind(this, !1);
  4606. this.transitionStage = v.Moving,
  4607. this.model.fadePanoMarkers(0),
  4608. this.awaitCompletion(function() {
  4609. l()
  4610. }
  4611. .bind(this), s),
  4612. this.emit("update.controls")
  4613. }
  4614. else
  4615. this.arrivedAtDestination(!0)
  4616. }
  4617. ,
  4618. t.prototype.tourInterlude = function() {
  4619. if (l.trackAlways("reach_highlight", {
  4620. reach_source: this.reachSource
  4621. }),
  4622. this.model.fadePanoMarkers(0),
  4623. this.emit("update.controls"),
  4624. this.tourIsPlaying)
  4625. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4626. this.stopTour(),
  4627. this.emit(u.TourEnd),
  4628. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4629. this.transitionStage = v.Interlude,
  4630. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4631. }
  4632. .bind(this), this.goNext.bind(this))
  4633. }
  4634. ,
  4635. t.prototype.playTour = function() {
  4636. if (!this.bounceable())
  4637. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4638. this.tourInProgress = !0,
  4639. this.reachSource = "play",
  4640. this.tourIsPlaying = !0,
  4641. this.wasZoomEnabled = this.player.zoomEnabled,
  4642. this.player.zoomEnabled = !1,
  4643. this.resetSpecialTransition(),
  4644. this.emit("update.controls"),
  4645. this.emit(u.TourStart),
  4646. this.player.enablePreRendering(),
  4647. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4648. this.goToDestination()) : this.goNext()))
  4649. }
  4650. ,
  4651. t.prototype.bgmReplay = function() {
  4652. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4653. g_playAudio = g_bgAudio;
  4654. g_tourAudio && g_tourAudio.pause();
  4655. //window.tourAudio && window.tourAudio.pause();
  4656. manage.switchBgmState(true);
  4657. }
  4658. }
  4659. ,
  4660. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4661. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4662. this.tourIsPlaying = !1,
  4663. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4664. this.interrupt(),
  4665. this.clearWalkingSectionPaused(),
  4666. this.resetSpecialTransition(),
  4667. this.emit("update.controls"))
  4668. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4669. {
  4670. g_tourAudio.pause();
  4671. g_tourAudio.src = ""
  4672. }
  4673. }
  4674. ,
  4675. t.prototype.endTourProgress = function() {
  4676. this.tourInProgress = !1,
  4677. this.emit("update.controls"),
  4678. this.emit(u.TourEnd)
  4679. }
  4680. ,
  4681. t.prototype.goToHighlight = function(e) {
  4682. if (this.wouldInterrupt())
  4683. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4684. else {
  4685. if (m.debug("<tour.goto " + e + ">"),
  4686. this.isInterrupted())
  4687. return;
  4688. this.clearWalkingSectionPaused(),
  4689. this.setDestinationItem(e),
  4690. this.useSpecialTransition("Hilight"),
  4691. this.goToDestination(),
  4692. l.trackAlways("reach_highlight", {
  4693. reach_source: "thumb"
  4694. })
  4695. }
  4696. }
  4697. ,
  4698. t.prototype.prevHighlight = function() {
  4699. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4700. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4701. this.reachSource = "prev",
  4702. this.goPrev()))
  4703. }
  4704. ,
  4705. t.prototype.nextHighlight = function() {
  4706. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4707. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4708. this.reachSource = "next",
  4709. this.goNext()))
  4710. }
  4711. ,
  4712. t.prototype.changeMode = function(e) {
  4713. var t = $.Deferred()
  4714. , i = t.resolve.bind(t)
  4715. , n = t.reject.bind(t);
  4716. if (this.emit(u.StartModeChange),
  4717. !function() {
  4718. return this.clearWalkingSectionPaused(),
  4719. !!this.wouldInterrupt() && (this.interrupt(),
  4720. !0)
  4721. }
  4722. .bind(this)()) {
  4723. switch (e) {
  4724. case s.PANORAMA:
  4725. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4726. break;
  4727. case s.DOLLHOUSE:
  4728. case s.FLOORPLAN:
  4729. this.player.flyToNewMode({
  4730. mode: e
  4731. }).done(i).fail(n);
  4732. break;
  4733. case s.OUTDOOR:
  4734. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4735. }
  4736. return t.promise()
  4737. }
  4738. }
  4739. ,
  4740. t.prototype.atEndOfTour = function() {
  4741. return this.currentItem >= this.nItems - 1
  4742. }
  4743. ,
  4744. t.prototype.firstDestination = function() {
  4745. return 0 < this.nItems ? 0 : null
  4746. }
  4747. ,
  4748. t.prototype.finalDestination = function() {
  4749. return 0 < this.nItems ? this.nItems - 1 : null
  4750. }
  4751. ,
  4752. t.prototype.goPrev = function() {
  4753. this.tourAdvance(-1)
  4754. }
  4755. ,
  4756. t.prototype.goNext = function() {
  4757. this.tourAdvance(1)
  4758. }
  4759. ,
  4760. t.prototype.setDestinationItem = function(e) {
  4761. this.destinationItem = e,
  4762. this.emit("update.controls")
  4763. }
  4764. ,
  4765. t.prototype.setCurrentItem = function(e) {
  4766. this.currentItem = e,
  4767. this.emit("update.controls")
  4768. }
  4769. ,
  4770. t.prototype.nextItem = function(e) {
  4771. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4772. }
  4773. ,
  4774. t.prototype.prevItem = function(e) {
  4775. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4776. }
  4777. ,
  4778. t.prototype.tourAdvance = function(e) {
  4779. if (m.debug("tourAdvance(" + e + ")"),
  4780. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4781. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4782. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4783. this.useSpecialTransition("looping back to start")),
  4784. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4785. var i = this.player.zoomLevel;
  4786. this.player.zoomEnabled = !0;
  4787. var t = function(e, t) {
  4788. this.player.zoomTo((1 - e) * i, !0)
  4789. }
  4790. .bind(this);
  4791. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4792. }
  4793. this.goToDestination()
  4794. }
  4795. ,
  4796. I.exports = t
  4797. }
  4798. ).call(this, "/js/director.js")
  4799. }
  4800. , {
  4801. "./analytics": 4,
  4802. "./enum/BlackoutStyle": 18,
  4803. "./enum/ControlEvents": 21,
  4804. "./enum/DirectorEvents": 23,
  4805. "./enum/ModelManagerEvents": 33,
  4806. "./enum/PathDiscardMode": 38,
  4807. "./enum/PathDisplayMode": 39,
  4808. "./enum/PlayerEvents": 40,
  4809. "./enum/Viewmode": 51,
  4810. "./enum/WarpStyle": 52,
  4811. "./model/ModelManager": 140,
  4812. "./player": 155,
  4813. "./settings": 166,
  4814. "./util/logger": 189,
  4815. "./util/transitions": 195,
  4816. events: 202,
  4817. three: 217
  4818. }],
  4819. 16: [function(e, t, i) {
  4820. "use strict";
  4821. var n = e("three")
  4822. , r = e("./enum/Viewmode")
  4823. , o = (e("./settings"),
  4824. e("./util/transitions"))
  4825. , a = e("./enum/PlayerEvents")
  4826. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4827. , l = new n.ShaderPass(n.VerticalBlurShader);
  4828. l.renderToScreen = !0;
  4829. var c = $("#player").width() / $("#player").height();
  4830. isNaN(c) && (c = 1);
  4831. var h = {
  4832. currentBlur: 0,
  4833. aspect: c,
  4834. blurStrength: 1,
  4835. hblurPass: s,
  4836. vblurPass: l,
  4837. bindEvents: function(e) {
  4838. e.on(a.ModeChanged, function(e, t) {
  4839. e === r.PANORAMA && (o.cancel(h.blur),
  4840. o.cancel(h.addBlur),
  4841. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4842. })
  4843. },
  4844. blur: function(e) {
  4845. var t = (h.currentBlur = e) * h.blurStrength;
  4846. l.uniforms.v.value = t / 512 * h.aspect,
  4847. s.uniforms.h.value = t / 512
  4848. },
  4849. addBlur: function(e) {
  4850. e = Math.max(e, h.currentBlur),
  4851. h.blur(e)
  4852. },
  4853. removeBlur: function(e) {
  4854. e = Math.min(1 - e, h.currentBlur),
  4855. h.blur(e)
  4856. }
  4857. };
  4858. h.blur(0),
  4859. t.exports = h
  4860. }
  4861. , {
  4862. "./enum/PlayerEvents": 40,
  4863. "./enum/Viewmode": 51,
  4864. "./settings": 166,
  4865. "./util/transitions": 195,
  4866. three: 217
  4867. }],
  4868. 17: [function(e, t, i) {
  4869. "use strict";
  4870. t.exports = {
  4871. UNKNOWN: 0,
  4872. ALIGNED: 1,
  4873. UNALIGNED: 2,
  4874. PLACED: 3
  4875. }
  4876. }
  4877. , {}],
  4878. 18: [function(e, t, i) {
  4879. "use strict";
  4880. t.exports = {
  4881. NONE: 0,
  4882. MIDDLE: 1,
  4883. END: 2,
  4884. BEGINNING: 3,
  4885. FADEIN: 4
  4886. }
  4887. }
  4888. , {}],
  4889. 19: [function(e, t, i) {
  4890. "use strict";
  4891. var r = e("three");
  4892. t.exports = {
  4893. newBlue: new r.Color(4967932),
  4894. altBlue: new r.Color(47355),
  4895. tagDefault: new r.Color(223357),
  4896. classicBlue: new r.Color(53759),
  4897. mpYellow: new r.Color(16502016),
  4898. mpOrange: new r.Color(16428055),
  4899. mpBlue: new r.Color(12096),
  4900. mpLtGrey: new r.Color(13751252),
  4901. mpDkGrey: new r.Color(10000019),
  4902. mpRed: new r.Color(12525854),
  4903. mpOrangeDesat: new r.Color(16764529),
  4904. mpBlueDesat: new r.Color(4034734),
  4905. mpRedDesat: new r.Color(14705505),
  4906. white: new r.Color(16777215),
  4907. black: new r.Color(0),
  4908. _desat: function(e, t) {
  4909. var i = t || .3
  4910. , n = (new r.Color).copy(e).getHSL();
  4911. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4912. },
  4913. _darken: function(e, t) {
  4914. var i = t || .2
  4915. , n = e.getHSL();
  4916. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4917. }
  4918. }
  4919. }
  4920. , {
  4921. three: 217
  4922. }],
  4923. 20: [function(e, t, i) {
  4924. "use strict";
  4925. t.exports = {
  4926. NONE: -1,
  4927. ROTATE: 0,
  4928. DOLLY: 1,
  4929. PAN: 2,
  4930. ROTATE_DOLLY: 3,
  4931. PAN_DOLLY: 4
  4932. }
  4933. }
  4934. , {}],
  4935. 21: [function(e, t, i) {
  4936. "use strict";
  4937. t.exports = {
  4938. Move: "move",
  4939. InteractionDirect: "interaction.direct",
  4940. InteractionKey: "interaction.key",
  4941. InteractionGui: "interaction.gui",
  4942. FlyInDirection: "fly.direction",
  4943. InputStart: "input.start",
  4944. Pinch: "input.pinch",
  4945. Scroll: "input.scroll",
  4946. AutoPanInterrupt: "autopan.interrupt",
  4947. AutoPanComplete: "autopan.complete",
  4948. AutoPanClamped: "autopan.clamped",
  4949. LongTap: "longtap"
  4950. }
  4951. }
  4952. , {}],
  4953. 22: [function(e, t, i) {
  4954. "use strict";
  4955. t.exports = Object.freeze({
  4956. FORWARD: "FORWARD",
  4957. LEFT: "LEFT",
  4958. RIGHT: "RIGHT",
  4959. BACK: "BACK",
  4960. UP: "UP",
  4961. DOWN: "DOWN"
  4962. })
  4963. }
  4964. , {}],
  4965. 23: [function(e, t, i) {
  4966. "use strict";
  4967. t.exports = {
  4968. ActionInterrupted: "action.interrupted",
  4969. TourStart: "tour.start",
  4970. TourEnd: "tour.end",
  4971. StartModeChange: "mode.startChange"
  4972. }
  4973. }
  4974. , {}],
  4975. 24: [function(e, t, i) {
  4976. "use strict";
  4977. t.exports = Object.freeze({
  4978. None: 0,
  4979. Queued: 1,
  4980. ForceQueued: 2,
  4981. Downloading: 3,
  4982. Downloaded: 4,
  4983. DownloadFailed: 5
  4984. })
  4985. }
  4986. , {}],
  4987. 25: [function(e, t, i) {
  4988. "use strict";
  4989. t.exports = {
  4990. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4991. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4992. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4993. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4994. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4995. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4996. }
  4997. }
  4998. , {}],
  4999. 26: [function(e, t, i) {
  5000. "use strict";
  5001. t.exports = {
  5002. Texture2D: 0,
  5003. TextureCube: 1
  5004. }
  5005. }
  5006. , {}],
  5007. 27: [function(e, t, i) {
  5008. "use strict";
  5009. t.exports = {
  5010. SMALL: "small",
  5011. LARGE: "large"
  5012. }
  5013. }
  5014. , {}],
  5015. 28: [function(e, t, i) {
  5016. "use strict";
  5017. var n = e("./Viewmode")
  5018. , r = {
  5019. LANDING: {},
  5020. NAVIGATION: "navigation",
  5021. MORE_HELP: "moreHelp",
  5022. TOUR_INTERACTION: {}
  5023. };
  5024. r.LANDING[n.PANORAMA] = "panorama.landing",
  5025. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5026. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5027. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5028. r.TOUR_INTERACTION.standard = "standard.tour",
  5029. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5030. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5031. t.exports = r
  5032. }
  5033. , {
  5034. "./Viewmode": 51
  5035. }],
  5036. 29: [function(e, t, i) {
  5037. "use strict";
  5038. var n = {
  5039. UP: 1,
  5040. DOWN: -1,
  5041. LEFT: "L",
  5042. RIGHT: "R",
  5043. FORWARD: "F",
  5044. BACK: "B",
  5045. reverse: {},
  5046. opposite: function(e) {
  5047. return this.reverse[e.toString()]
  5048. }
  5049. };
  5050. n.reverse[n.UP] = n.DOWN,
  5051. n.reverse[n.DOWN] = n.UP,
  5052. n.reverse[n.LEFT] = n.RIGHT,
  5053. n.reverse[n.RIGHT] = n.LEFT,
  5054. n.reverse[n.FORWARD] = n.BACK,
  5055. n.reverse[n.BACK] = n.FORWARD,
  5056. t.exports = n
  5057. }
  5058. , {}],
  5059. 30: [function(e, t, i) {
  5060. "use strict";
  5061. var n = {
  5062. ZERO: 48,
  5063. ONE: 49,
  5064. TWO: 50,
  5065. THREE: 51,
  5066. FOUR: 52,
  5067. FIVE: 53,
  5068. SIX: 54,
  5069. SEVEN: 55,
  5070. EIGHT: 56,
  5071. NINE: 57,
  5072. LEFTARROW: 37,
  5073. UPARROW: 38,
  5074. RIGHTARROW: 39,
  5075. DOWNARROW: 40,
  5076. A: 65,
  5077. B: 66,
  5078. C: 67,
  5079. D: 68,
  5080. E: 69,
  5081. F: 70,
  5082. G: 71,
  5083. H: 72,
  5084. I: 73,
  5085. J: 74,
  5086. K: 75,
  5087. L: 76,
  5088. M: 77,
  5089. N: 78,
  5090. O: 79,
  5091. P: 80,
  5092. Q: 81,
  5093. R: 82,
  5094. S: 83,
  5095. T: 84,
  5096. U: 85,
  5097. V: 86,
  5098. W: 87,
  5099. X: 88,
  5100. Y: 89,
  5101. Z: 90,
  5102. SPACE: 32,
  5103. RETURN: 13,
  5104. SEMICOLON: 186,
  5105. PLUSEQUALS: 187,
  5106. DASHUNDERSCORE: 189,
  5107. OPENBRACKET: 219
  5108. };
  5109. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5110. n.PLUSEQUALS = 61,
  5111. n.DASHUNDERSCORE = 173),
  5112. t.exports = n
  5113. }
  5114. , {
  5115. "../util/browser": 182
  5116. }],
  5117. 31: [function(e, t, i) {
  5118. "use strict";
  5119. t.exports = {
  5120. EN_US: "en-US",
  5121. ES_MX: "es-MX",
  5122. FR_FR: "fr-FR",
  5123. DE_DE: "de-DE",
  5124. RU_RU: "ru-RU",
  5125. CN_CN: "cn-CN",
  5126. JP_JP: "jp-JP"
  5127. }
  5128. }
  5129. , {}],
  5130. 32: [function(e, t, i) {
  5131. "use strict";
  5132. t.exports = {
  5133. TagActivated: "tag.activated",
  5134. TagDismissed: "tag.dismissed",
  5135. TagNavigation: "tag.navigation"
  5136. }
  5137. }
  5138. , {}],
  5139. 33: [function(e, t, i) {
  5140. "use strict";
  5141. t.exports = {
  5142. ModelAdded: "model-added",
  5143. ActiveModelChanged: "active-model-changed"
  5144. }
  5145. }
  5146. , {}],
  5147. 34: [function(e, t, i) {
  5148. "use strict";
  5149. t.exports = {
  5150. LEFT: 0,
  5151. MIDDLE: 1,
  5152. RIGHT: 2
  5153. }
  5154. }
  5155. , {}],
  5156. 35: [function(e, t, i) {
  5157. "use strict";
  5158. t.exports = {
  5159. PanoRenderComplete: "panorama.render.complete",
  5160. TileRenderFailure: "panorama.tile.render.failed",
  5161. TileRenderSuccess: "panorama.tile.render.success",
  5162. TileUploadAttempted: "panorama.tile.upload.attempted",
  5163. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5164. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5165. }
  5166. }
  5167. , {}],
  5168. 36: [function(e, t, i) {
  5169. "use strict";
  5170. t.exports = {
  5171. BASE: 1,
  5172. STANDARD: 2,
  5173. HIGH: 3,
  5174. ULTRAHIGH: 4
  5175. }
  5176. }
  5177. , {}],
  5178. 37: [function(e, t, i) {
  5179. "use strict";
  5180. t.exports = {
  5181. LoadComplete: "panorama.load.complete",
  5182. LoadFailed: "panorama.load.failed",
  5183. TileLoaded: "panorama.tile.loaded"
  5184. }
  5185. }
  5186. , {}],
  5187. 38: [function(e, t, i) {
  5188. "use strict";
  5189. t.exports = Object.freeze({
  5190. Standard: 0,
  5191. Slow: 1,
  5192. Retain: 2
  5193. })
  5194. }
  5195. , {}],
  5196. 39: [function(e, t, i) {
  5197. "use strict";
  5198. t.exports = Object.freeze({
  5199. Show: 0,
  5200. Hide: 1,
  5201. Retain: 2
  5202. })
  5203. }
  5204. , {}],
  5205. 40: [function(e, t, i) {
  5206. "use strict";
  5207. t.exports = {
  5208. Move: "move",
  5209. MoveComplete: "move.complete",
  5210. ModeChanged: "mode.changed",
  5211. ModeChanging: "mode.changing",
  5212. PanoChosen: "pano.chosen",
  5213. ClosestPanoChanging: "closest.pano.changing",
  5214. WarpStarted: "warp.started",
  5215. WarpInterrupted: "warp.interrupted",
  5216. WarpEnded: "warp.ended",
  5217. FlyinFinished: "flyin.finished",
  5218. FlyingStarted: "flying.started",
  5219. FlyingInterrupted: "flying.interrupted",
  5220. FlyingEnded: "flying.ended",
  5221. Ready: "ready",
  5222. StartInside: "start.inside",
  5223. StartOutside: "start.outside",
  5224. ViewChanged: "view.changed",
  5225. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5226. InputStart: "input.start"
  5227. }
  5228. }
  5229. , {}],
  5230. 41: [function(e, t, i) {
  5231. "use strict";
  5232. t.exports = Object.freeze({
  5233. DEFAULT: 0,
  5234. PANOMARKERS: 1,
  5235. RETICULE: 2,
  5236. TAG: 3
  5237. })
  5238. }
  5239. , {}],
  5240. 42: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. visibleFloor: 1,
  5244. ghostFloor: 3,
  5245. boundingSkybox: 1,
  5246. panoMarker: 2,
  5247. reticule: 3,
  5248. tagStem: 4,
  5249. tagDisc: 5,
  5250. ribbon: 100
  5251. }
  5252. }
  5253. , {}],
  5254. 43: [function(e, t, i) {
  5255. "use strict";
  5256. t.exports = {
  5257. ContextCreated: "scene-renderer-context-created",
  5258. AfterRender: "after-render",
  5259. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5260. }
  5261. }
  5262. , {}],
  5263. 44: [function(e, t, i) {
  5264. "use strict";
  5265. t.exports = {
  5266. IDLE: "idle",
  5267. BROWSE: "browse",
  5268. EXAMINE: "examine"
  5269. }
  5270. }
  5271. , {}],
  5272. 45: [function(e, t, i) {
  5273. "use strict";
  5274. t.exports = {
  5275. TileDownloadSuccess: "tiledownloader.download.success",
  5276. TileDownloadFailure: "tiledownloader.download.failure",
  5277. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5278. }
  5279. }
  5280. , {}],
  5281. 46: [function(e, t, i) {
  5282. "use strict";
  5283. t.exports = {
  5284. CardboardAndroid: "googlevr",
  5285. GearVR: "gearvr",
  5286. CardboardIOS: "googlevrios",
  5287. Cardboard: "googlevr"
  5288. }
  5289. }
  5290. , {}],
  5291. 47: [function(e, t, i) {
  5292. "use strict";
  5293. t.exports = {
  5294. NONE: 0,
  5295. CONTEXTUAL: 1,
  5296. ANDROID: 2
  5297. }
  5298. }
  5299. , {}],
  5300. 48: [function(e, t, i) {
  5301. "use strict";
  5302. var n = {
  5303. Title: 0,
  5304. Cardboard: 1
  5305. }
  5306. , r = {
  5307. Title: 0,
  5308. Cardboard: 1,
  5309. Gear: 2
  5310. };
  5311. [n, r].forEach(function(e) {
  5312. e.pageCount = Object.keys(e).length
  5313. }),
  5314. t.exports.ios = n,
  5315. t.exports.standard = r
  5316. }
  5317. , {}],
  5318. 49: [function(e, t, i) {
  5319. "use strict";
  5320. t.exports = {
  5321. Android: "android",
  5322. IOS: "ios",
  5323. Desktop: "desktop",
  5324. UnsupportedAndroid: "android-unsupported"
  5325. }
  5326. }
  5327. , {}],
  5328. 50: [function(e, t, i) {
  5329. "use strict";
  5330. var n = e("three");
  5331. t.exports = {
  5332. UP: new n.Vector3(0,1,0),
  5333. DOWN: new n.Vector3(0,-1,0),
  5334. LEFT: new n.Vector3(-1,0,0),
  5335. RIGHT: new n.Vector3(1,0,0),
  5336. FORWARD: new n.Vector3(0,0,-1),
  5337. BACK: new n.Vector3(0,0,1)
  5338. }
  5339. }
  5340. , {
  5341. three: 217
  5342. }],
  5343. 51: [function(e, t, i) {
  5344. "use strict";
  5345. var n = e("../exception/ViewmodeConvertException")
  5346. , r = e("./coreViewmodes")
  5347. , o = {
  5348. MESH: "mesh",
  5349. OUTDOOR: "outdoor",
  5350. TRANSITIONING: "transitioning",
  5351. toInt: function(e) {
  5352. switch (e) {
  5353. case this.PANORAMA:
  5354. return 1;
  5355. case this.DOLLHOUSE:
  5356. return 2;
  5357. case this.FLOORPLAN:
  5358. return 3;
  5359. case this.OUTDOOR:
  5360. return 4;
  5361. case this.TRANSITIONING:
  5362. return -1
  5363. }
  5364. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5365. },
  5366. fromInt: function(e) {
  5367. switch (e) {
  5368. case "1":
  5369. case 1:
  5370. return this.PANORAMA;
  5371. case "2":
  5372. case 2:
  5373. return this.DOLLHOUSE;
  5374. case "3":
  5375. case 3:
  5376. return this.FLOORPLAN;
  5377. case "4":
  5378. case 4:
  5379. return this.OUTDOOR
  5380. }
  5381. throw new n("No known conversion for int to viewmode for int: " + e)
  5382. },
  5383. convertWorkshopModeInt: function(e) {
  5384. switch (e) {
  5385. case "0":
  5386. case 0:
  5387. case void 0:
  5388. return this.PANORAMA;
  5389. case "1":
  5390. case 1:
  5391. return this.FLOORPLAN;
  5392. case "2":
  5393. case 2:
  5394. return this.DOLLHOUSE;
  5395. case "3":
  5396. case 3:
  5397. return this.MESH
  5398. }
  5399. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5400. }
  5401. };
  5402. e("../util/common").extendObject(o, r),
  5403. t.exports = o
  5404. }
  5405. , {
  5406. "../exception/ViewmodeConvertException": 58,
  5407. "../util/common": 185,
  5408. "./coreViewmodes": 54
  5409. }],
  5410. 52: [function(e, t, i) {
  5411. "use strict";
  5412. t.exports = {
  5413. BLACK: "black",
  5414. STD: "std",
  5415. WALK: "walk"
  5416. }
  5417. }
  5418. , {}],
  5419. 53: [function(e, t, i) {
  5420. "use strict";
  5421. t.exports = {
  5422. ZoomIn: "zoom.in",
  5423. ZoomOut: "zoom.out",
  5424. ZoomMax: "zoom.max",
  5425. ZoomMin: "zoom.min"
  5426. }
  5427. }
  5428. , {}],
  5429. 54: [function(e, t, i) {
  5430. "use strict";
  5431. t.exports = {
  5432. PANORAMA: "panorama",
  5433. DOLLHOUSE: "dollhouse",
  5434. FLOORPLAN: "floorplan"
  5435. }
  5436. }
  5437. , {}],
  5438. 55: [function(e, t, i) {
  5439. "use strict";
  5440. t.exports = function(e) {
  5441. this.message = e
  5442. }
  5443. }
  5444. , {}],
  5445. 56: [function(e, t, i) {
  5446. "use strict";
  5447. function n(e) {
  5448. r.call(this, e)
  5449. }
  5450. var r = e("./BasicException");
  5451. n.prototype = Object.create(r.prototype),
  5452. t.exports = n
  5453. }
  5454. , {
  5455. "./BasicException": 55
  5456. }],
  5457. 57: [function(e, t, i) {
  5458. "use strict";
  5459. function n(e) {
  5460. r.call(this, e)
  5461. }
  5462. var r = e("./BasicException");
  5463. n.prototype = Object.create(r.prototype),
  5464. t.exports = n
  5465. }
  5466. , {
  5467. "./BasicException": 55
  5468. }],
  5469. 58: [function(e, t, i) {
  5470. "use strict";
  5471. function n(e) {
  5472. r.call(this, e)
  5473. }
  5474. var r = e("./BasicException");
  5475. n.prototype = Object.create(r.prototype),
  5476. t.exports = n
  5477. }
  5478. , {
  5479. "./BasicException": 55
  5480. }],
  5481. 59: [function(a, s, e) {
  5482. (function(e) {
  5483. "use strict";
  5484. var i = a("./util/ajax")
  5485. , n = a("./util/showcase")
  5486. , t = a("./util/logger")
  5487. , r = new t(e)
  5488. , o = {};
  5489. s.exports = {
  5490. loadFeatureFlags: function(e) {
  5491. var t = $.Deferred();
  5492. return i.get(e.urlBase + "", {
  5493. responseType: "json",
  5494. prefetchFrom: "user",
  5495. auth: n.getAuthorizationHeader()
  5496. }).done(function(e) {
  5497. (o = function(e) {
  5498. var t = {};
  5499. if (e) {
  5500. var i = e.flags;
  5501. if (i)
  5502. for (var n in i)
  5503. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5504. return t
  5505. }
  5506. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5507. null
  5508. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5509. }).fail(function() {
  5510. r.debug("Retrieval of feature flags failed."),
  5511. t.reject("loading-failed")
  5512. }),
  5513. t.promise()
  5514. },
  5515. getFlags: function() {
  5516. return o
  5517. },
  5518. updateDependentSettings: function(e, t) {
  5519. (e = e || o).labels && (t.labels.enabled = !0),
  5520. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5521. e.showcase_sdk && (t.sdkInit = !0),
  5522. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5523. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5524. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5525. e.hide_sc_sharing && (t.share.enabled = !1)
  5526. }
  5527. }
  5528. }
  5529. ).call(this, "/js/featureflags.js")
  5530. }
  5531. , {
  5532. "./util/ajax": 181,
  5533. "./util/logger": 189,
  5534. "./util/showcase": 193
  5535. }],
  5536. 60: [function(e, t, i) {
  5537. "use strict";
  5538. var n = (e("../util/common"),
  5539. {
  5540. status: 0,
  5541. set: function(e) {
  5542. if (isNaN(e))
  5543. return !1;
  5544. var t = $(".progressbar");
  5545. e < 0 && (e = 0),
  5546. 100 < e && (e = 100);
  5547. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5548. , n = Math.round(e)
  5549. , r = parseInt(i) - 15;
  5550. t.find(".bar").css("width", i),
  5551. t.find(".label").css("left", r),
  5552. t.find(".perc").text(n + "%"),
  5553. this.status = e
  5554. },
  5555. done: function(e) {
  5556. return e || this.status ? (this.status = null,
  5557. this.set(100)) : this
  5558. }
  5559. });
  5560. t.exports.circleLoader = n
  5561. }
  5562. , {
  5563. "../util/common": 185
  5564. }],
  5565. 61: [function(e, t, i) {
  5566. "use strict";
  5567. t.exports = Object.freeze({
  5568. CLOSE: "modal.closer.close"
  5569. })
  5570. }
  5571. , {}],
  5572. 62: [function(e, t, i) {
  5573. "use strict";
  5574. function n(t, e) {
  5575. function i() {
  5576. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5577. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5578. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5579. c.classList.remove("closeByFooter")))
  5580. }
  5581. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5582. }
  5583. var r = e("../../settings")
  5584. , o = (e("../../tag/Media/MediaEvent"),
  5585. e("../../util/browser"))
  5586. , a = e("../../util/common")
  5587. , s = e("./ModalCloserEvent")
  5588. , l = e("events").EventEmitter
  5589. , c = document.getElementsByClassName("footer")[0]
  5590. , h = c.querySelectorAll(".close")[0]
  5591. , u = null
  5592. , d = null
  5593. , p = null
  5594. , f = (o.isMobile(),
  5595. {
  5596. open: function(e) {
  5597. e && (n(e),
  5598. u && h.removeEventListener("click", u, !0),
  5599. u = function(e, t) {
  5600. t && (t.stopPropagation(),
  5601. t.preventDefault()),
  5602. e && this.emit(s.CLOSE, e),
  5603. f.reset()
  5604. }
  5605. .bind(this, e.id),
  5606. h.addEventListener("click", u, !0),
  5607. d && window.removeEventListener("resize", d, !0),
  5608. d = n.bind(this, e),
  5609. window.addEventListener("resize", d, !0))
  5610. },
  5611. reset: function() {
  5612. c.classList.remove("closeByFooter"),
  5613. h.removeEventListener("click", u, !0),
  5614. window.removeEventListener("resize", d, !0),
  5615. u = d = p = null
  5616. }
  5617. });
  5618. a.extendObject(f, l.prototype),
  5619. t.exports = f
  5620. }
  5621. , {
  5622. "../../tag/Media/MediaEvent": 131,
  5623. "../../settings": 166,
  5624. "../../util/browser": 182,
  5625. "../../util/common": 185,
  5626. "./ModalCloserEvent": 61,
  5627. events: 202
  5628. }],
  5629. 63: [function(e, t, i) {
  5630. "use strict";
  5631. var A = e("../lib/dat.gui")
  5632. , C = e("three")
  5633. , I = e("../util/easing")
  5634. , E = e("../enum/Viewmode")
  5635. , _ = e("../enum/Colors")
  5636. , b = e("../enum/WarpStyle")
  5637. , w = e("../settings");
  5638. e("../tag/tag"),
  5639. A.GUI.prototype.removeFolder = function(e) {
  5640. var t = this.__folders[e];
  5641. t && (t.close(),
  5642. this.__ul.removeChild(t.domElement.parentNode),
  5643. delete this.__folders[e],
  5644. this.onResize())
  5645. }
  5646. ,
  5647. t.exports.toggle = function(t, e, i) {
  5648. var n = new A.GUI({
  5649. width: 400
  5650. })
  5651. , r = n.addFolder("Flydown from Dollhouse");
  5652. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5653. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5654. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5655. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5656. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5657. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5658. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5659. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5660. var o = n.addFolder("Transition between panos");
  5661. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5662. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5663. w.transition.flyTime = 0,
  5664. o.__controllers.forEach(function(e) {
  5665. e.updateDisplay()
  5666. })
  5667. }),
  5668. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5669. w.transition.flySpeed = 0,
  5670. o.__controllers.forEach(function(e) {
  5671. e.updateDisplay()
  5672. })
  5673. }),
  5674. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5675. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5676. o.add(w.transition, "movementEasing", Object.keys(I));
  5677. var a = n.addFolder("Path Display");
  5678. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5679. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5680. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5681. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5682. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5683. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5684. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5685. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5686. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5687. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5688. w.path.color = _[w.path.color],
  5689. w.path.colorUp = _._desat(w.path.color),
  5690. w.path.colorDown = _.darken(w.path.color)
  5691. }),
  5692. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5693. w.reticuleColor = _[w.reticuleColor]
  5694. });
  5695. var s = n.addFolder("Warping")
  5696. , l = s.addFolder("Warp/Teleport");
  5697. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5698. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5699. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5700. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5701. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5702. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5703. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5704. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5705. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5706. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5707. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5708. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5709. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5710. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5711. w.path.typ = b[w.path.typ]
  5712. }),
  5713. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5714. e.endlessLoop = w.warp.loop
  5715. }),
  5716. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5717. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5718. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5719. var c = s.addFolder("Long Warp Only");
  5720. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5721. w.warp.flySpeed = 0,
  5722. c.__controllers.forEach(function(e) {
  5723. e.updateDisplay()
  5724. })
  5725. }),
  5726. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5727. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5728. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5729. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5730. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5731. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5732. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5733. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5734. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5735. var h = n.addFolder("Warp Esoterica");
  5736. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5737. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5738. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5739. w.warp.minWarpTime = 0,
  5740. h.__controllers.forEach(function(e) {
  5741. e.updateDisplay()
  5742. })
  5743. }),
  5744. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5745. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5746. h.add(w.warp, "movementEasing", Object.keys(I));
  5747. var u = n.addFolder("Misc");
  5748. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5749. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5750. }),
  5751. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5752. i.cameras[E.PANORAMA].fov = w.insideFOV
  5753. }),
  5754. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5755. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5756. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5757. var d = n.addFolder("Navigation");
  5758. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5759. w.navigation.panoScores || t.panos.forEach(function(e) {
  5760. e.floor.remove(e.text3d),
  5761. e.text3d = null
  5762. })
  5763. }),
  5764. d.add(w.navigation, "mouseDirection"),
  5765. d.add(w.navigation, "filterStrictness", 0, 1),
  5766. d.add(w.navigation, "angleFactor", -60, 0),
  5767. d.add(w.navigation, "directionFactor", 1, 20),
  5768. d.add(w.navigation, "distanceFactor", -5, 5),
  5769. d.add(w.navigation, "optionalityFactor", .1, 10);
  5770. var p = n.addFolder("tags")
  5771. , f = p.addFolder("Tag Creation");
  5772. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5773. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5774. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5775. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5776. var g = p.addFolder("Visibility");
  5777. g.add(w.tags.visibility, "anyDistance"),
  5778. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5779. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5780. g.add(w.tags.visibility, "hideViaFloor"),
  5781. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5782. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5783. var m = p.addFolder("Disc Parameters");
  5784. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5785. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5786. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5787. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5788. }),
  5789. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5790. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5791. }),
  5792. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5793. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5794. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5795. var v = p.addFolder("Navigate");
  5796. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5797. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5798. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5799. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5800. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5801. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5802. var y = n.addFolder("Debug");
  5803. y.add(w, "wireframe").onFinishChange(function() {
  5804. t.chunks.forEach(function(e) {
  5805. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5806. e.wireframeTwin.material.depthWrite = !1,
  5807. e.wireframeTwin.material.depthTest = !1,
  5808. e.wireframeTwin.material.opacity = .5,
  5809. e.wireframeTwin.material.transparent = !0),
  5810. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5811. })
  5812. }),
  5813. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5814. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5815. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5816. t.skybox.wireframe = null)
  5817. }),
  5818. y.add(w, "showSweeps").onFinishChange(function() {
  5819. t.setSweepVisibility(w.showSweeps)
  5820. }),
  5821. y.add(w, "showMesh").onFinishChange(function() {
  5822. t.chunks.forEach(function(e) {
  5823. e.visible = w.showMesh
  5824. })
  5825. }),
  5826. y.add(w, "showFloors").onFinishChange(function() {
  5827. t.floors.forEach(function(e) {
  5828. e.collider.children.forEach(function(e) {
  5829. e.material.visible = w.showFloors
  5830. })
  5831. })
  5832. }),
  5833. y.add(w, "showSkyboxes").onFinishChange(function() {
  5834. t.panos.forEach(function(e) {
  5835. e.skyboxMesh.visible = w.showSkyboxes
  5836. })
  5837. }),
  5838. y.add(w, "showNeighbors").onChange(function() {}),
  5839. y.add(t, "alpha", 0, 1)
  5840. }
  5841. }
  5842. , {
  5843. "../enum/Colors": 19,
  5844. "../enum/Viewmode": 51,
  5845. "../enum/WarpStyle": 52,
  5846. "../lib/dat.gui": 93,
  5847. "../tag/tag": 123,
  5848. "../settings": 166,
  5849. "../util/easing": 186,
  5850. three: 217
  5851. }],
  5852. 64: [function(c, h, e) {
  5853. (function(e) {
  5854. "use strict";
  5855. function i(e, t, i, n) {
  5856. $(".gui-error .error-problem-text").text(e),
  5857. $(".gui-error .error-solution-text").text(t),
  5858. $(".gui-error .error-explanation").text(i),
  5859. $(".gui-error .error-actions").html(n),
  5860. $(window).resize(),
  5861. $(".gui-error").fadeIn(),
  5862. $("#bottom-logo").fadeIn()
  5863. }
  5864. function n(e) {
  5865. 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("");
  5866. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5867. r.isMobile() || $("[rel=tiletip]").tooltip({
  5868. placement: "bottom",
  5869. delay: {
  5870. show: 50,
  5871. hide: 0
  5872. },
  5873. trigger: "hover",
  5874. viewport: {
  5875. selector: "body",
  5876. padding: 10
  5877. }
  5878. })
  5879. }
  5880. function t() {
  5881. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5882. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5883. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5884. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5885. e.preventDefault(),
  5886. e.stopPropagation(),
  5887. n(" ")
  5888. })
  5889. }
  5890. var r = c("./../util/browser")
  5891. , o = c("./../analytics")
  5892. , a = c("./../settings")
  5893. , s = c("../localization/localize")
  5894. , l = new (c("./../util/logger"))(e);
  5895. h.exports.error = function(e) {
  5896. if ($("head title").text(a.pageTitle),
  5897. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5898. $("#gui-loading").fadeOut(250),
  5899. $("#quick-blackout").hide(),
  5900. o.track("showcase_error", {
  5901. error_key: e
  5902. }),
  5903. s.locale || s.init(),
  5904. "webgl-unsupported" === e)
  5905. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5906. else if ("webgl-ios" === e)
  5907. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  5908. else if ("webgl-safari" === e)
  5909. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5910. else if ("webgl-generic" === e)
  5911. t();
  5912. else if ("missing-urls" === e)
  5913. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5914. else if ("loading-failed" === e)
  5915. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  5916. else {
  5917. if ("loading-failed-maintenance" !== e)
  5918. return void l.error("Unhandled error: " + e);
  5919. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5920. }
  5921. }
  5922. }
  5923. ).call(this, "/js/gui/error.js")
  5924. }
  5925. , {
  5926. "../localization/localize": 108,
  5927. "./../analytics": 4,
  5928. "./../settings": 166,
  5929. "./../util/browser": 182,
  5930. "./../util/logger": 189
  5931. }],
  5932. 65: [function(Oe, Le, e) {
  5933. (function(e) {
  5934. "use strict";
  5935. function c() {
  5936. for (var e in Ce)
  5937. if (Ce.hasOwnProperty(e)) {
  5938. var t = Ce[e];
  5939. if (!t.visible)
  5940. for (var i = 0; i < t.elements.length; i++)
  5941. $(t.elements[i]).hide()
  5942. }
  5943. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5944. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5945. ge = [],
  5946. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5947. ge.push(".hideTarget", ".pinTop.right")
  5948. }
  5949. function v(e, t) {
  5950. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5951. $("#gui-zoomin").toggle(i),
  5952. $("#gui-zoomout").toggle(i)
  5953. }
  5954. function l() {
  5955. n(),
  5956. $(".pinBottom").toggleClass("open"),
  5957. $("#drawer").toggleClass("open"),
  5958. $(".footer").toggleClass("open"),
  5959. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5960. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5961. O.resetDrawer()),
  5962. setTimeout(function() {
  5963. $("#pullTab").toggleClass("opened")
  5964. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5965. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5966. }
  5967. function t(e) {
  5968. var t;
  5969. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5970. t = e.position().top + e.outerHeight(),
  5971. e.attr("style", "display: none")),
  5972. $("#player").outerHeight() - 130 < t + 25
  5973. }
  5974. function y(e) {
  5975. "touchstart" === e.type && e.preventDefault(),
  5976. e.stopPropagation()
  5977. }
  5978. function n() {
  5979. w && (w.reload(),
  5980. w.init())
  5981. }
  5982. function r() {
  5983. $("#gui-spinner").stop(!0, !0),
  5984. $("#gui-spinner").fadeOut(1e3),
  5985. !(Ae = !0)
  5986. }
  5987. function A(e, t) {
  5988. var i = e.mode
  5989. , n = t || e.currentPano;
  5990. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5991. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5992. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5993. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5994. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5995. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5996. $("#gui-modes-outside").removeClass("desktop-only")),
  5997. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5998. pe = i,
  5999. $("#gui-modes-outside").addClass("hidden"),
  6000. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6001. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6002. }
  6003. function C(t, i) {
  6004. function e() {
  6005. document.getElementById("vr").classList.remove("hidden"),
  6006. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6007. S.supportsFullscreen() ? function(e) {
  6008. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6009. Q.init(t.data, i, e, x),
  6010. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6011. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6012. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6013. $(".improper-embed").toggleClass("hidden", !1),
  6014. n())
  6015. }, function(e) {
  6016. n()
  6017. }) : n()
  6018. }
  6019. function n() {
  6020. var e;
  6021. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6022. X.init(t.data, x),
  6023. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6024. function() {
  6025. _e("vr"),
  6026. V.open(e)
  6027. }
  6028. )),
  6029. X.on(Z.CLOSED, V.reset)
  6030. }
  6031. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6032. switch (M.vr.option) {
  6033. case le.CONTEXTUAL:
  6034. e();
  6035. break;
  6036. case le.ANDROID:
  6037. S.detectAndroid() && e();
  6038. break;
  6039. case le.NONE:
  6040. }
  6041. }
  6042. function h(e, i) {
  6043. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6044. if ("372" !== getQueryVariable("m")) {
  6045. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6046. $(".gui-floor").find(".container").prepend(r)
  6047. }
  6048. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6049. n.on("click", function(e) {
  6050. y(e),
  6051. _e("floor"),
  6052. n.toggleClass("open")
  6053. }),
  6054. $(".floorChoice").on("click", function(e) {
  6055. y(e);
  6056. var t = $(this).data("index");
  6057. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6058. i.player.gotoFloor(t),
  6059. R.track("showcase_gui", {
  6060. gui_action: "click_floor_select_button",
  6061. interaction_source: "gui"
  6062. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6063. _e("move"),
  6064. i.allFloors(),
  6065. R.track("showcase_gui", {
  6066. gui_action: "click_toggle_all_floors_button",
  6067. interaction_source: "gui"
  6068. })),
  6069. n.removeClass("open")
  6070. })
  6071. }
  6072. function I(e, t) {
  6073. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6074. $(".gui-floor-icon").hide(),
  6075. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6076. $(".gui-floor-icon").show(),
  6077. $(".gui-floor-title").hide()),
  6078. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6079. $(".gui-floor-number").text(se.FLOOR_ALL),
  6080. $(".floorChoice").removeClass("active"),
  6081. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6082. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6083. $(".floorChoice").removeClass("active"),
  6084. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6085. }
  6086. function E() {
  6087. var e = $("#player").width() - 20
  6088. , t = $("#scroller")
  6089. , i = $("#drawer")
  6090. , n = $(".pinBottom");
  6091. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6092. i.addClass("noScroll"),
  6093. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6094. i.toggleClass("noScroll"),
  6095. n.toggleClass("noScroll"))
  6096. }
  6097. function _(e) {
  6098. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6099. e = e || 0,
  6100. Ae = !1,
  6101. window.setTimeout(function() {
  6102. Ae || (!0,
  6103. $("#gui-spinner").stop(!0, !0).show())
  6104. }
  6105. .bind(this), e)
  6106. }(M.modelComponentLoadSpinnerDelay)
  6107. }
  6108. function b(e, t) {
  6109. for (var i = []; e; )
  6110. i.push(e),
  6111. e = e.parentNode;
  6112. for (; t && -1 === i.indexOf(t); )
  6113. t = t.parentNode;
  6114. return t
  6115. }
  6116. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6117. Oe("../util/ajax"),
  6118. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6119. Oe("../util/camera"),
  6120. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6121. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6122. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6123. Oe("../enum/PathDisplayMode"),
  6124. Oe("../enum/DirectorEvents"),
  6125. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6126. Oe("../enum/WarpStyle"),
  6127. Oe("../enum/AlignmentType"),
  6128. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6129. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6130. coBrand: {
  6131. visible: !0,
  6132. elements: [".co-brand", "#loaderCoBrand"]
  6133. },
  6134. help: {
  6135. visible: !0,
  6136. elements: [".nav-help", "#nav-help"]
  6137. },
  6138. tourControls: {
  6139. visible: !0,
  6140. elements: [".next", ".previous", "#play"]
  6141. },
  6142. highlight: {
  6143. visible: !0,
  6144. elements: ["#drawer", "#pullTab"]
  6145. },
  6146. share: {
  6147. visible: !0,
  6148. elements: [".socialButton", "#share"]
  6149. },
  6150. fullScreen: {
  6151. visible: !0,
  6152. elements: ["#gui-fullscreen"]
  6153. },
  6154. floors: {
  6155. visible: !0,
  6156. elements: [".gui-floor"]
  6157. }
  6158. }, Ie = (g = document.getElementById("drawer"),
  6159. function() {
  6160. $("#player").height() < 400 && g.classList.contains("open") && l()
  6161. }
  6162. ), Ee = (f = document.getElementById("meta-info"),
  6163. function() {
  6164. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6165. }
  6166. ), _e = (i = document.getElementById("meta-info"),
  6167. s = document.getElementById("interaction-modal"),
  6168. u = $("#drawer").eq(0),
  6169. d = $(".gui-floor").eq(0),
  6170. p = $(".vr-popup").eq(0),
  6171. function(e) {
  6172. switch (e) {
  6173. case "info":
  6174. we(),
  6175. Te(),
  6176. Ie(),
  6177. Me(),
  6178. Re(),
  6179. xe(),
  6180. Pe();
  6181. break;
  6182. case "terms":
  6183. be(),
  6184. Te(),
  6185. Se(),
  6186. Me(),
  6187. Re(),
  6188. xe(),
  6189. Pe();
  6190. break;
  6191. case "help":
  6192. be(),
  6193. we(),
  6194. Me(),
  6195. Re(),
  6196. xe(),
  6197. Pe();
  6198. break;
  6199. case "vr":
  6200. be(),
  6201. we(),
  6202. Me(),
  6203. Re(),
  6204. Te(),
  6205. Pe(),
  6206. t(p) && Se();
  6207. break;
  6208. case "highlights":
  6209. Ee(),
  6210. we(),
  6211. Me(),
  6212. Re();
  6213. break;
  6214. case "share":
  6215. be(),
  6216. we(),
  6217. Te(),
  6218. Re(),
  6219. xe(),
  6220. Pe();
  6221. break;
  6222. case "floor":
  6223. we(),
  6224. Me(),
  6225. xe();
  6226. break;
  6227. case "view":
  6228. Re(),
  6229. Me(),
  6230. we(),
  6231. xe();
  6232. break;
  6233. case "tour":
  6234. case "move":
  6235. we(),
  6236. Me(),
  6237. Re(),
  6238. xe();
  6239. break;
  6240. case "resize":
  6241. be(),
  6242. Ie(),
  6243. Re();
  6244. break;
  6245. case "tag":
  6246. we(),
  6247. Te(),
  6248. Me(),
  6249. Re(),
  6250. xe()
  6251. }
  6252. }
  6253. );
  6254. function be() {
  6255. i.classList.contains("expand") && z.toggleMeta(!0)
  6256. }
  6257. function we() {
  6258. W.hide()
  6259. }
  6260. function Te() {
  6261. U.close()
  6262. }
  6263. function xe() {
  6264. X.dismiss()
  6265. }
  6266. function Se() {
  6267. u.hasClass("open") && l()
  6268. }
  6269. function Me() {
  6270. K.hide()
  6271. }
  6272. function Re() {
  6273. d.hasClass("open") && d.removeClass("open")
  6274. }
  6275. function Pe() {
  6276. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6277. }
  6278. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6279. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6280. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6281. setTimeout(function() {
  6282. $(".icon:visible").hide().show(0)
  6283. }, 100)
  6284. }),
  6285. $("#gui-fullscreen").find("a").on("click", function(e) {
  6286. y(e),
  6287. S.requestFullscreen($("body")[0]),
  6288. R.track("showcase_gui", {
  6289. gui_action: "click_enter_fullscreen",
  6290. interaction_source: "gui"
  6291. })
  6292. }),
  6293. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6294. y(e),
  6295. S.exitFullscreen(),
  6296. R.track("showcase_gui", {
  6297. gui_action: "click_exit_fullscreen",
  6298. interaction_source: "gui"
  6299. })
  6300. }),
  6301. $(window).on("resize", function(e) {
  6302. var t = e.target.innerHeight
  6303. , i = e.target.innerWidth;
  6304. t === o && i === a || (Ce.highlight.visible && E(),
  6305. _e("resize"),
  6306. $(".pinTop.right").removeClass("hideUnderMeta"),
  6307. n(),
  6308. o = t,
  6309. a = i)
  6310. }).resize(),
  6311. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6312. $("#pullTab").on("click", function(e) {
  6313. y(e),
  6314. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6315. gui_action: "hide_highlight_reel"
  6316. }),
  6317. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6318. gui_action: "show_highlight_reel"
  6319. }),
  6320. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6321. l()
  6322. }),
  6323. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6324. $("#hotList").on("click", function(e) {
  6325. y(e);
  6326. var t = $("#hotListWrap")[0];
  6327. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6328. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6329. this.classList.add("active"))
  6330. }),
  6331. $("#hotListContent ul").on("mouseover", function(e) {
  6332. y(e);
  6333. var t = e.target
  6334. , i = document.getElementById("hotListWrap");
  6335. if ("SPAN" === t.tagName) {
  6336. var n = t.parentElement.parentElement;
  6337. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6338. } else if ("LI" === t.tagName) {
  6339. n = t.parentElement;
  6340. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6341. } else
  6342. i.style.width = ""
  6343. }),
  6344. $("#hotListContent ul").on("click", function(e) {
  6345. y(e),
  6346. this.preElem && this.preElem.classList.remove("active"),
  6347. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6348. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6349. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6350. e.target.hot && e.target.hot.examine(window.player, !0),
  6351. this.preElem = e.target)
  6352. }),
  6353. $("#hotListClose").on("click", function(e) {
  6354. y(e),
  6355. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6356. $("#hotListContent ul .active").removeClass("active"),
  6357. $("#hotList")[0].classList.remove("active")
  6358. })),
  6359. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6360. $("#more-menu-button").on("click", function(e) {
  6361. y(e),
  6362. $("#more-menu").toggleClass("open")
  6363. }),
  6364. Le.exports.init = function(s, l, c, e, t, i, n) {
  6365. var r;
  6366. x = n,
  6367. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6368. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6369. F.init(),
  6370. D.init(s, i),
  6371. ce.init(s, l, e),
  6372. $(".icon").on("mouseover", function() {
  6373. l.player && l.player.reticule.hide()
  6374. }),
  6375. function(e, t) {
  6376. var i = t.player;
  6377. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6378. y(e),
  6379. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6380. R.track("USER", {
  6381. event_type: "showcase_gui",
  6382. gui_action: "click_inside_mode_button"
  6383. }),
  6384. t.changeMode(ie.PANORAMA)
  6385. }),
  6386. $("#gui-modes-outside").find("a").on("click", function(e) {
  6387. y(e),
  6388. R.track("showcase_gui", {
  6389. gui_action: "click_outside_mode_button"
  6390. }),
  6391. t.changeMode(pe)
  6392. }),
  6393. $("#gui-modes-floorplan").on("click", function(e) {
  6394. y(e),
  6395. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6396. gui_action: "click_floorplan_mode_button"
  6397. }),
  6398. t.changeMode(ie.FLOORPLAN))
  6399. }),
  6400. $("#gui-modes-dollhouse").on("click", function(e) {
  6401. y(e),
  6402. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6403. gui_action: "click_dollhouse_mode_button"
  6404. }),
  6405. t.changeMode(ie.DOLLHOUSE))
  6406. })
  6407. }(0, l),
  6408. function(e, t) {
  6409. $("#play").on("mousedown touchstart", function(e) {
  6410. y(e),
  6411. _e("tour"),
  6412. q.play(),
  6413. R.trackAlways("showcase_gui", {
  6414. gui_action: "play_highlights"
  6415. })
  6416. }),
  6417. window.startAndPlay = function(e) {
  6418. _e("tour"),
  6419. q.play(),
  6420. R.trackAlways("showcase_gui", {
  6421. gui_action: "play_highlights"
  6422. })
  6423. }
  6424. ,
  6425. $("#pause").on("mousedown touchstart", function(e) {
  6426. y(e),
  6427. q.pause(),
  6428. R.trackAlways("showcase_gui", {
  6429. gui_action: "pause_highlights"
  6430. })
  6431. }),
  6432. $("#gui-zoomin").find("a").on("click", function(e) {
  6433. y(e),
  6434. t.player.zoomInIncrementally()
  6435. }),
  6436. $("#gui-zoomout").find("a").on("click", function(e) {
  6437. y(e),
  6438. t.player.zoomOutIncrementally()
  6439. })
  6440. }(0, l),
  6441. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6442. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6443. function() {
  6444. _e("share"),
  6445. V.open(r)
  6446. }
  6447. )),
  6448. K.on(ae.CLOSED, V.reset)),
  6449. //1 < s.heroLocations.length ? function(e, i, t) {
  6450. 0 < s.heroLocations.length ? function(e, i, t) {
  6451. var n = 100 / (fe = e.heroLocations.length) + "%"
  6452. , r = $("#thumb-container")
  6453. , o = $("#progressBar");
  6454. $("#status").find(".totalSteps").text(fe);
  6455. for (var a = 0; a < fe; a++) {
  6456. var s = e.heroLocations[a]
  6457. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6458. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6459. if (l.attr("data-index", a),
  6460. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6461. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6462. s.name) {
  6463. var c = $('<div class="overlay"></div>').text(s.name);
  6464. l.prepend(c)
  6465. }
  6466. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6467. var h = e.panos.get(s.panoId)
  6468. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6469. l.prepend(u)
  6470. }
  6471. r.append(l),
  6472. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6473. }
  6474. T = 144 * fe,
  6475. 111 * fe,
  6476. $(".thumbImg").on("mouseover", function() {
  6477. !function(e) {
  6478. return e.describe().inTransition
  6479. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6480. }),
  6481. $(".thumbImg").on("mouseout", function() {
  6482. i.clearPath()
  6483. }),
  6484. $(".thumbImg").on("click", function(e) {
  6485. y(e);
  6486. var t = $(this);
  6487. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6488. R.trackAlways("showcase_gui", {
  6489. gui_action: "click_highlight"
  6490. }),
  6491. i.goToHighlight(t.data("index"))
  6492. }),
  6493. $(".previous").find("a").on("click", function(e) {
  6494. y(e),
  6495. R.trackAlways("showcase_gui", {
  6496. gui_action: "prev_highlight"
  6497. }),
  6498. i.prevHighlight()
  6499. }),
  6500. $(".next").find("a").on("click", function(e) {
  6501. y(e),
  6502. R.trackAlways("showcase_gui", {
  6503. gui_action: "next_highlight"
  6504. }),
  6505. i.nextHighlight()
  6506. }),
  6507. $("#drawer").on("mouseleave", function(t) {
  6508. var i;
  6509. y(t);
  6510. try {
  6511. i = new MouseEvent("mouseup",{
  6512. clientX: t.clientX,
  6513. clientY: t.clientY,
  6514. screenX: t.screenX,
  6515. screenY: t.screenY
  6516. })
  6517. } catch (e) {
  6518. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6519. }
  6520. document.dispatchEvent(i)
  6521. }),
  6522. (w = new Sly($("#scrollFrame"),{
  6523. horizontal: !0,
  6524. itemNav: "centered",
  6525. smart: !0,
  6526. scrollTrap: !0,
  6527. scrollBy: 1,
  6528. mouseDragging: !0,
  6529. touchDragging: !0,
  6530. speed: 300,
  6531. dragHandle: !0,
  6532. dynamicHandle: !0,
  6533. clickBar: !0,
  6534. scrollBar: $("#scroller"),
  6535. activateOn: null
  6536. }).init()).on("active", function(e, t) {
  6537. t,
  6538. _e("tour"),
  6539. $(".step").removeClass("active"),
  6540. $("#status").find(".curIdx").text(t + 1);
  6541. for (var i = 0; i <= t; i++)
  6542. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6543. }),
  6544. E()
  6545. }(s, l, c) : (Ce.highlight.visible = !1,
  6546. Ce.tourControls.visible = !1),
  6547. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6548. function() {
  6549. var n;
  6550. document.body.addEventListener("mousedown", function(e) {
  6551. n = 0 === e.button || 1 === e.which ? e.target : null
  6552. }, !0),
  6553. document.body.addEventListener("mouseup", function(t) {
  6554. n !== t.target && (n = b(n, t.target));
  6555. var e = document.getElementById("gui-parent");
  6556. if (b(e, n) !== e && (n = null),
  6557. n) {
  6558. var i;
  6559. try {
  6560. i = new MouseEvent("click",t)
  6561. } catch (e) {
  6562. (i = document.createEvent("MouseEvents")).initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6563. }
  6564. i.syntheticClick = !0,
  6565. n.dispatchEvent(i),
  6566. n = null
  6567. }
  6568. }, !0),
  6569. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6570. e.syntheticClick || (e.stopPropagation(),
  6571. "A" === e.target.nodeName && e.preventDefault())
  6572. }, !0)
  6573. }(),
  6574. A(c),
  6575. C(s, t),
  6576. s.on("floor.changed", I),
  6577. s.on("waiting", function(e) {
  6578. _(e)
  6579. }
  6580. .bind(this, s)),
  6581. s.on("waiting-done", function(e) {
  6582. _(e)
  6583. }
  6584. .bind(this, s)),
  6585. c.on(re.ModeChanged, function(e, t) {
  6586. A(c),
  6587. v(l, c),
  6588. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6589. U.updateMode(t)
  6590. }),
  6591. e.on(oe.Move, _e.bind(this, "move")),
  6592. c.on(re.Ready, function() {
  6593. O.init(e, c, c.tagManager, l),
  6594. c.on(re.ModeChanged, function(e, t) {
  6595. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6596. })
  6597. }),
  6598. c.on(re.PanoChosen, function(e, t) {
  6599. A(c, t),
  6600. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6601. }),
  6602. V.on(k.CLOSE, function(e) {
  6603. switch (e) {
  6604. case "vr-modal":
  6605. X.dismiss();
  6606. break;
  6607. case "share-modal":
  6608. K.hide();
  6609. break;
  6610. case "terms-modal":
  6611. W.hide()
  6612. }
  6613. });
  6614. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6615. l.on("update.controls", function() {
  6616. var e, t, i, n = l.describe();
  6617. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6618. u.show()),
  6619. n.tourInProgress && (d.forEach(function(e) {
  6620. e.classList.add("playing")
  6621. }),
  6622. p.addClass("playing"),
  6623. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6624. u.hide()),
  6625. n.tourInProgress || (q.stopTour(),
  6626. d.forEach(function(e) {
  6627. e.classList.remove("playing")
  6628. }),
  6629. p.removeClass("playing"),
  6630. f.removeClass("playing"))),
  6631. null !== n.currentItem) {
  6632. var r, o;
  6633. $("#status").find(".curIdx").text(n.currentItem + 1),
  6634. n.onTheBus ? (r = "active",
  6635. o = "recent") : (o = "active",
  6636. r = "recent");
  6637. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6638. for (e = 0; e < s.heroLocations.length; e += 1)
  6639. i = g.eq(e),
  6640. t = m.eq(e),
  6641. i.removeClass(o),
  6642. t.removeClass(o),
  6643. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6644. t.addClass(r),
  6645. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6646. t.addClass(r)) : (i.removeClass(r),
  6647. t.removeClass(r))
  6648. } else
  6649. for (e = 0; e < s.heroLocations.length; e += 1)
  6650. i = g.eq(e),
  6651. t = m.eq(e),
  6652. i.removeClass("active recent"),
  6653. t.removeClass("active recent");
  6654. v(l, c)
  6655. }),
  6656. document.addEventListener("keydown", function(e) {
  6657. switch (R.updateInteraction(oe.InteractionKey),
  6658. e.which) {
  6659. case te.ZERO:
  6660. M.debug && s.toggleAlpha();
  6661. break;
  6662. case te.NINE:
  6663. M.debug && B.toggle();
  6664. break;
  6665. case te.ONE:
  6666. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6667. break;
  6668. case te.TWO:
  6669. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6670. break;
  6671. case te.THREE:
  6672. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6673. break;
  6674. case te.FOUR:
  6675. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6676. break;
  6677. case te.SPACE:
  6678. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6679. break;
  6680. case te.RETURN:
  6681. M.debug && s.toggleExplodeUp();
  6682. break;
  6683. case te.P:
  6684. !function(e) {
  6685. me.gui || (me.gui = function(e) {
  6686. var t = new he.GUI;
  6687. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6688. e.setSweepVisibility(M.showSweeps)
  6689. }),
  6690. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6691. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6692. M.transition.flySpeed = 0,
  6693. t.__controllers.forEach(function(e) {
  6694. e.updateDisplay()
  6695. })
  6696. }),
  6697. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6698. $(t.__closeButton).hide(),
  6699. t
  6700. }(me.model)),
  6701. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6702. }(!me.visible);
  6703. break;
  6704. case te.U:
  6705. !function(e) {
  6706. ve.gui || (ve.gui = function(t, i) {
  6707. function e() {
  6708. var e = i.toJSON();
  6709. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6710. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6711. }
  6712. var n = {}
  6713. , r = new he.GUI({
  6714. autoPlace: !0,
  6715. width: "60%"
  6716. });
  6717. return e(),
  6718. i.on(re.ViewChanged, e),
  6719. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6720. r.domElement.id = "datLinks",
  6721. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6722. if (!S.detectSafari()) {
  6723. var t = document.createElement("button");
  6724. t.classList.add("btn-deep-link"),
  6725. t.innerText = se.MENU_COPY,
  6726. e.nextSibling.appendChild(t);
  6727. var n = function() {
  6728. alert(se.LINK_ALERT_COPY),
  6729. t.hide()
  6730. };
  6731. t.addEventListener("click", function(e) {
  6732. try {
  6733. var t = e.target.parentNode.childNodes[0];
  6734. t.select();
  6735. var i = document.execCommand("copy");
  6736. t.blur(),
  6737. i || n()
  6738. } catch (e) {
  6739. n()
  6740. }
  6741. })
  6742. }
  6743. }),
  6744. $(r.__closeButton).hide(),
  6745. r
  6746. }(ve.model, ve.player)),
  6747. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6748. }(!ve.visible);
  6749. break;
  6750. case te.X:
  6751. M.debug && s.toggleExplode();
  6752. break;
  6753. case te.PLUSEQUALS:
  6754. l.player.activatePersistentZooming(!0),
  6755. O.hideUi();
  6756. break;
  6757. case te.DASHUNDERSCORE:
  6758. l.player.activatePersistentZooming(!1),
  6759. O.hideUi();
  6760. break;
  6761. case te.SEVEN:
  6762. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6763. break;
  6764. case te.EIGHT:
  6765. l.player.decreaseZoomSpeed();
  6766. break;
  6767. case te.NINE:
  6768. l.player.increaseZoomSpeed()
  6769. }
  6770. return c && c.reticule.hide(),
  6771. !0
  6772. }
  6773. .bind(this)),
  6774. document.addEventListener("keyup", function(e) {
  6775. switch (e.which) {
  6776. case te.PLUSEQUALS:
  6777. l.player.deactivatePersistentZooming();
  6778. break;
  6779. case te.DASHUNDERSCORE:
  6780. l.player.deactivatePersistentZooming()
  6781. }
  6782. }
  6783. .bind(this)),
  6784. function(e) {
  6785. me = {
  6786. gui: null,
  6787. visible: !1,
  6788. model: e
  6789. }
  6790. }(s),
  6791. function(e, t) {
  6792. ve = {
  6793. gui: null,
  6794. visible: !1,
  6795. model: e,
  6796. player: t
  6797. }
  6798. }(s, l.player),
  6799. function(e) {
  6800. function t(e, i) {
  6801. $(e).find("a").each(function(e, t) {
  6802. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6803. t.style.pointerEvents = i ? "auto" : "none"
  6804. })
  6805. }
  6806. e.on(de.ZoomMax, function() {
  6807. t("#gui-zoomin", !1),
  6808. t("#gui-zoomout", !0)
  6809. }),
  6810. e.on(de.ZoomMin, function() {
  6811. t("#gui-zoomin", !0),
  6812. t("#gui-zoomout", !1)
  6813. }),
  6814. e.on(de.ZoomIn, function() {
  6815. t("#gui-zoomout", !0)
  6816. }),
  6817. e.on(de.ZoomOut, function() {
  6818. t("#gui-zoomin", !0)
  6819. }),
  6820. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6821. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6822. }(c),
  6823. P.setAutoPlay(s.heroCount()),
  6824. U.init(c, i.mode),
  6825. U.on(H.OPENED, _e.bind(this, "help")),
  6826. W.init(),
  6827. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6828. function() {
  6829. _e("terms"),
  6830. V.open(o)
  6831. }
  6832. )),
  6833. W.on(j.CLOSED, V.reset),
  6834. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6835. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6836. M.profiling.enabled && B.show(),
  6837. q.init(l)
  6838. }
  6839. ,
  6840. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6841. function a() {
  6842. o.setLoadingStartTime(),
  6843. function() {
  6844. function e(e) {
  6845. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6846. }
  6847. $("body").css("touch-action", "none"),
  6848. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6849. var t = document.getElementById("terms-text")
  6850. , i = document.getElementById("more-help-wrapper")
  6851. , n = (document.getElementById("navigation-help-wrapper"),
  6852. document.getElementById("help-dialog"),
  6853. document.getElementById("tag-billboards"));
  6854. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6855. passive: !1
  6856. }),
  6857. document.body.addEventListener("DOMMouseScroll", e)),
  6858. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6859. e.stopPropagation()
  6860. })
  6861. }(),
  6862. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6863. l()) : function(e) {
  6864. L.show(e),
  6865. c()
  6866. }(l)
  6867. }
  6868. var s = $.Deferred()
  6869. , l = s.resolve.bind(s);
  6870. ye = !0,
  6871. _(e);
  6872. e.data.player_options && function(e) {
  6873. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6874. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6875. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6876. }(e.data.player_options),
  6877. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6878. se.localizeGUI();
  6879. !function(i) {
  6880. function e(e, t) {
  6881. return !!i.player_options[e] && i[t || e]
  6882. }
  6883. $(".model-title").text(i.name);
  6884. var t = M.pageTitle;
  6885. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6886. document.title = t,
  6887. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6888. delay: {
  6889. show: 50,
  6890. hide: 0
  6891. },
  6892. trigger: "hover",
  6893. html: !1,
  6894. viewport: {
  6895. selector: "body",
  6896. padding: 10
  6897. }
  6898. }),
  6899. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6900. z.populate({
  6901. name: e("model_name", "name"),
  6902. coBrand: e("presented_by"),
  6903. description: e("model_summary", "summary") || "暂无内容",
  6904. contactName: e("contact_name"),
  6905. address: e("address"),
  6906. phone: e("contact_phone"),
  6907. formattedPhone: i.formatted_contact_phone,
  6908. email: e("contact_email"),
  6909. url: e("external_url"),
  6910. socialSharing: i.enable_social_sharing && i.is_public
  6911. })
  6912. }(e.data);
  6913. r || $(".quick").addClass("hidden");
  6914. n ? (R.impression(),
  6915. a()) : (o.setWaitingStartTime(),
  6916. N.show(r, a))
  6917. return s
  6918. }
  6919. ,
  6920. Le.exports.endLoading = function(e, t, i) {
  6921. var n = t.player;
  6922. function r() {
  6923. i.dismissExaminedTag(),
  6924. i.disableHovering()
  6925. }
  6926. $("#gui-thumb").fadeOut(2500),
  6927. L.hide(function() {
  6928. ye = !1
  6929. }),
  6930. Y.init(e, i),
  6931. z.finishSetup(Object.keys(e.tags).length),
  6932. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6933. X.on(Z.OPENED, r),
  6934. K.on(ae.OPENED, r),
  6935. U.on(H.OPENED, r),
  6936. W.on(j.OPENED, r);
  6937. var o = i.enableHovering.bind(i);
  6938. if (X.on(Z.CLOSED, o),
  6939. K.on(ae.CLOSED, o),
  6940. U.on(H.CLOSED, o),
  6941. W.on(j.CLOSED, o),
  6942. M.labels.enabled && Object.keys(e.labels).length,
  6943. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6944. I(e.currentFloor, n.mode)),
  6945. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6946. h(e, t)),
  6947. c(),
  6948. v(t, t.player),
  6949. $("#gui").fadeIn(1500),
  6950. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6951. l(),
  6952. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6953. }, 2e3),
  6954. !S.isMobile())
  6955. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6956. $(a[s]).addClass("hasHover");
  6957. _(e),
  6958. z.setupToggling(),
  6959. window.editHotPanel && editHotPanel(),
  6960. function() {
  6961. var i = $("#pullTab")
  6962. , e = {
  6963. bottom: {
  6964. "border-bottom-left-radius": "10px",
  6965. "border-bottom-right-radius": "10px"
  6966. },
  6967. top: {
  6968. "border-top-left-radius": "10px",
  6969. "border-top-right-radius": "10px"
  6970. }
  6971. }
  6972. , t = {
  6973. bottom: {
  6974. "border-top-right-radius": "10px",
  6975. "border-bottom-right-radius": "10px"
  6976. },
  6977. top: {
  6978. "border-bottom-left-radius": "10px",
  6979. "border-top-left-radius": "10px"
  6980. }
  6981. };
  6982. function n(e, t) {
  6983. $("#gui-modes-map > div:visible:last").css(e),
  6984. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6985. }
  6986. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6987. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6988. }(),
  6989. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6990. }
  6991. ,
  6992. Le.exports.onProgress = function(e) {
  6993. L.progress(e)
  6994. }
  6995. }
  6996. ).call(this, "/js/gui/gui.js")
  6997. }
  6998. , {
  6999. "../analytics": 4,
  7000. "../controls/serializer": 14,
  7001. "../enum/AlignmentType": 17,
  7002. "../enum/BlackoutStyle": 18,
  7003. "../enum/ControlEvents": 21,
  7004. "../enum/DirectorEvents": 23,
  7005. "../enum/Keys": 30,
  7006. "../enum/PathDiscardMode": 38,
  7007. "../enum/PathDisplayMode": 39,
  7008. "../enum/PlayerEvents": 40,
  7009. "../enum/VROption": 47,
  7010. "../enum/Vectors": 50,
  7011. "../enum/Viewmode": 51,
  7012. "../enum/WarpStyle": 52,
  7013. "../enum/ZoomEvents": 53,
  7014. "../lib/dat.gui": 93,
  7015. "../localization/localize": 108,
  7016. "../tag/Media/MediaEvent": 131,
  7017. "../objects/Snapshot": 153,
  7018. "../settings": 166,
  7019. "../util/ajax": 181,
  7020. "../util/browser": 182,
  7021. "../util/camera": 183,
  7022. "../util/logger": 189,
  7023. "../util/showcase": 193,
  7024. "../util/transitions": 195,
  7025. "./closer/ModalCloserEvent": 61,
  7026. "./closer/modalCloser": 62,
  7027. "./help/HelpEvent": 66,
  7028. "./help/help": 67,
  7029. "./helpManager": 68,
  7030. "./immersiveMode": 69,
  7031. "./konami": 70,
  7032. "./landingScreen": 71,
  7033. "./loadingScreen": 72,
  7034. "./memoryUsage": 73,
  7035. "./playButton": 74,
  7036. "./populateModal": 75,
  7037. "./sharing/ShareEvents": 76,
  7038. "./sharing/modal": 77,
  7039. "./terms/TermsEvent": 78,
  7040. "./terms/terms": 79,
  7041. "./title/TitleEvents": 80,
  7042. "./title/tagToggle": 81,
  7043. "./title/titleBar": 82,
  7044. "./tourInteraction": 84,
  7045. "./vr/vrEvent": 85,
  7046. "./vr/vrModal": 87,
  7047. "./webvr/WebVrEvent": 88,
  7048. "./webvr/webVRgui": 89,
  7049. three: 217
  7050. }],
  7051. 66: [function(e, t, i) {
  7052. "use strict";
  7053. t.exports = Object.freeze({
  7054. OPENED: "help.opened",
  7055. CLOSED: "help.closed"
  7056. })
  7057. }
  7058. , {}],
  7059. 67: [function(e, t, i) {
  7060. "use strict";
  7061. function n() {
  7062. p.on("click", function(e) {
  7063. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7064. setTimeout(function() {
  7065. x = !1
  7066. }, h.help.modalStayDuration),
  7067. S.emit(l.OPENED),
  7068. f.addClass("open " + T),
  7069. p.addClass("open"),
  7070. o(),
  7071. r(),
  7072. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7073. v.classList.add("fadeIn")))
  7074. }),
  7075. E.on("click", function(e) {
  7076. S.close()
  7077. }),
  7078. C.on("click", function(e) {
  7079. T && T !== a.TRANSITIONING && (o(),
  7080. r())
  7081. }),
  7082. I.on("click", function(e) {
  7083. o(),
  7084. I.addClass("underline-tab"),
  7085. c.fill(b, s.MORE_HELP),
  7086. f.addClass("more-help")
  7087. })
  7088. }
  7089. function r() {
  7090. C.addClass("underline-tab"),
  7091. c.fill(_, s.NAVIGATION, T),
  7092. f.addClass(T)
  7093. }
  7094. function o() {
  7095. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7096. A.forEach(function(e) {
  7097. e.classList.remove("underline-tab")
  7098. })
  7099. }
  7100. var a = e("../../enum/Viewmode")
  7101. , s = e("../../enum/HelpModalType")
  7102. , l = e("./HelpEvent")
  7103. , c = (e("../helpManager"),
  7104. e("./../populateModal"))
  7105. , h = e("../../settings")
  7106. , u = e("../../util/common")
  7107. , d = e("events").EventEmitter
  7108. , p = $(".footer-help").eq(0)
  7109. , f = $("#help-dialog").eq(0)
  7110. , g = document.querySelector("#quick-logo")
  7111. , m = document.querySelector("#loaderCoBrand")
  7112. , v = document.querySelector("#help-dialog")
  7113. , y = document.querySelector(".footer")
  7114. , A = $(".help-tabs").children().toArray()
  7115. , C = $(".navigation-tab").eq(0)
  7116. , I = $(".more-help-tab").eq(0)
  7117. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7118. f.find(".close").eq(0))
  7119. , _ = f.find(".interactions").toArray()
  7120. , b = f.find(".ui-instructions").toArray()
  7121. , w = a.PANORAMA
  7122. , T = a.PANORAMA
  7123. , x = !1
  7124. , S = {
  7125. init: function(e, t) {
  7126. w = T = t,
  7127. [v, m, g, y].forEach(function(e) {
  7128. e.classList.add(c.deviceType)
  7129. }),
  7130. n()
  7131. },
  7132. close: function() {
  7133. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7134. p.removeClass("open"),
  7135. f.removeClass("open"),
  7136. v.classList.contains("fadeIn"))) {
  7137. v.classList.remove("fadeIn");
  7138. var e = T === a.TRANSITIONING ? w : T;
  7139. c.clear(_, s.NAVIGATION, e)
  7140. }
  7141. },
  7142. updateMode: function(e) {
  7143. w = T,
  7144. T = e
  7145. }
  7146. };
  7147. u.extendObject(S, d.prototype),
  7148. t.exports = S
  7149. }
  7150. , {
  7151. "../../enum/HelpModalType": 28,
  7152. "../../enum/Viewmode": 51,
  7153. "../../settings": 166,
  7154. "../../util/common": 185,
  7155. "../helpManager": 68,
  7156. "./../populateModal": 75,
  7157. "./HelpEvent": 66,
  7158. events: 202
  7159. }],
  7160. 68: [function(s, l, e) {
  7161. (function(e) {
  7162. "use strict";
  7163. var t = s("../util/browser")
  7164. , i = s("./../util/logger")
  7165. , n = s("./../settings")
  7166. , r = new i(e)
  7167. , o = function() {
  7168. var t;
  7169. try {
  7170. return t = window.localStorage.getItem("visitCount") || "0",
  7171. t = (parseFloat(t) + 1).toString(),
  7172. window.localStorage.setItem("visitCount", t),
  7173. r.debug("visitCount = " + t),
  7174. t
  7175. } catch (e) {
  7176. t = "1",
  7177. r.debug("couldn't set local storage")
  7178. }
  7179. }()
  7180. , a = !1;
  7181. l.exports = {
  7182. isHelpDisabled: function() {
  7183. return "0" === t.valueFromHash("help", null) || a
  7184. },
  7185. isLargeHelpEnabled: function() {
  7186. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7187. },
  7188. isSmallHelpEnabled: function() {
  7189. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7190. },
  7191. isHelpEnabled: function() {
  7192. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7193. },
  7194. setAutoPlay: function(e) {
  7195. a = 0 <= n.warp.auto && 1 < e
  7196. }
  7197. }
  7198. }
  7199. ).call(this, "/js/gui/helpManager.js")
  7200. }
  7201. , {
  7202. "../util/browser": 182,
  7203. "./../settings": 166,
  7204. "./../util/logger": 189
  7205. }],
  7206. 69: [function(e, t, i) {
  7207. "use strict";
  7208. function r(e) {
  7209. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7210. T = !0,
  7211. h.close(),
  7212. function(e) {
  7213. !n(e) && S ? v.forEach(function(e) {
  7214. e.classList.remove("drawerOpen"),
  7215. e.classList.add("duringTour")
  7216. }) : C.hasClass("open") ? v.forEach(function(e) {
  7217. e.classList.remove("duringTour"),
  7218. e.classList.add("drawerOpen")
  7219. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7220. e.classList.add("fadeOut")
  7221. })
  7222. }(e),
  7223. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7224. C.hasClass("playing") || (y.forEach(function(e) {
  7225. e.classList.add("detectHover")
  7226. }),
  7227. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7228. }
  7229. function o() {
  7230. C.hasClass("playing") || (clearTimeout(x),
  7231. x = setTimeout(a, c.immersive.timeToShowAgain))
  7232. }
  7233. function a() {
  7234. clearTimeout(x),
  7235. T = !1,
  7236. m.forEach(function(e) {
  7237. e.classList.remove("drawerOpen")
  7238. }),
  7239. S || v.forEach(function(e) {
  7240. e.classList.remove("duringTour")
  7241. }),
  7242. y.forEach(function(e) {
  7243. e.classList.remove("detectHover")
  7244. })
  7245. }
  7246. function s() {
  7247. T ? a() : r(),
  7248. M = !0,
  7249. setTimeout(function() {
  7250. M = !1
  7251. }, c.immersive.uiStayDuration)
  7252. }
  7253. function n(e) {
  7254. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7255. }
  7256. var l = e("../util/browser")
  7257. , c = e("../settings")
  7258. , h = e("./help/help")
  7259. , u = e("../enum/tagEvents")
  7260. , d = e("../enum/ControlEvents")
  7261. , p = e("../enum/PlayerEvents")
  7262. , f = e("../enum/DirectorEvents")
  7263. , g = (p = e("../enum/PlayerEvents"),
  7264. e("../enum/Viewmode"))
  7265. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7266. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7267. , y = $("#hover-bottom, #hover-top").toArray()
  7268. , A = ($("#pullTab").eq(0),
  7269. $("#playHead").eq(0),
  7270. $(".pinBottom-container").eq(0))
  7271. , C = $("#drawer").eq(0)
  7272. , I = $("#drawer-container").eq(0)
  7273. , E = $("#meta-info").eq(0)
  7274. , _ = $(".pinTop.left").eq(0)
  7275. , b = $("#player").eq(0)
  7276. , w = document.getElementById("pullTab")
  7277. , T = !1
  7278. , x = null
  7279. , S = !1
  7280. , M = !1
  7281. , R = null
  7282. , P = !1;
  7283. t.exports.init = function(e, t, i, n) {
  7284. (function(t, i, e, n) {
  7285. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7286. t.controls[e].on(d.Move, r),
  7287. t.controls[e].on(d.LongTap, s)
  7288. }),
  7289. b.on("mousewheel DOMMouseScroll", r),
  7290. e.on(u.TagActivated, r),
  7291. e.on(u.TagNavigation, r),
  7292. i.on(p.FlyingEnded, o),
  7293. i.on(p.ModeChanging, function(e, t) {
  7294. P = t !== g.PANORAMA && e !== g.PANORAMA
  7295. }),
  7296. i.on(p.ModeChanged, function(e, t) {
  7297. R = i.mode,
  7298. t !== g.TRANSITIONING ? a() : r("modeChange")
  7299. }),
  7300. n.on(f.TourStart, function() {
  7301. S = !0,
  7302. r()
  7303. }),
  7304. n.on(f.TourEnd, function() {
  7305. S = !1,
  7306. a()
  7307. }),
  7308. n.on(f.ActionInterrupted, function() {
  7309. S = !1
  7310. }),
  7311. w.addEventListener("touchend", function() {
  7312. $("#pullTab").hasClass("opened") && !S && a()
  7313. }, !0)
  7314. }
  7315. )(e, t, i, n),
  7316. l.isMobile() ? (y.forEach(function(e) {
  7317. e.classList.add("mobile")
  7318. }),
  7319. A.click(a)) : (y.forEach(function(e) {
  7320. e.addEventListener("mouseleave", function() {
  7321. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7322. }, !0)
  7323. }),
  7324. b.mouseleave(function() {
  7325. y[0].classList.contains("detectHover") && a()
  7326. })),
  7327. R = t.mode
  7328. }
  7329. ,
  7330. t.exports.hideUi = r,
  7331. t.exports.resetDrawer = function() {
  7332. I.hasClass("duringTour") || (S = !1,
  7333. r("gui"),
  7334. a())
  7335. }
  7336. }
  7337. , {
  7338. "../enum/ControlEvents": 21,
  7339. "../enum/DirectorEvents": 23,
  7340. "../enum/tagEvents": 32,
  7341. "../enum/PlayerEvents": 40,
  7342. "../enum/Viewmode": 51,
  7343. "../settings": 166,
  7344. "../util/browser": 182,
  7345. "./help/help": 67
  7346. }],
  7347. 70: [function(i, n, e) {
  7348. (function(e) {
  7349. "use strict";
  7350. var t = i("./../util/logger")
  7351. , o = i("./../settings")
  7352. , a = i("./debug")
  7353. , s = i("./../util/common")
  7354. , l = (i("./gui"),
  7355. new t(e));
  7356. o.console && $("body").append('<div id="debug-console"></div>'),
  7357. n.exports.init = function(i, n, r) {
  7358. l.debug("konami has the modelInstance");
  7359. var t = [];
  7360. $(window).on("keydown", function(e) {
  7361. t.push(e.which),
  7362. t.length > o.secretPanelWord.length && t.shift(),
  7363. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7364. o.debug = !0)
  7365. }),
  7366. $(window).on("keydown", function e(t) {
  7367. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7368. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7369. })
  7370. }
  7371. }
  7372. ).call(this, "/js/gui/konami.js")
  7373. }
  7374. , {
  7375. "./../settings": 166,
  7376. "./../util/common": 185,
  7377. "./../util/logger": 189,
  7378. "./debug": 63,
  7379. "./gui": 65
  7380. }],
  7381. 71: [function(e, t, i) {
  7382. "use strict";
  7383. function r() {
  7384. s.clear(m, l.LANDING[v]),
  7385. g.removeClass("fadeIn")
  7386. }
  7387. var o = e("../settings")
  7388. , a = (e("./help/help"),
  7389. e("./helpManager"))
  7390. , s = e("./populateModal")
  7391. , l = e("../enum/HelpModalType")
  7392. , n = e("../enum/Viewmode")
  7393. , c = e("../enum/DirectorEvents")
  7394. , h = e("../enum/PlayerEvents")
  7395. , u = $("#quick-blackout").eq(0)
  7396. , d = $("#quick-logo").eq(0)
  7397. , p = $(".quick-brand").toArray()
  7398. , f = $("#loaderCoBrand").eq(0)
  7399. , g = $("#interaction-modal").eq(0)
  7400. , m = g.find(".interaction").toArray()
  7401. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7402. "");
  7403. t.exports.delayLanding = function(e) {
  7404. var t = $.Deferred();
  7405. e || t.resolve();
  7406. var i = o.startupFlyinDelay;
  7407. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7408. setTimeout(t.resolve.bind(t), i),
  7409. t
  7410. }
  7411. ,
  7412. t.exports.showMessage = function(e, t, i) {
  7413. var n = 0;
  7414. o.quickstart.enabled && (function(e) {
  7415. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7416. d.before(f),
  7417. p = $(".quick-brand").toArray()), */
  7418. u.addClass("fadeOut")
  7419. /* setTimeout(function() {
  7420. p.forEach(function(e) {
  7421. e.classList.add("fadeIn")
  7422. })
  7423. }, o.quickstart.showTextDelay),
  7424. setTimeout(function() {
  7425. p.forEach(function(e) {
  7426. e.classList.add("fadeOut")
  7427. })
  7428. }, o.quickstart.fadeOutDelay) */
  7429. }(i),
  7430. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7431. function(e, t) {
  7432. setTimeout(function() {
  7433. if (a.isHelpEnabled()) {
  7434. if (t(),
  7435. s.init(),
  7436. g.addClass("fadeIn landing " + s.deviceType),
  7437. a.isSmallHelpEnabled())
  7438. return void g.addClass("small");
  7439. s.fill(m, l.LANDING[v]),
  7440. g.addClass(v)
  7441. }
  7442. }, e);
  7443. var i = {
  7444. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7445. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7446. }
  7447. , n = $(".nav-icon .icon");
  7448. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7449. function r(e) {
  7450. e.on("click", function() {
  7451. var e = null;
  7452. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7453. i.length < e || e < 1)
  7454. return !1;
  7455. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7456. "data-page": e,
  7457. src: i.mobile[e - 1]
  7458. }) : n.attr({
  7459. "data-page": e,
  7460. src: i.pc[e - 1]
  7461. })
  7462. })
  7463. }
  7464. r($(".next-button")),
  7465. r($(".prev-button"))
  7466. }(n, function() {
  7467. e.once(h.Move, r),
  7468. t.once(c.TourStart, r)
  7469. })
  7470. }
  7471. ,
  7472. t.exports.init = function(e, t) {
  7473. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7474. }
  7475. ,
  7476. t.exports.dismissModal = r
  7477. }
  7478. , {
  7479. "../enum/DirectorEvents": 23,
  7480. "../enum/HelpModalType": 28,
  7481. "../enum/PlayerEvents": 40,
  7482. "../enum/Viewmode": 51,
  7483. "../settings": 166,
  7484. "./help/help": 67,
  7485. "./helpManager": 68,
  7486. "./populateModal": 75
  7487. }],
  7488. 72: [function(e, t, i) {
  7489. "use strict";
  7490. var n = e("./circleLoader").circleLoader;
  7491. t.exports = {
  7492. element: $("#gui-loading"),
  7493. hide: function(e) {
  7494. n.done(),
  7495. this.element.fadeOut(1500, e)
  7496. },
  7497. show: function(e) {
  7498. this.element.fadeIn(500, function() {
  7499. this.element.css("display", "table"),
  7500. e && e()
  7501. }
  7502. .bind(this))
  7503. },
  7504. progress: function(e) {
  7505. n.set(e)
  7506. }
  7507. }
  7508. }
  7509. , {
  7510. "./circleLoader": 60
  7511. }],
  7512. 73: [function(e, t, i) {
  7513. "use strict";
  7514. var n = e("../settings")
  7515. , r = $("#memory-info")
  7516. , o = r.find("#memory-gpu")
  7517. , a = !1;
  7518. t.exports = {
  7519. show: function() {
  7520. n.profiling.enabled && (r.show(),
  7521. a = !0)
  7522. },
  7523. hide: function() {
  7524. r.hide(),
  7525. a = !1
  7526. },
  7527. toggle: function() {
  7528. a ? this.hide() : this.show()
  7529. },
  7530. update: function(e) {
  7531. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7532. }
  7533. }
  7534. }
  7535. , {
  7536. "../settings": 166
  7537. }],
  7538. 74: [function(e, t, i) {
  7539. "use strict";
  7540. e("../util/browser"),
  7541. e("../analytics");
  7542. e("../settings"),
  7543. t.exports = {
  7544. show: function(e, t) {
  7545. $("#gui-message").fadeOut(500, function() {
  7546. t()
  7547. })
  7548. }
  7549. }
  7550. }
  7551. , {
  7552. "../analytics": 4,
  7553. "../settings": 166,
  7554. "../util/browser": 182
  7555. }],
  7556. 75: [function(e, t, i) {
  7557. "use strict";
  7558. function n(e, t, i, n) {
  7559. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7560. }
  7561. var r = e("../util/browser")
  7562. , o = e("../localization/localize")
  7563. , a = e("../enum/HelpModalType")
  7564. , s = (e("../enum/HelpModalSize"),
  7565. e("../enum/Viewmode"));
  7566. t.exports = {
  7567. init: function() {
  7568. if (!this.hasInitialized) {
  7569. this.hasInitialized = !0,
  7570. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7571. this.assets = {},
  7572. this.assets[a.LANDING[s.PANORAMA]] = {
  7573. desktop: {
  7574. left: {
  7575. "top-info": o.ROTATE,
  7576. "big-image": "images/nav_help_mouse_drag_left.png",
  7577. keyboard: "images/nav_help_keyboard_left_right.png"
  7578. },
  7579. middle: {
  7580. "top-info": o.MOVE,
  7581. "big-image": "images/nav_help_mouse_click.png",
  7582. keyboard: "images/nav_help_keyboard_up_down.png"
  7583. },
  7584. right: {
  7585. "top-info": o.ZOOM,
  7586. "big-image": "images/nav_help_mouse_zoom.png",
  7587. keyboard: "images/nav_help_zoom_keys.png"
  7588. }
  7589. },
  7590. mobile: {
  7591. left: {
  7592. "top-info": o.ROTATE,
  7593. "big-image": "images/nav_help_gesture_drag.png"
  7594. },
  7595. middle: {
  7596. "top-info": o.MOVE,
  7597. "big-image": "images/nav_help_gesture_tap.png"
  7598. },
  7599. right: {
  7600. "top-info": o.ZOOM,
  7601. "big-image": "images/nav_help_gesture_pinch.png"
  7602. }
  7603. }
  7604. },
  7605. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7606. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7607. desktop: {
  7608. left: {
  7609. "top-info": o.ROTATE,
  7610. "big-image": "images/nav_help_mouse_drag_left.png",
  7611. keyboard: "images/nav_help_keyboard_left_right.png"
  7612. },
  7613. middle: {
  7614. "top-info": o.MOVE,
  7615. "big-image": "images/nav_help_mouse_position_right.png"
  7616. }
  7617. },
  7618. mobile: {
  7619. left: {
  7620. "top-info": o.ROTATE,
  7621. "big-image": "images/nav_help_gesture_drag.png"
  7622. },
  7623. middle: {
  7624. "top-info": o.MOVE,
  7625. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7626. }
  7627. }
  7628. },
  7629. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7630. desktop: {
  7631. left: {
  7632. "top-info": o.MOVE,
  7633. "big-image": "images/nav_help_mouse_position_left.png"
  7634. },
  7635. middle: {
  7636. "top-info": o.ROTATE,
  7637. "big-image": "images/nav_help_mouse_drag_right.png",
  7638. keyboard: "images/nav_help_keyboard_left_right.png"
  7639. }
  7640. },
  7641. mobile: {
  7642. left: {
  7643. "top-info": o.MOVE,
  7644. "big-image": "images/nav_help_gesture_position.png"
  7645. },
  7646. middle: {
  7647. "top-info": o.ROTATE,
  7648. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7649. }
  7650. }
  7651. };
  7652. var e = {
  7653. "top-info": o.INSIDE,
  7654. "big-image": "images/nav_help_click_inside.png",
  7655. keyboard: "images/nav_help_inside_key.png"
  7656. };
  7657. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7658. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7659. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7660. var t = {
  7661. "top-info": o.INSIDE,
  7662. "big-image": "images/nav_help_tap_inside.png"
  7663. };
  7664. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7665. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7666. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7667. this.assets[a.NAVIGATION] = {},
  7668. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7669. desktop: {
  7670. left: {
  7671. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7672. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7673. "big-image": "images/nav_help_mouse_drag_left.png",
  7674. keyboard: "images/nav_help_keyboard_left_right.png"
  7675. },
  7676. middle: {
  7677. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7678. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7679. "big-image": "images/nav_help_mouse_click.png",
  7680. keyboard: "images/nav_help_keyboard_up_down.png"
  7681. },
  7682. right: {
  7683. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7684. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7685. "big-image": "images/nav_help_mouse_zoom.png",
  7686. keyboard: "images/nav_help_zoom_keys.png"
  7687. }
  7688. },
  7689. mobile: {
  7690. left: {
  7691. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7692. "big-image": "images/nav_help_gesture_drag.png"
  7693. },
  7694. middle: {
  7695. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7696. "big-image": "images/nav_help_gesture_tap.png"
  7697. },
  7698. right: {
  7699. "top-info": o.HELP_MOBILE_3,
  7700. "big-image": "images/nav_help_gesture_pinch.png"
  7701. }
  7702. }
  7703. },
  7704. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7705. desktop: {
  7706. left: {
  7707. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7708. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7709. "big-image": "images/nav_help_mouse_drag_left.png",
  7710. keyboard: "images/nav_help_keyboard_all.png"
  7711. },
  7712. middle: {
  7713. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7714. "big-image": "images/nav_help_mouse_position_right.png"
  7715. },
  7716. right: {
  7717. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7718. "big-image": "images/nav_help_mouse_zoom.png"
  7719. }
  7720. },
  7721. mobile: {
  7722. left: {
  7723. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7724. "big-image": "images/nav_help_gesture_drag.png"
  7725. },
  7726. middle: {
  7727. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7728. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7729. },
  7730. right: {
  7731. "top-info": o.HELP_MOBILE_3,
  7732. "big-image": "images/nav_help_gesture_pinch.png"
  7733. }
  7734. }
  7735. },
  7736. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7737. desktop: {
  7738. left: {
  7739. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7740. "big-image": "images/nav_help_mouse_position_left.png"
  7741. },
  7742. middle: {
  7743. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7744. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7745. "big-image": "images/nav_help_mouse_drag_right.png",
  7746. keyboard: "images/nav_help_keyboard_left_right.png"
  7747. },
  7748. right: {
  7749. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7750. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7751. "big-image": "images/nav_help_mouse_zoom.png",
  7752. keyboard: "images/nav_help_keyboard_up_down.png"
  7753. }
  7754. },
  7755. mobile: {
  7756. left: {
  7757. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7758. "big-image": "images/nav_help_gesture_position.png"
  7759. },
  7760. middle: {
  7761. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7762. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7763. },
  7764. right: {
  7765. "top-info": o.HELP_MOBILE_3,
  7766. "big-image": "images/nav_help_gesture_pinch.png"
  7767. }
  7768. }
  7769. },
  7770. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7771. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7772. "top-info": o.HELP_DESKTOP_360_2A,
  7773. "bottom-info": o.HELP_DESKTOP_360_2B,
  7774. "big-image": "images/nav_help_click_inside.png",
  7775. keyboard: "images/nav_help_inside_key.png"
  7776. },
  7777. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7778. "top-info": o.HELP_MOBILE_360_2,
  7779. "big-image": "images/nav_help_tap_inside.png"
  7780. },
  7781. this.assets[a.MORE_HELP] = {
  7782. desktop: {
  7783. "more-help-hlr": {
  7784. "top-info": o.HELP_MORE_HLR_A,
  7785. "big-image": "images/nav_help_expand.svg",
  7786. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7787. },
  7788. "more-help-dollhouse": {
  7789. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7790. "big-image": "images/nav_help_dollhouse.svg",
  7791. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7792. },
  7793. "more-help-floors": {
  7794. "top-info": o.HELP_MORE_FLOORS_A,
  7795. "big-image": "images/nav_help_floor picker.svg",
  7796. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7797. },
  7798. "more-help-tag": {
  7799. "top-info": o.HELP_MORE_TAG_A,
  7800. "big-image": "images/nav_help_tag.svg",
  7801. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7802. },
  7803. "more-help-zoom": {
  7804. "top-info": o.HELP_MORE_ZOOM_A,
  7805. "big-image": "images/nav_help_zoom.svg",
  7806. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7807. },
  7808. "more-help-tour": {
  7809. "top-info": o.HELP_MORE_TOUR_A,
  7810. "big-image": "images/nav_help_play.png",
  7811. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7812. },
  7813. "more-help-inside": {
  7814. "top-info": o.HELP_MORE_INSIDE_A,
  7815. "big-image": "images/nav_help_inside.svg",
  7816. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7817. },
  7818. "more-help-vr": {
  7819. "top-info": o.HELP_MORE_VR_A,
  7820. "big-image": "images/nav_help_vr.svg",
  7821. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7822. },
  7823. "more-help-360": {
  7824. "top-info": o.HELP_MORE_360_A,
  7825. "big-image": "images/nav_help_360.svg",
  7826. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7827. },
  7828. "more-help-fullscreen": {
  7829. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7830. "big-image": "images/nav_help_fullscreen.svg",
  7831. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7832. }
  7833. },
  7834. mobile: {
  7835. "more-help-hlr": {
  7836. "top-info": o.HELP_MORE_HLR_A,
  7837. "big-image": "images/nav_help_expand.svg",
  7838. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7839. },
  7840. "more-help-dollhouse": {
  7841. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7842. "big-image": "images/nav_help_dollhouse.svg",
  7843. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7844. },
  7845. "more-help-floors": {
  7846. "top-info": o.HELP_MORE_FLOORS_A,
  7847. "big-image": "images/nav_help_floor picker.svg",
  7848. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7849. },
  7850. "more-help-tag": {
  7851. "top-info": o.HELP_MORE_TAG_A,
  7852. "big-image": "images/nav_help_tag.svg",
  7853. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7854. },
  7855. "more-help-tour": {
  7856. "top-info": o.HELP_MORE_TOUR_A,
  7857. "big-image": "images/nav_help_play.png",
  7858. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7859. },
  7860. "more-help-inside": {
  7861. "top-info": o.HELP_MORE_INSIDE_A,
  7862. "big-image": "images/nav_help_inside.svg",
  7863. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7864. },
  7865. "more-help-vr": {
  7866. "top-info": o.HELP_MORE_VR_A,
  7867. "big-image": "images/webvr.svg",
  7868. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7869. },
  7870. "more-help-360": {
  7871. "top-info": o.HELP_MORE_360_A,
  7872. "big-image": "images/nav_help_360.svg",
  7873. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7874. }
  7875. }
  7876. },
  7877. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7878. desktop: {
  7879. left: {
  7880. "top-info": o.ROTATE,
  7881. "big-image": "images/nav_help_mouse_drag_left.png",
  7882. keyboard: "images/nav_help_keyboard_left_right.png"
  7883. },
  7884. middle: {
  7885. "top-info": o.MOVE,
  7886. "big-image": "images/nav_help_mouse_click.png",
  7887. keyboard: "images/nav_help_keyboard_up_down.png"
  7888. },
  7889. right: {
  7890. "top-info": o.PLAY,
  7891. "big-image": "images/Desktop-help-play-button.svg",
  7892. keyboard: "images/Desktop-help-spacebar-2.svg"
  7893. }
  7894. },
  7895. mobile: {
  7896. left: {
  7897. "top-info": o.ROTATE,
  7898. "big-image": "images/nav_help_gesture_drag.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.MOVE,
  7902. "big-image": "images/nav_help_gesture_tap.png"
  7903. },
  7904. right: {
  7905. "top-info": o.PLAY,
  7906. "big-image": "images/mobile-help-play-button.svg"
  7907. }
  7908. }
  7909. },
  7910. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7911. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7912. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7913. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7914. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7915. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7916. }
  7917. },
  7918. fill: function(e, t, i) {
  7919. n.call(this, e, t, i, !0)
  7920. },
  7921. clear: function(e, t, i) {
  7922. n.call(this, e, t, i, !1)
  7923. }
  7924. }
  7925. }
  7926. , {
  7927. "../enum/HelpModalSize": 27,
  7928. "../enum/HelpModalType": 28,
  7929. "../enum/Viewmode": 51,
  7930. "../localization/localize": 108,
  7931. "../util/browser": 182
  7932. }],
  7933. 76: [function(e, t, i) {
  7934. "use strict";
  7935. t.exports = Object.freeze({
  7936. OPENED: "share.open",
  7937. CLOSED: "share.closed",
  7938. LINK_CLICKED: "share.linked"
  7939. })
  7940. }
  7941. , {}],
  7942. 77: [function(e, t, i) {
  7943. "use strict";
  7944. function n(n) {
  7945. function e(e, t) {
  7946. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7947. I.emit(l.LINK_CLICKED, {
  7948. channel: n
  7949. }),
  7950. window.open(C[n], "shareWindow", i)
  7951. }
  7952. switch (n) {
  7953. case A.FACEBOOK:
  7954. e(580, 420);
  7955. break;
  7956. case A.TWITTER:
  7957. e(550, 440);
  7958. break;
  7959. case A.MAIL:
  7960. I.emit(l.LINK_CLICKED, {
  7961. channel: "email"
  7962. }),
  7963. window.open(C[n], "_blank");
  7964. break;
  7965. case A.LINKEDIN:
  7966. }
  7967. }
  7968. function r(e) {
  7969. I.emit(l.LINK_CLICKED, {
  7970. channel: "copylink"
  7971. });
  7972. var t = document.createRange();
  7973. t.selectNodeContents(v);
  7974. var i = window.getSelection();
  7975. i.removeAllRanges(),
  7976. i.addRange(t),
  7977. document.execCommand("copy"),
  7978. y.classList.remove("hidden"),
  7979. v.classList.add("highlighted")
  7980. }
  7981. function o(e) {
  7982. e && (e.stopPropagation(),
  7983. e.target === v) || (window.getSelection().removeAllRanges(),
  7984. v.classList.remove("highlighted"),
  7985. y.classList.add("hidden"))
  7986. }
  7987. var a = e("../../util/browser")
  7988. , s = e("../../localization/localize")
  7989. , l = e("./ShareEvents")
  7990. , c = e("../../util/common")
  7991. , h = e("events").EventEmitter
  7992. , u = document.getElementById("sharing")
  7993. , d = document.getElementById("share-modal")
  7994. , p = document.getElementById("share-close")
  7995. , f = document.getElementById("facebook-share")
  7996. , g = document.getElementById("twitter-share")
  7997. , m = document.getElementById("mail-share")
  7998. , v = document.getElementById("share-url-text")
  7999. , y = document.getElementById("copy-success")
  8000. , A = Object.freeze({
  8001. FACEBOOK: "facebook",
  8002. TWITTER: "twitter",
  8003. MAIL: "mail",
  8004. LINKEDIN: "linkedin"
  8005. })
  8006. , C = {};
  8007. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8008. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8009. C[A.MAIL] = "mailto:?subject=";
  8010. var I = {
  8011. init: function(e) {
  8012. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8013. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8014. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8015. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8016. u.addEventListener("click", this.toggle.bind(this)),
  8017. p.addEventListener("click", this.hide.bind(this)),
  8018. v.addEventListener("click", r),
  8019. d.addEventListener("click", o),
  8020. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8021. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8022. m.addEventListener("click", n.bind(this, A.MAIL)),
  8023. v.textContent = window.location.href + "&utm_source=4",
  8024. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8025. u.classList.remove("hidden")
  8026. },
  8027. show: function() {
  8028. this.emit(l.OPENED),
  8029. d.classList.add("fadeIn")
  8030. },
  8031. hide: function() {
  8032. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8033. document.selection && document.selection.empty(),
  8034. window.getSelection().removeAllRanges(),
  8035. o(),
  8036. d.classList.remove("fadeIn"))
  8037. },
  8038. toggle: function() {
  8039. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8040. }
  8041. };
  8042. c.extendObject(I, h.prototype),
  8043. t.exports = I
  8044. }
  8045. , {
  8046. "../../localization/localize": 108,
  8047. "../../util/browser": 182,
  8048. "../../util/common": 185,
  8049. "./ShareEvents": 76,
  8050. events: 202
  8051. }],
  8052. 78: [function(e, t, i) {
  8053. "use strict";
  8054. t.exports = Object.freeze({
  8055. OPENED: "terms.opened",
  8056. CLOSED: "terms.closed"
  8057. })
  8058. }
  8059. , {}],
  8060. 79: [function(e, t, i) {
  8061. "use strict";
  8062. var n = e("./TermsEvent")
  8063. , r = e("../../localization/localize")
  8064. , o = e("../../analytics")
  8065. , a = e("../../util/ajax")
  8066. , s = e("../../util/common")
  8067. , l = e("events").EventEmitter
  8068. , c = document.getElementById("terms-modal")
  8069. , h = {
  8070. init: function() {
  8071. $(".footer-terms").on("click", function(e) {
  8072. e.preventDefault(),
  8073. this.show()
  8074. }
  8075. .bind(this)),
  8076. $("#terms-modal .close").on("click", this.hide.bind(this))
  8077. },
  8078. show: function() {
  8079. this.emit(n.OPENED),
  8080. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8081. var t = $("#terms-text").html(e);
  8082. o.track("showcase_gui", {
  8083. gui_action: "click_terms_button",
  8084. interaction_source: "gui"
  8085. }),
  8086. t.find("a").attr("target", "_blank")
  8087. }).fail(function() {
  8088. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8089. }),
  8090. c.classList.add("fadeIn")
  8091. },
  8092. hide: function(e) {
  8093. e && e.preventDefault(),
  8094. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8095. c.classList.remove("fadeIn")
  8096. }
  8097. };
  8098. s.extendObject(h, l.prototype),
  8099. t.exports = h
  8100. }
  8101. , {
  8102. "../../analytics": 4,
  8103. "../../localization/localize": 108,
  8104. "../../util/ajax": 181,
  8105. "../../util/common": 185,
  8106. "./TermsEvent": 78,
  8107. events: 202
  8108. }],
  8109. 80: [function(e, t, i) {
  8110. "use strict";
  8111. t.exports = Object.freeze({
  8112. OPEN_INFO: "title.open.info",
  8113. CLOSE_INFO: "title.close.info",
  8114. SHOW_INFO: "title.show.info",
  8115. HIDE_INFO: "title.hide.info",
  8116. LINK_CLICKED: "title.link.click",
  8117. CONTACT_LINK_CLICKED: "title.contact.click",
  8118. ORIGIN_LINK_CLICKED: "title.origin.click"
  8119. })
  8120. }
  8121. , {}],
  8122. 81: [function(e, t, i) {
  8123. "use strict";
  8124. var o = e("../../settings");
  8125. t.exports.init = function(e, t) {
  8126. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8127. function e(e) {
  8128. t.shouldShowtags = "show" === this.value,
  8129. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8130. }
  8131. document.getElementById("tag-toggles").classList.remove("hidden"),
  8132. document.getElementById("radio-tag-show").checked = !0;
  8133. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8134. n[r].addEventListener("change", e)
  8135. }(e, t)
  8136. }
  8137. }
  8138. , {
  8139. "../../settings": 166
  8140. }],
  8141. 82: [function(S, M, e) {
  8142. (function(e) {
  8143. "use strict";
  8144. function i(e) {
  8145. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8146. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8147. _.appendChild(function(e) {
  8148. var t = document.createElement("a");
  8149. return t.id = "url",
  8150. t.target = "_blank",
  8151. t.href = e,
  8152. t.innerText = e,
  8153. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8154. t
  8155. }(e)),
  8156. b.forEach(function(e) {
  8157. e.classList.add("share-link")
  8158. }),
  8159. 0))
  8160. }
  8161. function s(e, t) {
  8162. var i = e
  8163. , n = t;
  8164. return function(e, t) {
  8165. i.push(t || n, e)
  8166. }
  8167. }
  8168. var l = S("../../util/browser")
  8169. , t = S("../../util/common")
  8170. , n = S("../../util/logger")
  8171. , r = S("../../localization/localize")
  8172. , o = S("./titleBarSettings")
  8173. , c = S("../../settings")
  8174. , a = S("./TitleEvents")
  8175. , h = S("events").EventEmitter
  8176. , u = new n(e)
  8177. , d = document.querySelector(".pinTop.left")
  8178. , p = document.getElementsByClassName("title-container")[0]
  8179. , f = document.getElementById("title-toggle").querySelector("i")
  8180. , g = document.getElementById("meta-info-wrapper")
  8181. , m = document.getElementById("meta-info")
  8182. , v = document.getElementById("meta-description")
  8183. , y = document.getElementsByClassName("contact-info")[0]
  8184. , A = document.getElementById("contact-data")
  8185. , C = document.getElementById("addressTxt")
  8186. , I = document.getElementById("tag-toggles")
  8187. , E = document.getElementById("share-origin")
  8188. , _ = document.getElementById("share-link-wrapper")
  8189. , b = [m, g, p]
  8190. , w = !1
  8191. , T = !1
  8192. , x = {
  8193. populate: function(e) {
  8194. if (function(e, t) {
  8195. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8196. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8197. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8198. document.getElementById("gui-name").classList.add("noCoBrand"),
  8199. document.getElementById("cobrandTitle").classList.add("hidden")),
  8200. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8201. !1)
  8202. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8203. if (function(e) {
  8204. e ? (w = !0,
  8205. v.innerHTML = e) : v.classList.add("hidden")
  8206. }(e.description),
  8207. function(e, t, i, n) {
  8208. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8209. w = !0;
  8210. var r = []
  8211. , o = s(r, "<br>");
  8212. if (e && o('<span id="contactName">' + e + "</span>"),
  8213. t) {
  8214. var a = n || t;
  8215. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8216. }
  8217. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8218. r[0] = "",
  8219. A.innerHTML = r.join("")
  8220. } else
  8221. y.classList.add("hidden")
  8222. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8223. function(e) {
  8224. if ("string" == typeof e)
  8225. try {
  8226. e = JSON.parse(e)
  8227. } catch (e) {
  8228. return u.warn("Unable to parse address data"),
  8229. C.parentElement.classList.add("hidden")
  8230. }
  8231. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8232. w = !0;
  8233. var t = []
  8234. , i = s(t, " ");
  8235. e.address_1 && i(e.address_1),
  8236. e.address_2 && i(e.address_2),
  8237. e.city && i(e.city, ", "),
  8238. e.state && i(e.state, ", "),
  8239. e.zip && i(e.zip, e.state ? " " : ", "),
  8240. t[0] = "",
  8241. C.innerText = t.join("")
  8242. } else
  8243. C.parentElement.classList.add("hidden")
  8244. }(e.address),
  8245. w) {
  8246. var t = document.createElement("br");
  8247. I.insertBefore(t, I.firstElementChild)
  8248. }
  8249. e.socialSharing && c.share.enabled && (T = i(e.url))
  8250. }
  8251. },
  8252. finishSetup: function(e) {
  8253. w = w || !!e,
  8254. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8255. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8256. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8257. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8258. }),
  8259. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8260. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8261. contact_type: e.getAttribute("id")
  8262. }))
  8263. }),
  8264. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8265. },
  8266. toggleMeta: function(e, t) {
  8267. var i = document.getElementById("model-title");
  8268. t && t.preventDefault();
  8269. var n = m.classList.contains("expand");
  8270. e && !n || (n ? (b.forEach(function(e) {
  8271. e.classList.remove("expand")
  8272. }),
  8273. this.emit(a.CLOSE_INFO),
  8274. i.classList.remove("expand")) : (b.forEach(function(e) {
  8275. e.classList.add("expand")
  8276. }),
  8277. i.classList.add("expand"),
  8278. this.emit(a.OPEN_INFO)))
  8279. },
  8280. setupToggling: function() {
  8281. g.style.height = m.offsetHeight + "px",
  8282. m.addEventListener("transitionend", function() {
  8283. g.style.height = m.offsetHeight + "px"
  8284. })
  8285. },
  8286. toggleTitle: function(e) {
  8287. e && e.preventDefault(),
  8288. d.classList.contains("closed") ? (d.classList.add("open"),
  8289. f.classList.remove("icon-dpad-right"),
  8290. f.classList.add("icon-dpad-left"),
  8291. this.emit(a.SHOW_INFO),
  8292. setTimeout(function() {
  8293. d.classList.remove("closed"),
  8294. d.classList.remove("open")
  8295. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8296. f.classList.remove("icon-dpad-left"),
  8297. f.classList.add("icon-dpad-right"),
  8298. this.emit(a.HIDE_INFO))
  8299. }
  8300. };
  8301. t.extendObject(x, h.prototype),
  8302. M.exports = x
  8303. }
  8304. ).call(this, "/js/gui/title/titleBar.js")
  8305. }
  8306. , {
  8307. "../../localization/localize": 108,
  8308. "../../settings": 166,
  8309. "../../util/browser": 182,
  8310. "../../util/common": 185,
  8311. "../../util/logger": 189,
  8312. "./TitleEvents": 80,
  8313. "./titleBarSettings": 83,
  8314. events: 202
  8315. }],
  8316. 83: [function(e, t, i) {
  8317. "use strict";
  8318. t.exports = Object.freeze({
  8319. minTooltipCharacters: 19,
  8320. removeAnimationClasses: 500
  8321. })
  8322. }
  8323. , {}],
  8324. 84: [function(e, t, i) {
  8325. "use strict";
  8326. function n() {
  8327. v.playTour(),
  8328. y && clearTimeout(y),
  8329. c(),
  8330. E.removeClass("fadeIn")
  8331. }
  8332. function r() {
  8333. A.classList.contains("playing") && (v.stopTour(),
  8334. E.addClass("fadeIn"),
  8335. setTimeout(function() {
  8336. E.removeClass("fadeIn")
  8337. }, h.tourInteraction.showPauseButton),
  8338. M || (clearTimeout(y),
  8339. y = setTimeout(s, h.tourInteraction.showModal)),
  8340. setTimeout(function() {
  8341. A.classList.remove("playing")
  8342. }, h.tourInteraction.allowNextClick))
  8343. }
  8344. function o() {
  8345. v.tourInProgress && (v.stopTour(),
  8346. v.endTourProgress(),
  8347. A.classList.remove("playing"))
  8348. }
  8349. function a() {
  8350. _.is(":visible") ? n() : r()
  8351. }
  8352. function s() {//去掉导览结束时的提示
  8353. /* if (!h.tourInteraction.disabled) {
  8354. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8355. T.addClass("fadeIn tour " + p.deviceType);
  8356. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8357. if (!h.tourInteraction.smallModal)
  8358. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8359. p.fill(x, g.TOUR_INTERACTION[e]),
  8360. T.addClass(e);
  8361. T.addClass(t)
  8362. } */
  8363. }
  8364. function l(e, t) {
  8365. if (t) {
  8366. var i = "keydown" === t.type
  8367. , n = t.which === u.SPACE || v.tourIsPlaying;
  8368. i && n || e || (M = !0),
  8369. v.atEndOfTour() && c(),
  8370. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8371. c(),
  8372. t.which !== u.SPACE && o()),
  8373. i && n && a()
  8374. }
  8375. }
  8376. function c() {
  8377. T.removeClass("fadeIn")
  8378. }
  8379. var h = (e("../util/browser"),
  8380. e("../settings"))
  8381. , u = e("../enum/Keys")
  8382. , d = e("../enum/Viewmode")
  8383. , p = (e("./helpManager"),
  8384. e("./populateModal"))
  8385. , f = e("../enum/DirectorEvents")
  8386. , g = e("../enum/HelpModalType")
  8387. , m = e("../enum/HelpModalSize")
  8388. , v = null
  8389. , y = null
  8390. , A = document.getElementById("pause-overlay")
  8391. , C = document.getElementById("player")
  8392. , I = document.getElementById("gui")
  8393. , E = $("#pause-icon").eq(0)
  8394. , _ = $("#play").eq(0)
  8395. , b = $("#playHead").eq(0)
  8396. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8397. , T = $("#interaction-modal").eq(0)
  8398. , x = $("#interaction-modal .interaction").toArray()
  8399. , S = ["touchstart", "mousedown", "pointerdown"]
  8400. , M = !1;
  8401. t.exports.init = function(e) {
  8402. v = e,
  8403. S.forEach(function(t) {
  8404. C.addEventListener(t, l.bind(this, !1), !0),
  8405. I.addEventListener(t, l.bind(this, !0), !0),
  8406. A.addEventListener(t, r, !0),
  8407. w.forEach(function(e) {
  8408. e.addEventListener(t, o, !0)
  8409. }),
  8410. $("#drawer img").on(t, o)
  8411. }),
  8412. document.addEventListener("keydown", l.bind(this, !1), !0),
  8413. v.on(f.TourStart, function() {
  8414. A.classList.add("playing")
  8415. })
  8416. }
  8417. ,
  8418. t.exports.play = n,
  8419. t.exports.pause = r,
  8420. t.exports.pauseWithoutCTA = o,
  8421. t.exports.togglePlay = a,
  8422. t.exports.stopTour = function() {
  8423. b.hasClass("playing") && (clearTimeout(y),
  8424. v.atEndOfTour() ? (A.classList.remove("playing"),
  8425. s()) : E.removeClass("fadeIn"))
  8426. }
  8427. ,
  8428. t.exports.dismissModal = c
  8429. }
  8430. , {
  8431. "../enum/DirectorEvents": 23,
  8432. "../enum/HelpModalSize": 27,
  8433. "../enum/HelpModalType": 28,
  8434. "../enum/Keys": 30,
  8435. "../enum/Viewmode": 51,
  8436. "../settings": 166,
  8437. "../util/browser": 182,
  8438. "./helpManager": 68,
  8439. "./populateModal": 75
  8440. }],
  8441. 85: [function(e, t, i) {
  8442. "use strict";
  8443. t.exports = Object.freeze({
  8444. OPENED: "vr.modal.opened",
  8445. LAUNCH: "vr.modal.launch",
  8446. CLOSED: "vr.modal.closed",
  8447. NEXT: "vr.modal.next",
  8448. PREV: "vr.modal.prev",
  8449. STORE: "vr.modal.store",
  8450. falseICECHOSEN: "vr.modal.device"
  8451. })
  8452. }
  8453. , {}],
  8454. 86: [function(e, t, i) {
  8455. "use strict";
  8456. var h = e("../../util/browser")
  8457. , u = e("../../enum/VRApps")
  8458. , n = e("../../enum/VRPlatforms")
  8459. , d = e("../../util/ajax")
  8460. , p = e("../../settings")
  8461. , r = {};
  8462. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8463. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8464. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8465. u) {
  8466. var a = u[o];
  8467. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8468. }
  8469. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8470. "https://" + s);
  8471. t.exports.init = function(e, t, o) {
  8472. function a(e, t, i, n) {
  8473. function r() {
  8474. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8475. }
  8476. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8477. }
  8478. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8479. , l = g + "/vr/dlist/?ret=" + s
  8480. , c = g + "/vr/show/?ret=" + s;
  8481. switch (e) {
  8482. case n.IOS:
  8483. !function(t, e, i, n) {
  8484. var r = a(t, e, i, n)
  8485. , o = {
  8486. responseType: "json",
  8487. data: {
  8488. branch_key: p.appConfig.branch_key,
  8489. data: {
  8490. m: e,
  8491. full_url: r,
  8492. $desktop_url: "",
  8493. $og_app_id: "331853976762864119",
  8494. $og_title: i,
  8495. $og_description: n,
  8496. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8497. $canonical_url: window.location.href
  8498. }
  8499. }
  8500. };
  8501. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8502. f[t] = e.url
  8503. }).fail(function(e) {
  8504. f[t] = e
  8505. }
  8506. .bind(this, r))
  8507. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8508. break;
  8509. default:
  8510. !function(e, t, i) {
  8511. for (var n in u) {
  8512. var r = u[n]
  8513. , o = a(r, e, t, i);
  8514. f[r] = o
  8515. }
  8516. }(t.sid, t.name, t.summary)
  8517. }
  8518. }
  8519. ,
  8520. t.exports.launch = function(e) {
  8521. var t = f[e];
  8522. window.open(t, "_blank")
  8523. }
  8524. ,
  8525. t.exports.launchStore = function(e) {
  8526. var t = r[e];
  8527. window.open(t, "_blank")
  8528. }
  8529. }
  8530. , {
  8531. "../../enum/VRApps": 46,
  8532. "../../enum/VRPlatforms": 49,
  8533. "../../settings": 166,
  8534. "../../util/ajax": 181,
  8535. "../../util/browser": 182
  8536. }],
  8537. 87: [function(e, t, i) {
  8538. "use strict";
  8539. function c(e) {
  8540. var t;
  8541. switch (e) {
  8542. case y.IOS:
  8543. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8544. case y.Android:
  8545. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8546. }
  8547. return !1
  8548. }
  8549. function h(e) {
  8550. switch (e) {
  8551. case y.Android:
  8552. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8553. x.filter(".gearvr").off().on("click", q.gear),
  8554. n(k, U, "logo-button", "same-line");
  8555. break;
  8556. case y.UnsupportedAndroid:
  8557. n("", H, "", "");
  8558. break;
  8559. case y.IOS:
  8560. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8561. n(k, "", "logo-button", "");
  8562. break;
  8563. case y.Desktop:
  8564. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8565. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8566. n(k, U, "logo-button", "same-line"),
  8567. Q.cardboard()
  8568. }
  8569. }
  8570. function u(e) {
  8571. $(".p1, .p2, .p3").hide(),
  8572. l.insertAfter(T),
  8573. w.removeClass("front-page"),
  8574. w.removeClass("details-page"),
  8575. w.removeClass("lastPage"),
  8576. x.removeClass("logo-button"),
  8577. x.removeClass("same-line"),
  8578. T.removeClass("headsetOptions"),
  8579. S.attr("src", ""),
  8580. S.filter(".second").removeClass("gear"),
  8581. S.css("display", "inline-block"),
  8582. S.off(),
  8583. M.filter(".second").css("display", ""),
  8584. O.css("display", "none"),
  8585. $(".p" + (e + 1) + _).show(),
  8586. S.filter(".third").insertBefore(M.filter(".third"))
  8587. }
  8588. function n(e, t, i, n) {
  8589. w.addClass("front-page"),
  8590. S.filter(".first").attr("src", e),
  8591. S.filter(".second").attr("src", t),
  8592. x.filter(".first").addClass(i),
  8593. x.filter(".second").addClass(i),
  8594. x.addClass(n),
  8595. ".show-desktop" === _ && T.insertAfter(l)
  8596. }
  8597. function r(e, t, i) {
  8598. T.addClass("headsetOptions"),
  8599. x.off(),
  8600. S.filter(".second").attr("src", t),
  8601. O.css("display", "block"),
  8602. M.filter(".second").css("display", "none"),
  8603. O.on("click", function() {
  8604. u(b.Title),
  8605. h(y.Desktop)
  8606. }),
  8607. e && (X.emit(C.falseICECHOSEN, {
  8608. name: v.GearVR
  8609. }),
  8610. S.filter(".first").attr("src", e),
  8611. S.filter(".second").addClass("gear"),
  8612. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8613. Q.gearvr()),
  8614. i && (X.emit(C.falseICECHOSEN, {
  8615. name: v.Cardboard
  8616. }),
  8617. S.filter(".third").attr("src", i),
  8618. S.filter(".third").show(),
  8619. S.filter(".third").insertAfter(S.filter(".second")),
  8620. S.filter(".third").addClass("link"),
  8621. S.filter(".second").addClass("link"),
  8622. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8623. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8624. Q.cardboard())
  8625. }
  8626. function d(e, t) {
  8627. switch (t) {
  8628. case y.IOS:
  8629. j = W,
  8630. Y = G;
  8631. break;
  8632. case y.Desktop:
  8633. e === b.Cardboard ? (j = N,
  8634. Y = B,
  8635. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8636. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8637. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8638. Y = "");
  8639. break;
  8640. default:
  8641. Y = e === b.Cardboard ? (j = H,
  8642. G) : (j = V,
  8643. z)
  8644. }
  8645. }
  8646. function p(e, t, i) {
  8647. w.find(".inner").addClass("details-page"),
  8648. w.addClass("details-page"),
  8649. S.filter(".first").attr("src", e),
  8650. S.filter(".second").attr("src", t),
  8651. S.filter(".third").attr("src", i)
  8652. }
  8653. function f() {
  8654. var e = 1 < g.aspectRatio() && g.isMobile();
  8655. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8656. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8657. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8658. }
  8659. var g = e("../../util/browser")
  8660. , m = e("./vrLink")
  8661. , v = e("../../enum/VRApps")
  8662. , y = e("../../enum/VRPlatforms")
  8663. , A = e("../../enum/VRPages")
  8664. , C = e("./vrEvent")
  8665. , o = (e("../../settings"),
  8666. e("../../constants"))
  8667. , I = e("../../localization/localize")
  8668. , a = e("../../util/common")
  8669. , s = e("events").EventEmitter
  8670. , E = 0
  8671. , _ = null
  8672. , b = A.standard
  8673. , w = $(".vr-popup")
  8674. , l = w.find(".vr-popup-body")
  8675. , T = w.find(".vr-images")
  8676. , x = w.find(".img-container")
  8677. , S = w.find(".vr-sm-image")
  8678. , M = x.find(".vr-img-caption")
  8679. , R = $(".vr-buttons").find(".prev-button")
  8680. , P = $(".vr-buttons").find(".next-button")
  8681. , O = T.find(".front-close")
  8682. , L = $(".vr-page")
  8683. , D = w.find("img")
  8684. , N = "images/apple-store.png"
  8685. , F = "images/badge-oculus.png"
  8686. , B = "images/badge-cardboard.png"
  8687. , V = "images/logo-samsung.png"
  8688. , k = "images/headset-cardboard.png"
  8689. , U = "images/headset-gearvr.png"
  8690. , H = "images/ico-android-robot.png"
  8691. , z = "images/ico-gearvr.png"
  8692. , G = "images/ico-vr.png"
  8693. , W = "images/apple-logo-white.svg"
  8694. , j = null
  8695. , Y = null
  8696. , q = {}
  8697. , X = {
  8698. init: function(e, t) {
  8699. function i(e) {
  8700. X.emit(C.STORE, {
  8701. type: e
  8702. }),
  8703. m.launchStore(e)
  8704. }
  8705. function n(e) {
  8706. switch (e !== b.pageCount && (u(e),
  8707. L.text(e + 1 + " / " + b.pageCount)),
  8708. e) {
  8709. case b.Title:
  8710. R.css("display", "none"),
  8711. P.text(a[e]),
  8712. h(r);
  8713. break;
  8714. case b.Cardboard:
  8715. R.css("display", "block"),
  8716. P.text(a[e]),
  8717. x.filter(".cardboard").off(),
  8718. x.filter(".gearvr").off(),
  8719. d(e, r),
  8720. p(k, j, Y);
  8721. break;
  8722. case b.Gear:
  8723. P.text(a[e]),
  8724. d(e, r),
  8725. w.addClass("lastPage"),
  8726. p(U, j, Y);
  8727. break;
  8728. case b.pageCount:
  8729. w.removeClass("fadeIn"),
  8730. X.emit(C.CLOSED)
  8731. }
  8732. D.filter("[src='']").hide()
  8733. }
  8734. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8735. _ = ".show-supported",
  8736. y.Android) : (w.addClass("unsupported"),
  8737. _ = ".show-unsupported",
  8738. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8739. _ = ".show-ios",
  8740. b = A.ios,
  8741. y.IOS) : (w.addClass("desktop"),
  8742. _ = ".show-desktop",
  8743. y.Desktop);
  8744. function o(e) {
  8745. X.emit(C.LAUNCH, {
  8746. vr_platform: r,
  8747. vr_app: e
  8748. }),
  8749. m.launch(e)
  8750. }
  8751. m.init(r, e, t),
  8752. r !== y.Desktop && w.addClass("mobile"),
  8753. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8754. q.gear = o.bind(this, v.GearVR),
  8755. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8756. f(),
  8757. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8758. $(_).show();
  8759. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8760. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8761. r === y.IOS && (a.splice(1, 1),
  8762. s.splice(1, 1)),
  8763. $("#vr").on("click", function(e) {
  8764. e.preventDefault(),
  8765. window.vrEnabled || (window.vrEnabled = !0,
  8766. this.classList.add("active"),
  8767. $("#gui div").not("#vrOff").addClass("vrHide"),
  8768. $("#vrOffImg").css({
  8769. display: "inline-block"
  8770. }))
  8771. }),
  8772. $("#vrOff").on("click", function() {
  8773. window.vrEnabled = !1,
  8774. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8775. $("#vrOffImg").css({
  8776. display: "none"
  8777. }),
  8778. $("#player canvas").css({
  8779. width: "",
  8780. height: ""
  8781. }),
  8782. $("#vr").removeClass("active")
  8783. });
  8784. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8785. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8786. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8787. $("span.modelLink").text(l),
  8788. R.on("click", function(e) {
  8789. X.emit(C.PREV),
  8790. n(--E)
  8791. }),
  8792. P.on("click", function(e) {
  8793. P.text(),
  8794. X.emit(C.NEXT, {
  8795. nextAction: s[E]
  8796. }),
  8797. n(++E)
  8798. }),
  8799. w.find(".close").on("click", X.dismiss)
  8800. },
  8801. dismiss: function() {
  8802. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8803. X.emit(C.CLOSED))
  8804. },
  8805. isDeviceSupported: c
  8806. };
  8807. a.extendObject(X, s.prototype),
  8808. $(window).resize(f);
  8809. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8810. K = M.filter(".first").find(".gearvr"),
  8811. {
  8812. cardboard: function() {
  8813. K.addClass("hidden"),
  8814. Z.removeClass("hidden")
  8815. },
  8816. gearvr: function() {
  8817. Z.addClass("hidden"),
  8818. K.removeClass("hidden")
  8819. }
  8820. });
  8821. t.exports = X
  8822. }
  8823. , {
  8824. "../../constants": 8,
  8825. "../../enum/VRApps": 46,
  8826. "../../enum/VRPages": 48,
  8827. "../../enum/VRPlatforms": 49,
  8828. "../../localization/localize": 108,
  8829. "../../settings": 166,
  8830. "../../util/browser": 182,
  8831. "../../util/common": 185,
  8832. "./vrEvent": 85,
  8833. "./vrLink": 86,
  8834. events: 202
  8835. }],
  8836. 88: [function(e, t, i) {
  8837. "use strict";
  8838. t.exports = Object.freeze({
  8839. OPENED: "webvr.modal.opened",
  8840. SHOW_TERMS: "webvr.footer.show.terms"
  8841. })
  8842. }
  8843. , {}],
  8844. 89: [function(B, V, e) {
  8845. (function(e) {
  8846. "use strict";
  8847. function a() {
  8848. function t() {
  8849. p.isPresenting || (r.info("exiting webVR"),
  8850. c("webvr_exit_app"),
  8851. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8852. window.removeEventListener("vrdisplaypresentchange", t))
  8853. }
  8854. r.info("Headset mounted"),
  8855. u.suspend();
  8856. var e = document.createElement("canvas");
  8857. for (e.getContext("webgl"),
  8858. e.className = "webvr-canvas",
  8859. document.bgColor = "#000",
  8860. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8861. document.body.removeChild(document.body.firstChild);
  8862. document.body.appendChild(e),
  8863. c("webvr_enter_app"),
  8864. p.requestPresent([{
  8865. source: e,
  8866. predistorted: !0
  8867. }]).catch(function(e) {
  8868. r.error("Failed to present: " + e),
  8869. c("webvr_exit_calibrate"),
  8870. t()
  8871. }),
  8872. d.then(function() {
  8873. window.dispatchEvent(new Event("vrapp-start"))
  8874. }),
  8875. window.addEventListener("vrdisplaypresentchange", t)
  8876. }
  8877. function s() {
  8878. c("webvr_modal_close"),
  8879. _.find(".enter-button").off("click", a),
  8880. E.fadeOut(g.guiAnimationSpeed, function() {
  8881. _.toggleClass("hidden", !1),
  8882. b.toggleClass("hidden", !0),
  8883. f.exitFullscreen()
  8884. }),
  8885. I.fadeIn(g.guiAnimationSpeed)
  8886. }
  8887. function t() {
  8888. M.toggleClass("hidden", !0),
  8889. S.toggleClass("hidden", !1)
  8890. }
  8891. function l() {
  8892. _.toggleClass("hidden"),
  8893. b.toggleClass("hidden")
  8894. }
  8895. function c(e) {
  8896. var t = f.isLandscape() ? "landscape" : "portrait";
  8897. i.trackAlways("showcase_gui", {
  8898. gui_action: e,
  8899. orientation: t
  8900. })
  8901. }
  8902. function h() {
  8903. var e = f.isLandscape();
  8904. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8905. }
  8906. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8907. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8908. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  8909. init: function(e, t, i, n) {
  8910. function r(e) {
  8911. e.preventDefault(),
  8912. o(e.currentTarget.id)
  8913. }
  8914. function o(i) {
  8915. F[i](),
  8916. Object.keys(F).map(function(e, t) {
  8917. $("#" + e).toggleClass("tabs-underlined", e === i)
  8918. })
  8919. }
  8920. p = i,
  8921. u = t,
  8922. y.init(m.Android, e, n),
  8923. h(),
  8924. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8925. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8926. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8927. w.filter(".device-headset-side").attr("src", R),
  8928. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8929. $("#vr").on("click", function(e) {
  8930. e.preventDefault(),
  8931. c("click_webvr_button"),
  8932. E.is(":hidden") && (N.emit(A.OPENED),
  8933. I.fadeOut(g.guiAnimationSpeed),
  8934. E.fadeIn(g.guiAnimationSpeed),
  8935. function() {
  8936. if (!d) {
  8937. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8938. d = new Promise(function(e, t) {
  8939. var i = document.createElement("script");
  8940. i.type = "text/javascript",
  8941. i.src = n,
  8942. i.onload = e,
  8943. document.head.appendChild(i)
  8944. }
  8945. )
  8946. }
  8947. _.find(".enter-button").on("click", a)
  8948. }())
  8949. }),
  8950. $(".webvr-popup .close").on("click", function(e) {
  8951. e.preventDefault(),
  8952. _.hasClass("hidden") ? (c("webvr_help_close"),
  8953. l()) : s()
  8954. }),
  8955. $("#tabcardboard").on("click", r),
  8956. $("#tabdaydream").on("click", r),
  8957. $("#tabnative").on("click", r),
  8958. $(".webvr-popup .open-with-app").on("click", function(e) {
  8959. e.preventDefault(),
  8960. c("webvr_learn_more"),
  8961. o("tabnative"),
  8962. l()
  8963. }),
  8964. $(".webvr-popup .help").on("click", function(e) {
  8965. e.preventDefault(),
  8966. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8967. l()
  8968. }),
  8969. $(".webvr-popup .terms").on("click", function(e) {
  8970. e.preventDefault(),
  8971. c("webvr_click_terms"),
  8972. s(),
  8973. N.emit(A.SHOW_TERMS)
  8974. }),
  8975. T.on("click", function(e) {
  8976. e.preventDefault(),
  8977. c(D),
  8978. window.open(L, "_blank")
  8979. }),
  8980. x.on("click", function(e) {
  8981. e.preventDefault(),
  8982. c("webvr_phone_link"),
  8983. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8984. }),
  8985. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8986. e.preventDefault(),
  8987. c("webvr_cardboard_link"),
  8988. y.launch(v.CardboardAndroid)
  8989. }),
  8990. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8991. e.preventDefault(),
  8992. c("webvr_oculus_link"),
  8993. y.launch(v.GearVR)
  8994. })
  8995. }
  8996. }, F = {
  8997. tabcardboard: function() {
  8998. w.filter(".device-headset").attr("src", R),
  8999. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9000. L = "https://vr.google.com/cardboard/get-cardboard/",
  9001. D = "webvr_cardboard_link",
  9002. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9003. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9004. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9005. t()
  9006. },
  9007. tabdaydream: function() {
  9008. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9009. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9010. L = P,
  9011. D = O,
  9012. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9013. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9014. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9015. t()
  9016. },
  9017. tabnative: function() {
  9018. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9019. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9020. M.toggleClass("hidden", !1),
  9021. S.toggleClass("hidden", !0)
  9022. }
  9023. };
  9024. n.extendObject(N, o.prototype),
  9025. $(window).resize(h),
  9026. V.exports = N
  9027. }
  9028. ).call(this, "/js/gui/webvr/webVRgui.js")
  9029. }
  9030. , {
  9031. "../../analytics": 4,
  9032. "../../constants": 8,
  9033. "../../enum/VRApps": 46,
  9034. "../../enum/VRPlatforms": 49,
  9035. "../../localization/localize": 108,
  9036. "../../settings": 166,
  9037. "../../util/browser": 182,
  9038. "../../util/common": 185,
  9039. "../../util/logger": 189,
  9040. "./../gui": 65,
  9041. "./../vr/vrLink": 86,
  9042. "./WebVrEvent": 88,
  9043. events: 202
  9044. }],
  9045. 90: [function(e, t, i) {
  9046. "use strict";
  9047. function n(e, t, i, n, r) {
  9048. this.floorId = n || 0 === n ? n : -1,
  9049. this.roomId = r || "",
  9050. this.labelId = e,
  9051. this.position = (new o.Vector3).copy(t),
  9052. this.text = i
  9053. }
  9054. var o = e("three")
  9055. , r = e("../util/browser");
  9056. n.prototype.build = function() {
  9057. var e = window.document.createElement("div");
  9058. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9059. var t = window.document.createElement("div");
  9060. t.setAttribute("class", "gui-floorplan-label-text");
  9061. var i = window.document.createTextNode(this.text);
  9062. t.appendChild(i),
  9063. e.appendChild(t),
  9064. window.document.body.appendChild(e),
  9065. this.labelGui = e,
  9066. this.textBlock = t,
  9067. $(this.labelGui).hide();
  9068. var n = window.getComputedStyle(this.labelGui);
  9069. this.initialTransform = n.transform || n.webkitTransform
  9070. }
  9071. ,
  9072. t.exports = n
  9073. }
  9074. , {
  9075. "../util/browser": 182,
  9076. three: 217
  9077. }],
  9078. 91: [function(e, t, i) {
  9079. "use strict";
  9080. function n() {
  9081. this.player = null,
  9082. this.modelManager = null,
  9083. this.container = null
  9084. }
  9085. var c, o, r = e("three"), a = (e("../util/common"),
  9086. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9087. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9088. e("../util/transitions"),
  9089. e("../util/lerp"),
  9090. e("../util/browser"));
  9091. n.prototype.init = function(e, t, i) {
  9092. this.player = e,
  9093. this.modelManager = t,
  9094. this.container = i,
  9095. this.updateModel(),
  9096. this.bindEvents()
  9097. }
  9098. ,
  9099. n.prototype.bindEvents = function() {
  9100. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9101. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9102. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9103. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9104. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9105. }
  9106. ,
  9107. n.prototype.updateModel = function() {
  9108. this.model = this.modelManager.getActiveModel()
  9109. }
  9110. ,
  9111. n.prototype.handlePlayerViewChanged = function() {
  9112. this.updateLabelVisibility(),
  9113. this.updateLabelDisplay()
  9114. }
  9115. ,
  9116. n.prototype.getLabelsForFloor = function(t, i) {
  9117. return (i = i || []).length = 0,
  9118. this.model.labels.forEach(function(e) {
  9119. this.labelVisibleForFloor(e, t) && i.push(e)
  9120. }
  9121. .bind(this)),
  9122. i
  9123. }
  9124. ,
  9125. n.prototype.getLabelsForCurrentFloor = function(e) {
  9126. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9127. }
  9128. ,
  9129. n.prototype.labelVisibleForFloor = function(e, t) {
  9130. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9131. if (!this.model.showingLabels || !e.labelGui || !i)
  9132. return !1;
  9133. var n = e.floorId === this.model.floors.size() - 1;
  9134. return this.model.allFloorsVisible ? n : e.floorId === t
  9135. }
  9136. ,
  9137. n.prototype.updateLabelVisibility = function(e) {
  9138. this.model.labels.forEach(function(e) {
  9139. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9140. }
  9141. .bind(this))
  9142. }
  9143. ,
  9144. n.prototype.showAllLabels = function(t, i) {
  9145. this.model.labels.forEach(function(e) {
  9146. this.showLabel(e, t, i)
  9147. }
  9148. .bind(this))
  9149. }
  9150. ,
  9151. n.prototype.hideAllLabels = function(t, i) {
  9152. this.model.labels.forEach(function(e) {
  9153. this.hideLabel(e, t, i)
  9154. }
  9155. .bind(this))
  9156. }
  9157. ,
  9158. n.prototype.showLabel = function(e, t, i) {
  9159. this.model.showingLabels && (e.visible || (e.visible = !0,
  9160. e.labelGui.style.display = "block",
  9161. e.labelGui.style.opacity = 0,
  9162. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9163. }
  9164. ,
  9165. n.prototype.hideLabel = function(e, t, i) {
  9166. e.visible && (e.visible = !1,
  9167. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9168. }
  9169. ,
  9170. n.prototype.supportedMode = function() {
  9171. return this.player.mode === h.FLOORPLAN
  9172. }
  9173. ,
  9174. n.prototype.updateLabelDisplay = (new r.Vector3,
  9175. new r.Vector3,
  9176. o = [],
  9177. function() {
  9178. var e = this.player.getLabelScaleFactor()
  9179. , t = 1.2 * (1 - e) + .6
  9180. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9181. this.getLabelsForCurrentFloor(o);
  9182. for (var n = 0; n < o.length; n++) {
  9183. var r = o[n];
  9184. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9185. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9186. }
  9187. }
  9188. ),
  9189. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9190. new r.Vector3,
  9191. function(e, t, i, n, r) {
  9192. t.style.fontSize = 100 * r + "%";
  9193. var o = .5 * $("#player").width()
  9194. , a = .5 * $("#player").height();
  9195. c.copy(i),
  9196. c.project(this.player.camera);
  9197. var s = c.x * o + o
  9198. , l = -c.y * a + a;
  9199. s -= e.offsetWidth / 2,
  9200. l -= e.offsetHeight / 2,
  9201. e.style.left = s + "px",
  9202. e.style.top = l + "px"
  9203. }
  9204. ),
  9205. n.prototype.handleStartInside = function(e) {
  9206. this.updateLabelVisibility()
  9207. }
  9208. ,
  9209. n.prototype.handleStartOutside = function() {
  9210. this.updateLabelVisibility()
  9211. }
  9212. ,
  9213. t.exports = n
  9214. }
  9215. , {
  9216. "../enum/DirectorEvents": 23,
  9217. "../enum/ModelManagerEvents": 33,
  9218. "../enum/PlayerEvents": 40,
  9219. "../enum/Viewmode": 51,
  9220. "../enum/WarpStyle": 52,
  9221. "../settings": 166,
  9222. "../util/browser": 182,
  9223. "../util/common": 185,
  9224. "../util/lerp": 188,
  9225. "../util/transitions": 195,
  9226. three: 217
  9227. }],
  9228. 92: [function(e, t, i) {
  9229. "use strict";
  9230. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9231. if (null == this)
  9232. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9233. if ("function" != typeof e)
  9234. throw new TypeError("predicate must be a function");
  9235. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9236. if (t = i[o],
  9237. e.call(r, t, o, i))
  9238. return o;
  9239. return -1
  9240. }
  9241. ),
  9242. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9243. value: function(e) {
  9244. if (null == this)
  9245. throw new TypeError('"this" is null or not defined');
  9246. var t = Object(this)
  9247. , i = t.length >>> 0;
  9248. if ("function" != typeof e)
  9249. throw new TypeError("predicate must be a function");
  9250. for (var n = arguments[1], r = 0; r < i; ) {
  9251. var o = t[r];
  9252. if (e.call(n, o, r, t))
  9253. return o;
  9254. r++
  9255. }
  9256. }
  9257. })
  9258. }
  9259. , {}],
  9260. 93: [function(e, t, i) {
  9261. "use strict";
  9262. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9263. function te() {
  9264. this.backgroundElement = document.createElement("div"),
  9265. r.extend(this.backgroundElement.style, {
  9266. backgroundColor: "rgba(0,0,0,0.8)",
  9267. top: 0,
  9268. left: 0,
  9269. display: "none",
  9270. zIndex: "1000",
  9271. opacity: 0,
  9272. WebkitTransition: "opacity 0.2s linear"
  9273. }),
  9274. n.makeFullscreen(this.backgroundElement),
  9275. this.backgroundElement.style.position = "fixed",
  9276. this.domElement = document.createElement("div"),
  9277. r.extend(this.domElement.style, {
  9278. position: "fixed",
  9279. display: "none",
  9280. zIndex: "1001",
  9281. opacity: 0,
  9282. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9283. }),
  9284. document.body.appendChild(this.backgroundElement),
  9285. document.body.appendChild(this.domElement);
  9286. var e = this;
  9287. n.bind(this.backgroundElement, "click", function() {
  9288. e.hide()
  9289. })
  9290. }
  9291. function ie(e, t, i) {
  9292. Object.defineProperty(e, t, {
  9293. get: function() {
  9294. return "RGB" === this.__state.space || re(this, t, i),
  9295. this.__state[t]
  9296. },
  9297. set: function(e) {
  9298. "RGB" !== this.__state.space && (re(this, t, i),
  9299. this.__state.space = "RGB"),
  9300. this.__state[t] = e
  9301. }
  9302. })
  9303. }
  9304. function ne(e, t) {
  9305. Object.defineProperty(e, t, {
  9306. get: function() {
  9307. return "HSV" === this.__state.space || oe(this),
  9308. this.__state[t]
  9309. },
  9310. set: function(e) {
  9311. "HSV" !== this.__state.space && (oe(this),
  9312. this.__state.space = "HSV"),
  9313. this.__state[t] = e
  9314. }
  9315. })
  9316. }
  9317. function re(e, t, i) {
  9318. if ("HEX" === e.__state.space)
  9319. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9320. else {
  9321. if ("HSV" !== e.__state.space)
  9322. throw "Corrupted color state";
  9323. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9324. }
  9325. }
  9326. function oe(e) {
  9327. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9328. l.extend(e.__state, {
  9329. s: t.s,
  9330. v: t.v
  9331. }),
  9332. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9333. }
  9334. function ae() {
  9335. if (this.__state = o.apply(this, arguments),
  9336. !1 === this.__state)
  9337. throw "Failed to interpret color arguments";
  9338. this.__state.a = this.__state.a || 1
  9339. }
  9340. function se(e) {
  9341. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9342. }
  9343. function le(e, t) {
  9344. this.initialValue = e[t],
  9345. this.domElement = document.createElement("div"),
  9346. this.object = e,
  9347. this.property = t,
  9348. this.__onChange = void 0,
  9349. this.__onFinishChange = void 0
  9350. }
  9351. (t.exports = ee).gui = ee.gui || {},
  9352. ee.utils = ee.utils || {},
  9353. ee.controllers = ee.controllers || {},
  9354. ee.dom = ee.dom || {},
  9355. ee.color = ee.color || {},
  9356. ee.utils.css = {
  9357. load: function(e, t) {
  9358. var i = (t = t || document).createElement("link");
  9359. i.type = "text/css",
  9360. i.rel = "stylesheet",
  9361. i.href = e,
  9362. t.getElementsByTagName("head")[0].appendChild(i)
  9363. },
  9364. inject: function(e, t) {
  9365. t = t || document;
  9366. var i = document.createElement("style");
  9367. i.type = "text/css",
  9368. i.innerHTML = e,
  9369. t.getElementsByTagName("head")[0].appendChild(i)
  9370. }
  9371. },
  9372. ee.utils.common = (Q = Array.prototype.forEach,
  9373. J = Array.prototype.slice,
  9374. {
  9375. BREAK: {},
  9376. extend: function(i) {
  9377. return this.each(J.call(arguments, 1), function(e) {
  9378. for (var t in e)
  9379. this.isUndefined(e[t]) || (i[t] = e[t])
  9380. }, this),
  9381. i
  9382. },
  9383. defaults: function(i) {
  9384. return this.each(J.call(arguments, 1), function(e) {
  9385. for (var t in e)
  9386. this.isUndefined(i[t]) && (i[t] = e[t])
  9387. }, this),
  9388. i
  9389. },
  9390. compose: function() {
  9391. var i = J.call(arguments);
  9392. return function() {
  9393. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9394. e = [i[t].apply(this, e)];
  9395. return e[0]
  9396. }
  9397. },
  9398. each: function(e, t, i) {
  9399. if (e)
  9400. if (Q && e.forEach && e.forEach === Q)
  9401. e.forEach(t, i);
  9402. else if (e.length === e.length + 0) {
  9403. for (var n = 0, r = e.length; n < r; n++)
  9404. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9405. return
  9406. } else
  9407. for (var n in e)
  9408. if (t.call(i, e[n], n) === this.BREAK)
  9409. return
  9410. },
  9411. defer: function(e) {
  9412. setTimeout(e, 0)
  9413. },
  9414. toArray: function(e) {
  9415. return e.toArray ? e.toArray() : J.call(e)
  9416. },
  9417. isUndefined: function(e) {
  9418. return void 0 === e
  9419. },
  9420. isNull: function(e) {
  9421. return null === e
  9422. },
  9423. isNaN: function(e) {
  9424. return e != e
  9425. },
  9426. isArray: Array.isArray || function(e) {
  9427. return e.constructor === Array
  9428. }
  9429. ,
  9430. isObject: function(e) {
  9431. return e === Object(e)
  9432. },
  9433. isNumber: function(e) {
  9434. return e === e + 0
  9435. },
  9436. isString: function(e) {
  9437. return e === e + ""
  9438. },
  9439. isBoolean: function(e) {
  9440. return !1 === e || !0 === e
  9441. },
  9442. isFunction: function(e) {
  9443. return "[object Function]" === Object.prototype.toString.call(e)
  9444. }
  9445. }),
  9446. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9447. onChange: function(e) {
  9448. return this.__onChange = e,
  9449. this
  9450. },
  9451. onFinishChange: function(e) {
  9452. return this.__onFinishChange = e,
  9453. this
  9454. },
  9455. setValue: function(e) {
  9456. return this.object[this.property] = e,
  9457. this.__onChange && this.__onChange.call(this, e),
  9458. this.updateDisplay(),
  9459. this
  9460. },
  9461. getValue: function() {
  9462. return this.object[this.property]
  9463. },
  9464. updateDisplay: function() {
  9465. return this
  9466. },
  9467. isModified: function() {
  9468. return this.initialValue !== this.getValue()
  9469. }
  9470. }),
  9471. le),
  9472. ee.dom.dom = function(c) {
  9473. function i(e) {
  9474. if ("0" === e || c.isUndefined(e))
  9475. return 0;
  9476. var t = e.match(n);
  9477. return c.isNull(t) ? 0 : parseFloat(t[1])
  9478. }
  9479. var h = {};
  9480. c.each({
  9481. HTMLEvents: ["change"],
  9482. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9483. KeyboardEvents: ["keydown"]
  9484. }, function(e, t) {
  9485. c.each(e, function(e) {
  9486. h[e] = t
  9487. })
  9488. });
  9489. var n = /(\d+(\.\d+)?)px/
  9490. , r = {
  9491. makeSelectable: function(e, t) {
  9492. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9493. return !1
  9494. }
  9495. : function() {}
  9496. ,
  9497. e.style.MozUserSelect = t ? "auto" : "none",
  9498. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9499. e.unselectable = t ? "on" : "off")
  9500. },
  9501. makeFullscreen: function(e, t, i) {
  9502. c.isUndefined(t) && (t = !0),
  9503. c.isUndefined(i) && (i = !0),
  9504. e.style.position = "absolute",
  9505. t && (e.style.left = 0,
  9506. e.style.right = 0),
  9507. i && (e.style.top = 0,
  9508. e.style.bottom = 0)
  9509. },
  9510. fakeEvent: function(e, t, i, n) {
  9511. i = i || {};
  9512. var r = h[t];
  9513. if (!r)
  9514. throw new Error("Event type " + t + " not supported.");
  9515. var o = document.createEvent(r);
  9516. switch (r) {
  9517. case "MouseEvents":
  9518. var a = i.x || i.clientX || 0
  9519. , s = i.y || i.clientY || 0;
  9520. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9521. break;
  9522. case "KeyboardEvents":
  9523. var l = o.initKeyboardEvent || o.initKeyEvent;
  9524. c.defaults(i, {
  9525. cancelable: !0,
  9526. ctrlKey: !1,
  9527. altKey: !1,
  9528. shiftKey: !1,
  9529. metaKey: !1,
  9530. keyCode: void 0,
  9531. charCode: void 0
  9532. }),
  9533. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9534. break;
  9535. default:
  9536. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9537. }
  9538. c.defaults(o, n),
  9539. e.dispatchEvent(o)
  9540. },
  9541. bind: function(e, t, i, n) {
  9542. return n = n || !1,
  9543. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9544. r
  9545. },
  9546. unbind: function(e, t, i, n) {
  9547. return n = n || !1,
  9548. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9549. r
  9550. },
  9551. addClass: function(e, t) {
  9552. if (void 0 === e.className)
  9553. e.className = t;
  9554. else if (e.className !== t) {
  9555. var i = e.className.split(/ +/);
  9556. -1 == i.indexOf(t) && (i.push(t),
  9557. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9558. }
  9559. return r
  9560. },
  9561. removeClass: function(e, t) {
  9562. if (t)
  9563. if (void 0 === e.className)
  9564. ;
  9565. else if (e.className === t)
  9566. e.removeAttribute("class");
  9567. else {
  9568. var i = e.className.split(/ +/)
  9569. , n = i.indexOf(t);
  9570. -1 != n && (i.splice(n, 1),
  9571. e.className = i.join(" "))
  9572. }
  9573. else
  9574. e.className = void 0;
  9575. return r
  9576. },
  9577. hasClass: function(e, t) {
  9578. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9579. },
  9580. getWidth: function(e) {
  9581. var t = getComputedStyle(e);
  9582. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9583. },
  9584. getHeight: function(e) {
  9585. var t = getComputedStyle(e);
  9586. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9587. },
  9588. getOffset: function(e) {
  9589. var t = {
  9590. left: 0,
  9591. top: 0
  9592. };
  9593. if (e.offsetParent)
  9594. for (; t.left += e.offsetLeft,
  9595. t.top += e.offsetTop,
  9596. e = e.offsetParent; )
  9597. ;
  9598. return t
  9599. },
  9600. isActive: function(e) {
  9601. return e === document.activeElement && (e.type || e.href)
  9602. }
  9603. };
  9604. return r
  9605. }(ee.utils.common),
  9606. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9607. X = ee.dom.dom,
  9608. Z = ee.utils.common,
  9609. (K = function(e, t, i) {
  9610. K.superclass.call(this, e, t);
  9611. var n = this;
  9612. if (this.__select = document.createElement("select"),
  9613. Z.isArray(i)) {
  9614. var r = {};
  9615. Z.each(i, function(e) {
  9616. r[e] = e
  9617. }),
  9618. i = r
  9619. }
  9620. Z.each(i, function(e, t) {
  9621. var i = document.createElement("option");
  9622. i.innerHTML = t,
  9623. i.setAttribute("value", e),
  9624. n.__select.appendChild(i)
  9625. }),
  9626. this.updateDisplay(),
  9627. X.bind(this.__select, "change", function() {
  9628. var e = this.options[this.selectedIndex].value;
  9629. n.setValue(e)
  9630. }),
  9631. this.domElement.appendChild(this.__select)
  9632. }
  9633. ).superclass = q,
  9634. Z.extend(K.prototype, q.prototype, {
  9635. setValue: function(e) {
  9636. var t = K.superclass.prototype.setValue.call(this, e);
  9637. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9638. t
  9639. },
  9640. updateDisplay: function() {
  9641. return this.__select.value = this.getValue(),
  9642. K.superclass.prototype.updateDisplay.call(this)
  9643. }
  9644. }),
  9645. K),
  9646. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9647. j = ee.utils.common,
  9648. (Y = function(e, t, i) {
  9649. Y.superclass.call(this, e, t),
  9650. i = i || {},
  9651. this.__min = i.min,
  9652. this.__max = i.max,
  9653. this.__step = i.step,
  9654. j.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9655. this.__precision = se(this.__impliedStep)
  9656. }
  9657. ).superclass = W,
  9658. j.extend(Y.prototype, W.prototype, {
  9659. setValue: function(e) {
  9660. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9661. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9662. Y.superclass.prototype.setValue.call(this, e)
  9663. },
  9664. min: function(e) {
  9665. return this.__min = e,
  9666. this
  9667. },
  9668. max: function(e) {
  9669. return this.__max = e,
  9670. this
  9671. },
  9672. step: function(e) {
  9673. return this.__step = e,
  9674. this.__impliedStep = e,
  9675. this.__precision = se(e),
  9676. this
  9677. }
  9678. }),
  9679. Y),
  9680. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9681. H = ee.dom.dom,
  9682. z = ee.utils.common,
  9683. (G = function(e, t, i) {
  9684. function n() {
  9685. var e = parseFloat(s.__input.value);
  9686. z.isNaN(e) || s.setValue(e)
  9687. }
  9688. function r(e) {
  9689. var t = a - e.clientY;
  9690. s.setValue(s.getValue() + t * s.__impliedStep),
  9691. a = e.clientY
  9692. }
  9693. function o() {
  9694. H.unbind(window, "mousemove", r),
  9695. H.unbind(window, "mouseup", o)
  9696. }
  9697. this.__truncationSuspended = !1,
  9698. G.superclass.call(this, e, t, i);
  9699. var a, s = this;
  9700. this.__input = document.createElement("input"),
  9701. this.__input.setAttribute("type", "text"),
  9702. H.bind(this.__input, "change", n),
  9703. H.bind(this.__input, "blur", function() {
  9704. n(),
  9705. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9706. }),
  9707. H.bind(this.__input, "mousedown", function(e) {
  9708. H.bind(window, "mousemove", r),
  9709. H.bind(window, "mouseup", o),
  9710. a = e.clientY
  9711. }),
  9712. H.bind(this.__input, "keydown", function(e) {
  9713. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9714. this.blur(),
  9715. s.__truncationSuspended = !1)
  9716. }),
  9717. this.updateDisplay(),
  9718. this.domElement.appendChild(this.__input)
  9719. }
  9720. ).superclass = U,
  9721. z.extend(G.prototype, U.prototype, {
  9722. updateDisplay: function() {
  9723. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9724. var i = Math.pow(10, t);
  9725. return Math.round(e * i) / i
  9726. }(this.getValue(), this.__precision),
  9727. G.superclass.prototype.updateDisplay.call(this)
  9728. }
  9729. }),
  9730. G),
  9731. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9732. F = ee.dom.dom,
  9733. B = ee.utils.css,
  9734. V = ee.utils.common,
  9735. (k = function(e, t, i, n, r) {
  9736. function o(e) {
  9737. e.preventDefault();
  9738. var t = F.getOffset(s.__background)
  9739. , i = F.getWidth(s.__background);
  9740. return s.setValue(function(e, t, i, n, r) {
  9741. return n + (e - t) / (i - t) * (r - n)
  9742. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9743. !1
  9744. }
  9745. function a() {
  9746. F.unbind(window, "mousemove", o),
  9747. F.unbind(window, "mouseup", a),
  9748. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9749. }
  9750. k.superclass.call(this, e, t, {
  9751. min: i,
  9752. max: n,
  9753. step: r
  9754. });
  9755. var s = this;
  9756. this.__background = document.createElement("div"),
  9757. this.__foreground = document.createElement("div"),
  9758. F.bind(this.__background, "mousedown", function(e) {
  9759. F.bind(window, "mousemove", o),
  9760. F.bind(window, "mouseup", a),
  9761. o(e)
  9762. }),
  9763. F.addClass(this.__background, "slider"),
  9764. F.addClass(this.__foreground, "slider-fg"),
  9765. this.updateDisplay(),
  9766. this.__background.appendChild(this.__foreground),
  9767. this.domElement.appendChild(this.__background)
  9768. }
  9769. ).superclass = N,
  9770. k.useDefaultStyles = function() {
  9771. B.inject("/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")
  9772. }
  9773. ,
  9774. V.extend(k.prototype, N.prototype, {
  9775. updateDisplay: function() {
  9776. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9777. return this.__foreground.style.width = 100 * e + "%",
  9778. k.superclass.prototype.updateDisplay.call(this)
  9779. }
  9780. }),
  9781. k),
  9782. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9783. O = ee.dom.dom,
  9784. L = ee.utils.common,
  9785. (D = function(e, t, i) {
  9786. D.superclass.call(this, e, t);
  9787. var n = this;
  9788. this.__button = document.createElement("div"),
  9789. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9790. O.bind(this.__button, "click", function(e) {
  9791. return e.preventDefault(),
  9792. n.fire(),
  9793. !1
  9794. }),
  9795. O.addClass(this.__button, "button"),
  9796. this.domElement.appendChild(this.__button)
  9797. }
  9798. ).superclass = P,
  9799. L.extend(D.prototype, P.prototype, {
  9800. fire: function() {
  9801. this.__onChange && this.__onChange.call(this),
  9802. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9803. this.getValue().call(this.object)
  9804. }
  9805. }),
  9806. D),
  9807. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9808. S = ee.dom.dom,
  9809. M = ee.utils.common,
  9810. (R = function(e, t) {
  9811. R.superclass.call(this, e, t);
  9812. var i = this;
  9813. this.__prev = this.getValue(),
  9814. this.__checkbox = document.createElement("input"),
  9815. this.__checkbox.setAttribute("type", "checkbox"),
  9816. S.bind(this.__checkbox, "change", function() {
  9817. i.setValue(!i.__prev)
  9818. }, !1),
  9819. this.domElement.appendChild(this.__checkbox),
  9820. this.updateDisplay()
  9821. }
  9822. ).superclass = x,
  9823. M.extend(R.prototype, x.prototype, {
  9824. setValue: function(e) {
  9825. var t = R.superclass.prototype.setValue.call(this, e);
  9826. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9827. this.__prev = this.getValue(),
  9828. t
  9829. },
  9830. updateDisplay: function() {
  9831. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9832. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9833. R.superclass.prototype.updateDisplay.call(this)
  9834. }
  9835. }),
  9836. R),
  9837. ee.color.toString = (T = ee.utils.common,
  9838. function(e) {
  9839. if (1 == e.a || T.isUndefined(e.a)) {
  9840. for (var t = e.hex.toString(16); t.length < 6; )
  9841. t = "0" + t;
  9842. return "#" + t
  9843. }
  9844. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9845. }
  9846. ),
  9847. ee.color.interpret = (I = ee.color.toString,
  9848. E = ee.utils.common,
  9849. w = [{
  9850. litmus: E.isString,
  9851. conversions: {
  9852. THREE_CHAR_HEX: {
  9853. read: function(e) {
  9854. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9855. return null !== t && {
  9856. space: "HEX",
  9857. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9858. }
  9859. },
  9860. write: I
  9861. },
  9862. SIX_CHAR_HEX: {
  9863. read: function(e) {
  9864. var t = e.match(/^#([A-F0-9]{6})$/i);
  9865. return null !== t && {
  9866. space: "HEX",
  9867. hex: parseInt("0x" + t[1].toString())
  9868. }
  9869. },
  9870. write: I
  9871. },
  9872. CSS_RGB: {
  9873. read: function(e) {
  9874. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9875. return null !== t && {
  9876. space: "RGB",
  9877. r: parseFloat(t[1]),
  9878. g: parseFloat(t[2]),
  9879. b: parseFloat(t[3])
  9880. }
  9881. },
  9882. write: I
  9883. },
  9884. CSS_RGBA: {
  9885. read: function(e) {
  9886. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9887. return null !== t && {
  9888. space: "RGB",
  9889. r: parseFloat(t[1]),
  9890. g: parseFloat(t[2]),
  9891. b: parseFloat(t[3]),
  9892. a: parseFloat(t[4])
  9893. }
  9894. },
  9895. write: I
  9896. }
  9897. }
  9898. }, {
  9899. litmus: E.isNumber,
  9900. conversions: {
  9901. HEX: {
  9902. read: function(e) {
  9903. return {
  9904. space: "HEX",
  9905. hex: e,
  9906. conversionName: "HEX"
  9907. }
  9908. },
  9909. write: function(e) {
  9910. return e.hex
  9911. }
  9912. }
  9913. }
  9914. }, {
  9915. litmus: E.isArray,
  9916. conversions: {
  9917. RGB_ARRAY: {
  9918. read: function(e) {
  9919. return 3 == e.length && {
  9920. space: "RGB",
  9921. r: e[0],
  9922. g: e[1],
  9923. b: e[2]
  9924. }
  9925. },
  9926. write: function(e) {
  9927. return [e.r, e.g, e.b]
  9928. }
  9929. },
  9930. RGBA_ARRAY: {
  9931. read: function(e) {
  9932. return 4 == e.length && {
  9933. space: "RGB",
  9934. r: e[0],
  9935. g: e[1],
  9936. b: e[2],
  9937. a: e[3]
  9938. }
  9939. },
  9940. write: function(e) {
  9941. return [e.r, e.g, e.b, e.a]
  9942. }
  9943. }
  9944. }
  9945. }, {
  9946. litmus: E.isObject,
  9947. conversions: {
  9948. RGBA_OBJ: {
  9949. read: function(e) {
  9950. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9951. space: "RGB",
  9952. r: e.r,
  9953. g: e.g,
  9954. b: e.b,
  9955. a: e.a
  9956. }
  9957. },
  9958. write: function(e) {
  9959. return {
  9960. r: e.r,
  9961. g: e.g,
  9962. b: e.b,
  9963. a: e.a
  9964. }
  9965. }
  9966. },
  9967. RGB_OBJ: {
  9968. read: function(e) {
  9969. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9970. space: "RGB",
  9971. r: e.r,
  9972. g: e.g,
  9973. b: e.b
  9974. }
  9975. },
  9976. write: function(e) {
  9977. return {
  9978. r: e.r,
  9979. g: e.g,
  9980. b: e.b
  9981. }
  9982. }
  9983. },
  9984. HSVA_OBJ: {
  9985. read: function(e) {
  9986. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9987. space: "HSV",
  9988. h: e.h,
  9989. s: e.s,
  9990. v: e.v,
  9991. a: e.a
  9992. }
  9993. },
  9994. write: function(e) {
  9995. return {
  9996. h: e.h,
  9997. s: e.s,
  9998. v: e.v,
  9999. a: e.a
  10000. }
  10001. }
  10002. },
  10003. HSV_OBJ: {
  10004. read: function(e) {
  10005. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10006. space: "HSV",
  10007. h: e.h,
  10008. s: e.s,
  10009. v: e.v
  10010. }
  10011. },
  10012. write: function(e) {
  10013. return {
  10014. h: e.h,
  10015. s: e.s,
  10016. v: e.v
  10017. }
  10018. }
  10019. }
  10020. }
  10021. }],
  10022. function() {
  10023. b = !1;
  10024. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10025. return E.each(w, function(e) {
  10026. if (e.litmus(i))
  10027. return E.each(e.conversions, function(e, t) {
  10028. if (_ = e.read(i),
  10029. !1 === b && !1 !== _)
  10030. return (b = _).conversionName = t,
  10031. _.conversion = e,
  10032. E.BREAK
  10033. }),
  10034. E.BREAK
  10035. }),
  10036. b
  10037. }
  10038. ),
  10039. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10040. function y(e, t, i, n) {
  10041. if (void 0 === t[i])
  10042. throw new Error("Object " + t + ' has no property "' + i + '"');
  10043. var r;
  10044. if (n.color)
  10045. r = new g(t,i);
  10046. else {
  10047. var o = [t, i].concat(n.factoryArgs);
  10048. r = c.apply(e, o)
  10049. }
  10050. n.before instanceof h && (n.before = n.before.__li),
  10051. C(e, r),
  10052. m.addClass(r.domElement, "c");
  10053. var a = document.createElement("span");
  10054. m.addClass(a, "property-name"),
  10055. a.innerHTML = r.property;
  10056. var s = document.createElement("div");
  10057. s.appendChild(a),
  10058. s.appendChild(r.domElement);
  10059. var l = A(e, s, n.before);
  10060. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10061. m.addClass(l, typeof r.getValue()),
  10062. function(t, i, n) {
  10063. if (n.__li = i,
  10064. n.__gui = t,
  10065. v.extend(n, {
  10066. options: function(e) {
  10067. return 1 < arguments.length ? (n.remove(),
  10068. y(t, n.object, n.property, {
  10069. before: n.__li.nextElementSibling,
  10070. factoryArgs: [v.toArray(arguments)]
  10071. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10072. y(t, n.object, n.property, {
  10073. before: n.__li.nextElementSibling,
  10074. factoryArgs: [e]
  10075. })) : void 0
  10076. },
  10077. name: function(e) {
  10078. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10079. n
  10080. },
  10081. listen: function() {
  10082. return n.__gui.listen(n),
  10083. n
  10084. },
  10085. remove: function() {
  10086. return n.__gui.remove(n),
  10087. n
  10088. }
  10089. }),
  10090. n instanceof f) {
  10091. var r = new p(n.object,n.property,{
  10092. min: n.__min,
  10093. max: n.__max,
  10094. step: n.__step
  10095. });
  10096. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10097. var t = n[e]
  10098. , i = r[e];
  10099. n[e] = r[e] = function() {
  10100. var e = Array.prototype.slice.call(arguments);
  10101. return t.apply(n, e),
  10102. i.apply(r, e)
  10103. }
  10104. }),
  10105. m.addClass(i, "has-slider"),
  10106. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10107. } else if (n instanceof p) {
  10108. var e = function(e) {
  10109. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10110. y(t, n.object, n.property, {
  10111. before: n.__li.nextElementSibling,
  10112. factoryArgs: [n.__min, n.__max, n.__step]
  10113. })) : e
  10114. };
  10115. n.min = v.compose(e, n.min),
  10116. n.max = v.compose(e, n.max)
  10117. } else
  10118. n instanceof u ? (m.bind(i, "click", function() {
  10119. m.fakeEvent(n.__checkbox, "click")
  10120. }),
  10121. m.bind(n.__checkbox, "click", function(e) {
  10122. e.stopPropagation()
  10123. })) : n instanceof d ? (m.bind(i, "click", function() {
  10124. m.fakeEvent(n.__button, "click")
  10125. }),
  10126. m.bind(i, "mouseover", function() {
  10127. m.addClass(n.__button, "hover")
  10128. }),
  10129. m.bind(i, "mouseout", function() {
  10130. m.removeClass(n.__button, "hover")
  10131. })) : n instanceof g && (m.addClass(i, "color"),
  10132. n.updateDisplay = v.compose(function(e) {
  10133. return i.style.borderLeftColor = n.__color.toString(),
  10134. e
  10135. }, n.updateDisplay),
  10136. n.updateDisplay());
  10137. n.setValue = v.compose(function(e) {
  10138. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10139. e
  10140. }, n.setValue)
  10141. }(e, l, r),
  10142. e.__controllers.push(r),
  10143. r
  10144. }
  10145. function A(e, t, i) {
  10146. var n = document.createElement("li");
  10147. return t && n.appendChild(t),
  10148. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10149. e.onResize(),
  10150. n
  10151. }
  10152. function C(e, t) {
  10153. var i = e.getRoot()
  10154. , n = i.__rememberedObjects.indexOf(t.object);
  10155. if (-1 != n) {
  10156. var r = i.__rememberedObjectIndecesToControllers[n];
  10157. if (void 0 === r && (r = {},
  10158. i.__rememberedObjectIndecesToControllers[n] = r),
  10159. r[t.property] = t,
  10160. i.load && i.load.remembered) {
  10161. var o, a = i.load.remembered;
  10162. if (a[e.preset])
  10163. o = a[e.preset];
  10164. else {
  10165. if (!a[T])
  10166. return;
  10167. o = a[T]
  10168. }
  10169. if (o[n] && void 0 !== o[n][t.property]) {
  10170. var s = o[n][t.property];
  10171. t.initialValue = s,
  10172. t.setValue(s)
  10173. }
  10174. }
  10175. }
  10176. }
  10177. function I(e, t) {
  10178. return document.location.href + "." + t
  10179. }
  10180. function l(e, t) {
  10181. e.domElement.style.width = t + "px",
  10182. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10183. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10184. }
  10185. function a(r, o) {
  10186. var a = {};
  10187. return v.each(r.__rememberedObjects, function(e, t) {
  10188. var i = {}
  10189. , n = r.__rememberedObjectIndecesToControllers[t];
  10190. v.each(n, function(e, t) {
  10191. i[t] = o ? e.initialValue : e.getValue()
  10192. }),
  10193. a[t] = i
  10194. }),
  10195. a
  10196. }
  10197. function E(e, t, i) {
  10198. var n = document.createElement("option");
  10199. n.innerHTML = t,
  10200. n.value = t,
  10201. e.__preset_select.appendChild(n),
  10202. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10203. }
  10204. function _(e, t) {
  10205. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10206. i.innerHTML = t ? i.value + "*" : i.value
  10207. }
  10208. e.inject(".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n");
  10209. var b, w, T = "Default", x = function() {
  10210. try {
  10211. return "localStorage"in window && null !== window.localStorage
  10212. } catch (e) {
  10213. return !1
  10214. }
  10215. }(), S = !0, s = !1, M = [], R = function(t) {
  10216. var i = this;
  10217. this.domElement = document.createElement("div"),
  10218. this.__ul = document.createElement("ul"),
  10219. this.domElement.appendChild(this.__ul),
  10220. m.addClass(this.domElement, "dg"),
  10221. this.__folders = {},
  10222. this.__controllers = [],
  10223. this.__rememberedObjects = [],
  10224. this.__rememberedObjectIndecesToControllers = [],
  10225. this.__listening = [],
  10226. t = t || {},
  10227. t = v.defaults(t, {
  10228. autoPlace: !0,
  10229. width: R.DEFAULT_WIDTH
  10230. }),
  10231. t = v.defaults(t, {
  10232. resizable: t.autoPlace,
  10233. hideable: t.autoPlace
  10234. }),
  10235. v.isUndefined(t.load) ? t.load = {
  10236. preset: T
  10237. } : t.preset && (t.load.preset = t.preset),
  10238. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10239. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10240. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10241. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10242. if (Object.defineProperties(this, {
  10243. parent: {
  10244. get: function() {
  10245. return t.parent
  10246. }
  10247. },
  10248. scrollable: {
  10249. get: function() {
  10250. return t.scrollable
  10251. }
  10252. },
  10253. autoPlace: {
  10254. get: function() {
  10255. return t.autoPlace
  10256. }
  10257. },
  10258. preset: {
  10259. get: function() {
  10260. return i.parent ? i.getRoot().preset : t.load.preset
  10261. },
  10262. set: function(e) {
  10263. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10264. function(e) {
  10265. for (var t = 0; t < e.__preset_select.length; t++)
  10266. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10267. }(this),
  10268. i.revert()
  10269. }
  10270. },
  10271. width: {
  10272. get: function() {
  10273. return t.width
  10274. },
  10275. set: function(e) {
  10276. t.width = e,
  10277. l(i, e)
  10278. }
  10279. },
  10280. name: {
  10281. get: function() {
  10282. return t.name
  10283. },
  10284. set: function(e) {
  10285. t.name = e,
  10286. a && (a.innerHTML = t.name)
  10287. }
  10288. },
  10289. closed: {
  10290. get: function() {
  10291. return t.closed
  10292. },
  10293. set: function(e) {
  10294. t.closed = e,
  10295. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10296. this.onResize(),
  10297. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10298. }
  10299. },
  10300. load: {
  10301. get: function() {
  10302. return t.load
  10303. }
  10304. },
  10305. useLocalStorage: {
  10306. get: function() {
  10307. return r
  10308. },
  10309. set: function(e) {
  10310. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10311. localStorage.setItem(I(0, "isLocal"), e))
  10312. }
  10313. }
  10314. }),
  10315. v.isUndefined(t.parent)) {
  10316. if (t.closed = !1,
  10317. m.addClass(this.domElement, R.CLASS_MAIN),
  10318. m.makeSelectable(this.domElement, !1),
  10319. x && r) {
  10320. i.useLocalStorage = !0;
  10321. var o = localStorage.getItem(I(0, "gui"));
  10322. o && (t.load = JSON.parse(o))
  10323. }
  10324. this.__closeButton = document.createElement("div"),
  10325. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10326. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10327. this.domElement.appendChild(this.__closeButton),
  10328. m.bind(this.__closeButton, "click", function() {
  10329. i.closed = !i.closed
  10330. })
  10331. } else {
  10332. void 0 === t.closed && (t.closed = !0);
  10333. var a = document.createTextNode(t.name);
  10334. m.addClass(a, "controller-name");
  10335. var s = A(i, a);
  10336. m.addClass(this.__ul, R.CLASS_CLOSED),
  10337. m.addClass(s, "title"),
  10338. m.bind(s, "click", function(e) {
  10339. return e.preventDefault(),
  10340. i.closed = !i.closed,
  10341. !1
  10342. }),
  10343. t.closed || (this.closed = !1)
  10344. }
  10345. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10346. m.addClass(w, "dg"),
  10347. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10348. document.body.appendChild(w),
  10349. S = !1),
  10350. w.appendChild(this.domElement),
  10351. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10352. this.parent || l(i, t.width)),
  10353. m.bind(window, "resize", function() {
  10354. i.onResize()
  10355. }),
  10356. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10357. i.onResize()
  10358. }),
  10359. m.bind(this.__ul, "transitionend", function() {
  10360. i.onResize()
  10361. }),
  10362. m.bind(this.__ul, "oTransitionEnd", function() {
  10363. i.onResize()
  10364. }),
  10365. this.onResize(),
  10366. t.resizable && function(t) {
  10367. function e(e) {
  10368. return e.preventDefault(),
  10369. r = e.clientX,
  10370. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10371. m.bind(window, "mousemove", i),
  10372. m.bind(window, "mouseup", n),
  10373. !1
  10374. }
  10375. function i(e) {
  10376. return e.preventDefault(),
  10377. t.width += r - e.clientX,
  10378. t.onResize(),
  10379. r = e.clientX,
  10380. !1
  10381. }
  10382. function n() {
  10383. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10384. m.unbind(window, "mousemove", i),
  10385. m.unbind(window, "mouseup", n)
  10386. }
  10387. var r;
  10388. t.__resize_handle = document.createElement("div"),
  10389. v.extend(t.__resize_handle.style, {
  10390. width: "6px",
  10391. marginLeft: "-3px",
  10392. height: "200px",
  10393. cursor: "ew-resize",
  10394. position: "absolute"
  10395. }),
  10396. m.bind(t.__resize_handle, "mousedown", e),
  10397. m.bind(t.__closeButton, "mousedown", e),
  10398. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10399. }(this),
  10400. n = function() {
  10401. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10402. }
  10403. ,
  10404. this.saveToLocalStorageIfPossible = n,
  10405. i.getRoot(),
  10406. t.parent || ((e = i.getRoot()).width += 1,
  10407. v.defer(function() {
  10408. e.width -= 1
  10409. }))
  10410. };
  10411. return R.toggleHide = function() {
  10412. s = !s,
  10413. v.each(M, function(e) {
  10414. e.domElement.style.zIndex = s ? -999 : 999,
  10415. e.domElement.style.opacity = s ? 0 : 1
  10416. })
  10417. }
  10418. ,
  10419. R.CLASS_AUTO_PLACE = "a",
  10420. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10421. R.CLASS_MAIN = "main",
  10422. R.CLASS_CONTROLLER_ROW = "cr",
  10423. R.CLASS_TOO_TALL = "taller-than-window",
  10424. R.CLASS_CLOSED = "closed",
  10425. R.CLASS_CLOSE_BUTTON = "close-button",
  10426. R.CLASS_DRAG = "drag",
  10427. R.DEFAULT_WIDTH = 245,
  10428. R.TEXT_CLOSED = "Close Controls",
  10429. R.TEXT_OPEN = "Open Controls",
  10430. m.bind(window, "keydown", function(e) {
  10431. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10432. }, !1),
  10433. v.extend(R.prototype, {
  10434. add: function(e, t) {
  10435. return y(this, e, t, {
  10436. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10437. })
  10438. },
  10439. addColor: function(e, t) {
  10440. return y(this, e, t, {
  10441. color: !0
  10442. })
  10443. },
  10444. remove: function(e) {
  10445. this.__ul.removeChild(e.__li),
  10446. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10447. var t = this;
  10448. v.defer(function() {
  10449. t.onResize()
  10450. })
  10451. },
  10452. destroy: function() {
  10453. this.autoPlace && w.removeChild(this.domElement)
  10454. },
  10455. addFolder: function(e) {
  10456. if (void 0 !== this.__folders[e])
  10457. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10458. var t = {
  10459. name: e,
  10460. parent: this
  10461. };
  10462. t.autoPlace = this.autoPlace,
  10463. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10464. t.load = this.load.folders[e]);
  10465. var i = new R(t);
  10466. this.__folders[e] = i;
  10467. var n = A(this, i.domElement);
  10468. return m.addClass(n, "folder"),
  10469. i
  10470. },
  10471. open: function() {
  10472. this.closed = !1
  10473. },
  10474. close: function() {
  10475. this.closed = !0
  10476. },
  10477. onResize: function() {
  10478. var t = this.getRoot();
  10479. if (t.scrollable) {
  10480. var e = m.getOffset(t.__ul).top
  10481. , i = 0;
  10482. v.each(t.__ul.childNodes, function(e) {
  10483. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10484. }),
  10485. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10486. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10487. t.__ul.style.height = "auto")
  10488. }
  10489. t.__resize_handle && v.defer(function() {
  10490. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10491. }),
  10492. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10493. },
  10494. remember: function() {
  10495. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>'),
  10496. this.parent)
  10497. throw new Error("You can only call remember on a top level GUI.");
  10498. var t = this;
  10499. v.each(Array.prototype.slice.call(arguments), function(e) {
  10500. 0 == t.__rememberedObjects.length && function(i) {
  10501. var e = i.__save_row = document.createElement("li");
  10502. m.addClass(i.domElement, "has-save"),
  10503. i.__ul.insertBefore(e, i.__ul.firstChild),
  10504. m.addClass(e, "save-row");
  10505. var t = document.createElement("span");
  10506. t.innerHTML = "&nbsp;",
  10507. m.addClass(t, "button gears");
  10508. var n = document.createElement("span");
  10509. n.innerHTML = "Save",
  10510. m.addClass(n, "button"),
  10511. m.addClass(n, "save");
  10512. var r = document.createElement("span");
  10513. r.innerHTML = "New",
  10514. m.addClass(r, "button"),
  10515. m.addClass(r, "save-as");
  10516. var o = document.createElement("span");
  10517. o.innerHTML = "Revert",
  10518. m.addClass(o, "button"),
  10519. m.addClass(o, "revert");
  10520. var a = i.__preset_select = document.createElement("select");
  10521. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10522. E(i, t, t == i.preset)
  10523. }) : E(i, T, !1),
  10524. m.bind(a, "change", function() {
  10525. for (var e = 0; e < i.__preset_select.length; e++)
  10526. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10527. i.preset = this.value
  10528. }),
  10529. e.appendChild(a),
  10530. e.appendChild(t),
  10531. e.appendChild(n),
  10532. e.appendChild(r),
  10533. e.appendChild(o),
  10534. x) {
  10535. var s = document.getElementById("dg-save-locally")
  10536. , l = document.getElementById("dg-local-explain");
  10537. s.style.display = "block";
  10538. var c = document.getElementById("dg-local-storage");
  10539. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10540. var h = function() {
  10541. l.style.display = i.useLocalStorage ? "block" : "none"
  10542. };
  10543. h(),
  10544. m.bind(c, "change", function() {
  10545. i.useLocalStorage = !i.useLocalStorage,
  10546. h()
  10547. })
  10548. }
  10549. var u = document.getElementById("dg-new-constructor");
  10550. m.bind(u, "keydown", function(e) {
  10551. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10552. }),
  10553. m.bind(t, "click", function() {
  10554. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10555. b.show(),
  10556. u.focus(),
  10557. u.select()
  10558. }),
  10559. m.bind(n, "click", function() {
  10560. i.save()
  10561. }),
  10562. m.bind(r, "click", function() {
  10563. var e = prompt("Enter a new preset name.");
  10564. e && i.saveAs(e)
  10565. }),
  10566. m.bind(o, "click", function() {
  10567. i.revert()
  10568. })
  10569. }(t),
  10570. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10571. }),
  10572. this.autoPlace && l(this, this.width)
  10573. },
  10574. getRoot: function() {
  10575. for (var e = this; e.parent; )
  10576. e = e.parent;
  10577. return e
  10578. },
  10579. getSaveObject: function() {
  10580. var i = this.load;
  10581. return i.closed = this.closed,
  10582. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10583. i.remembered || (i.remembered = {}),
  10584. i.remembered[this.preset] = a(this)),
  10585. i.folders = {},
  10586. v.each(this.__folders, function(e, t) {
  10587. i.folders[t] = e.getSaveObject()
  10588. }),
  10589. i
  10590. },
  10591. save: function() {
  10592. this.load.remembered || (this.load.remembered = {}),
  10593. this.load.remembered[this.preset] = a(this),
  10594. _(this, !1),
  10595. this.saveToLocalStorageIfPossible()
  10596. },
  10597. saveAs: function(e) {
  10598. this.load.remembered || (this.load.remembered = {},
  10599. this.load.remembered[T] = a(this, !0)),
  10600. this.load.remembered[e] = a(this),
  10601. this.preset = e,
  10602. E(this, e, !0),
  10603. this.saveToLocalStorageIfPossible()
  10604. },
  10605. revert: function(t) {
  10606. v.each(this.__controllers, function(e) {
  10607. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10608. }, this),
  10609. v.each(this.__folders, function(e) {
  10610. e.revert(e)
  10611. }),
  10612. t || _(this.getRoot(), !1)
  10613. },
  10614. listen: function(e) {
  10615. var t = 0 == this.__listening.length;
  10616. this.__listening.push(e),
  10617. t && function e(t) {
  10618. 0 != t.length && r(function() {
  10619. e(t)
  10620. }),
  10621. v.each(t, function(e) {
  10622. e.updateDisplay()
  10623. })
  10624. }(this.__listening)
  10625. }
  10626. }),
  10627. R
  10628. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10629. u = ee.controllers.NumberControllerBox,
  10630. d = ee.controllers.NumberControllerSlider,
  10631. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10632. y = ee.dom.dom,
  10633. A = ee.utils.common,
  10634. (C = function(e, t) {
  10635. function i() {
  10636. n.setValue(n.__input.value)
  10637. }
  10638. C.superclass.call(this, e, t);
  10639. var n = this;
  10640. this.__input = document.createElement("input"),
  10641. this.__input.setAttribute("type", "text"),
  10642. y.bind(this.__input, "keyup", i),
  10643. y.bind(this.__input, "change", i),
  10644. y.bind(this.__input, "blur", function() {
  10645. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10646. }),
  10647. y.bind(this.__input, "keydown", function(e) {
  10648. 13 === e.keyCode && this.blur()
  10649. }),
  10650. this.updateDisplay(),
  10651. this.domElement.appendChild(this.__input)
  10652. }
  10653. ).superclass = v,
  10654. A.extend(C.prototype, v.prototype, {
  10655. updateDisplay: function() {
  10656. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10657. C.superclass.prototype.updateDisplay.call(this)
  10658. }
  10659. }),
  10660. C),
  10661. f = ee.controllers.FunctionController,
  10662. g = ee.controllers.BooleanController,
  10663. m = ee.utils.common,
  10664. function(e, t) {
  10665. var i = e[t];
  10666. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10667. min: arguments[2],
  10668. max: arguments[3]
  10669. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10670. }
  10671. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10672. function f(t, i, n, r) {
  10673. t.style.background = "",
  10674. p.each(o, function(e) {
  10675. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10676. })
  10677. }
  10678. var g = function(e, t) {
  10679. function i(e) {
  10680. a(e),
  10681. h.bind(window, "mousemove", a),
  10682. h.bind(window, "mouseup", n)
  10683. }
  10684. function n() {
  10685. h.unbind(window, "mousemove", a),
  10686. h.unbind(window, "mouseup", n)
  10687. }
  10688. function r() {
  10689. var e = d(this.value);
  10690. !1 !== e ? (l.__color.__state = e,
  10691. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10692. }
  10693. function o() {
  10694. h.unbind(window, "mousemove", s),
  10695. h.unbind(window, "mouseup", o)
  10696. }
  10697. function a(e) {
  10698. e.preventDefault();
  10699. var t = h.getWidth(l.__saturation_field)
  10700. , i = h.getOffset(l.__saturation_field)
  10701. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10702. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10703. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10704. 1 < n ? n = 1 : n < 0 && (n = 0),
  10705. l.__color.v = r,
  10706. l.__color.s = n,
  10707. l.setValue(l.__color.toOriginal()),
  10708. !1
  10709. }
  10710. function s(e) {
  10711. e.preventDefault();
  10712. var t = h.getHeight(l.__hue_field)
  10713. , i = h.getOffset(l.__hue_field)
  10714. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10715. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10716. l.__color.h = 360 * n,
  10717. l.setValue(l.__color.toOriginal()),
  10718. !1
  10719. }
  10720. g.superclass.call(this, e, t),
  10721. this.__color = new u(this.getValue()),
  10722. this.__temp = new u(0);
  10723. var l = this;
  10724. this.domElement = document.createElement("div"),
  10725. h.makeSelectable(this.domElement, !1),
  10726. this.__selector = document.createElement("div"),
  10727. this.__selector.className = "selector",
  10728. this.__saturation_field = document.createElement("div"),
  10729. this.__saturation_field.className = "saturation-field",
  10730. this.__field_knob = document.createElement("div"),
  10731. this.__field_knob.className = "field-knob",
  10732. this.__field_knob_border = "2px solid ",
  10733. this.__hue_knob = document.createElement("div"),
  10734. this.__hue_knob.className = "hue-knob",
  10735. this.__hue_field = document.createElement("div"),
  10736. this.__hue_field.className = "hue-field",
  10737. this.__input = document.createElement("input"),
  10738. this.__input.type = "text",
  10739. this.__input_textShadow = "0 1px 1px ",
  10740. h.bind(this.__input, "keydown", function(e) {
  10741. 13 === e.keyCode && r.call(this)
  10742. }),
  10743. h.bind(this.__input, "blur", r),
  10744. h.bind(this.__selector, "mousedown", function(e) {
  10745. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10746. h.removeClass(l.__selector, "drag")
  10747. })
  10748. });
  10749. var c = document.createElement("div");
  10750. p.extend(this.__selector.style, {
  10751. width: "122px",
  10752. height: "102px",
  10753. padding: "3px",
  10754. backgroundColor: "#222",
  10755. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10756. }),
  10757. p.extend(this.__field_knob.style, {
  10758. position: "absolute",
  10759. width: "12px",
  10760. height: "12px",
  10761. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10762. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10763. borderRadius: "12px",
  10764. zIndex: 1
  10765. }),
  10766. p.extend(this.__hue_knob.style, {
  10767. position: "absolute",
  10768. width: "15px",
  10769. height: "2px",
  10770. borderRight: "4px solid #fff",
  10771. zIndex: 1
  10772. }),
  10773. p.extend(this.__saturation_field.style, {
  10774. width: "100px",
  10775. height: "100px",
  10776. border: "1px solid #555",
  10777. marginRight: "3px",
  10778. display: "inline-block",
  10779. cursor: "pointer"
  10780. }),
  10781. p.extend(c.style, {
  10782. width: "100%",
  10783. height: "100%",
  10784. background: "none"
  10785. }),
  10786. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10787. p.extend(this.__hue_field.style, {
  10788. width: "15px",
  10789. height: "100px",
  10790. display: "inline-block",
  10791. border: "1px solid #555",
  10792. cursor: "ns-resize"
  10793. }),
  10794. function(e) {
  10795. e.style.background = "",
  10796. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10797. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10798. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10799. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10800. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10801. }(this.__hue_field),
  10802. p.extend(this.__input.style, {
  10803. outline: "none",
  10804. textAlign: "center",
  10805. color: "#fff",
  10806. border: 0,
  10807. fontWeight: "bold",
  10808. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10809. }),
  10810. h.bind(this.__saturation_field, "mousedown", i),
  10811. h.bind(this.__field_knob, "mousedown", i),
  10812. h.bind(this.__hue_field, "mousedown", function(e) {
  10813. s(e),
  10814. h.bind(window, "mousemove", s),
  10815. h.bind(window, "mouseup", o)
  10816. }),
  10817. this.__saturation_field.appendChild(c),
  10818. this.__selector.appendChild(this.__field_knob),
  10819. this.__selector.appendChild(this.__saturation_field),
  10820. this.__selector.appendChild(this.__hue_field),
  10821. this.__hue_field.appendChild(this.__hue_knob),
  10822. this.domElement.appendChild(this.__input),
  10823. this.domElement.appendChild(this.__selector),
  10824. this.updateDisplay()
  10825. };
  10826. g.superclass = e,
  10827. p.extend(g.prototype, e.prototype, {
  10828. updateDisplay: function() {
  10829. var t = d(this.getValue());
  10830. if (!1 !== t) {
  10831. var i = !1;
  10832. p.each(u.COMPONENTS, function(e) {
  10833. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10834. return i = !0,
  10835. {}
  10836. }, this),
  10837. i && p.extend(this.__color.__state, t)
  10838. }
  10839. p.extend(this.__temp.__state, this.__color.__state),
  10840. this.__temp.a = 1;
  10841. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10842. , n = 255 - e;
  10843. p.extend(this.__field_knob.style, {
  10844. marginLeft: 100 * this.__color.s - 7 + "px",
  10845. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10846. backgroundColor: this.__temp.toString(),
  10847. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10848. }),
  10849. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10850. this.__temp.s = 1,
  10851. this.__temp.v = 1,
  10852. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10853. p.extend(this.__input.style, {
  10854. backgroundColor: this.__input.value = this.__color.toString(),
  10855. color: "rgb(" + e + "," + e + "," + e + ")",
  10856. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10857. })
  10858. }
  10859. });
  10860. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10861. return g
  10862. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10863. a = ee.color.math = {
  10864. hsv_to_rgb: function(e, t, i) {
  10865. var n = Math.floor(e / 60) % 6
  10866. , r = e / 60 - Math.floor(e / 60)
  10867. , o = i * (1 - t)
  10868. , a = i * (1 - r * t)
  10869. , s = i * (1 - (1 - r) * t)
  10870. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10871. return {
  10872. r: 255 * l[0],
  10873. g: 255 * l[1],
  10874. b: 255 * l[2]
  10875. }
  10876. },
  10877. rgb_to_hsv: function(e, t, i) {
  10878. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10879. return 0 == o ? {
  10880. h: NaN,
  10881. s: 0,
  10882. v: 0
  10883. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10884. (n /= 6) < 0 && (n += 1),
  10885. {
  10886. h: 360 * n,
  10887. s: a / o,
  10888. v: o / 255
  10889. })
  10890. },
  10891. rgb_to_hex: function(e, t, i) {
  10892. var n = this.hex_with_component(0, 2, e);
  10893. return n = this.hex_with_component(n, 1, t),
  10894. this.hex_with_component(n, 0, i)
  10895. },
  10896. component_from_hex: function(e, t) {
  10897. return e >> 8 * t & 255
  10898. },
  10899. hex_with_component: function(e, t, i) {
  10900. return i << (c = 8 * t) | e & ~(255 << c)
  10901. }
  10902. },
  10903. s = ee.color.toString,
  10904. l = ee.utils.common,
  10905. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10906. l.extend(ae.prototype, {
  10907. toString: function() {
  10908. return s(this)
  10909. },
  10910. toOriginal: function() {
  10911. return this.__state.conversion.write(this)
  10912. }
  10913. }),
  10914. ie(ae.prototype, "r", 2),
  10915. ie(ae.prototype, "g", 1),
  10916. ie(ae.prototype, "b", 0),
  10917. ne(ae.prototype, "h"),
  10918. ne(ae.prototype, "s"),
  10919. ne(ae.prototype, "v"),
  10920. Object.defineProperty(ae.prototype, "a", {
  10921. get: function() {
  10922. return this.__state.a
  10923. },
  10924. set: function(e) {
  10925. this.__state.a = e
  10926. }
  10927. }),
  10928. Object.defineProperty(ae.prototype, "hex", {
  10929. get: function() {
  10930. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10931. this.__state.hex
  10932. },
  10933. set: function(e) {
  10934. this.__state.space = "HEX",
  10935. this.__state.hex = e
  10936. }
  10937. }),
  10938. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10939. window.setTimeout(e, 1e3 / 60)
  10940. }
  10941. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10942. r = ee.utils.common,
  10943. te.prototype.show = function() {
  10944. var e = this;
  10945. this.backgroundElement.style.display = "block",
  10946. this.domElement.style.display = "block",
  10947. this.domElement.style.opacity = 0,
  10948. this.domElement.style.webkitTransform = "scale(1.1)",
  10949. this.layout(),
  10950. r.defer(function() {
  10951. e.backgroundElement.style.opacity = 1,
  10952. e.domElement.style.opacity = 1,
  10953. e.domElement.style.webkitTransform = "scale(1)"
  10954. })
  10955. }
  10956. ,
  10957. te.prototype.hide = function() {
  10958. var e = this
  10959. , t = function() {
  10960. e.domElement.style.display = "none",
  10961. e.backgroundElement.style.display = "none",
  10962. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10963. n.unbind(e.domElement, "transitionend", t),
  10964. n.unbind(e.domElement, "oTransitionEnd", t)
  10965. };
  10966. n.bind(this.domElement, "webkitTransitionEnd", t),
  10967. n.bind(this.domElement, "transitionend", t),
  10968. n.bind(this.domElement, "oTransitionEnd", t),
  10969. this.backgroundElement.style.opacity = 0,
  10970. this.domElement.style.opacity = 0,
  10971. this.domElement.style.webkitTransform = "scale(1.1)"
  10972. }
  10973. ,
  10974. te.prototype.layout = function() {
  10975. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10976. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10977. }
  10978. ,
  10979. te), ee.dom.dom, ee.utils.common)
  10980. }
  10981. , {}],
  10982. 94: [function(e, t, i) {
  10983. (function(J) {
  10984. "use strict";
  10985. function i(e) {
  10986. function t(e, t) {
  10987. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10988. for (var a = 1; a <= e[o]; a++)
  10989. r[t[n]] = [],
  10990. r[t[n]][0] = i,
  10991. r[t[n]][1] = o,
  10992. n++,
  10993. i++;
  10994. i *= 2
  10995. }
  10996. return r
  10997. }
  10998. function _(e) {
  10999. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11000. t & 1 << i && (B |= 1 << V),
  11001. i--,
  11002. --V < 0 && (255 == B ? (b(255),
  11003. b(0)) : b(B),
  11004. V = 7,
  11005. B = 0)
  11006. }
  11007. function b(e) {
  11008. F.push(e)
  11009. }
  11010. function w(e) {
  11011. b(e >> 8 & 255),
  11012. b(255 & e)
  11013. }
  11014. function T(e, t, i, n, r) {
  11015. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11016. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11017. for (h = 0; h < 8; ++h) {
  11018. i = e[d],
  11019. n = e[d + 1],
  11020. r = e[d + 2],
  11021. o = e[d + 3],
  11022. a = e[d + 4],
  11023. s = e[d + 5],
  11024. l = e[d + 6];
  11025. var p = i + (c = e[d + 7])
  11026. , f = i - c
  11027. , g = n + l
  11028. , m = n - l
  11029. , v = r + s
  11030. , y = r - s
  11031. , A = o + a
  11032. , C = o - a
  11033. , I = p + A
  11034. , E = p - A
  11035. , _ = g + v
  11036. , b = g - v;
  11037. e[d] = I + _,
  11038. e[d + 4] = I - _;
  11039. var w = .707106781 * (b + E);
  11040. e[d + 2] = E + w,
  11041. e[d + 6] = E - w;
  11042. var T = .382683433 * ((I = C + y) - (b = m + f))
  11043. , x = .5411961 * I + T
  11044. , S = 1.306562965 * b + T
  11045. , M = .707106781 * (_ = y + m)
  11046. , R = f + M
  11047. , P = f - M;
  11048. e[d + 5] = P + x,
  11049. e[d + 3] = P - x,
  11050. e[d + 1] = R + S,
  11051. e[d + 7] = R - S,
  11052. d += 8
  11053. }
  11054. for (h = d = 0; h < 8; ++h) {
  11055. i = e[d],
  11056. n = e[d + 8],
  11057. r = e[d + 16],
  11058. o = e[d + 24],
  11059. a = e[d + 32],
  11060. s = e[d + 40],
  11061. l = e[d + 48];
  11062. var O = i + (c = e[d + 56])
  11063. , L = i - c
  11064. , D = n + l
  11065. , N = n - l
  11066. , F = r + s
  11067. , B = r - s
  11068. , V = o + a
  11069. , k = o - a
  11070. , U = O + V
  11071. , H = O - V
  11072. , z = D + F
  11073. , G = D - F;
  11074. e[d] = U + z,
  11075. e[d + 32] = U - z;
  11076. var W = .707106781 * (G + H);
  11077. e[d + 16] = H + W,
  11078. e[d + 48] = H - W;
  11079. var j = .382683433 * ((U = k + B) - (G = N + L))
  11080. , Y = .5411961 * U + j
  11081. , q = 1.306562965 * G + j
  11082. , X = .707106781 * (z = B + N)
  11083. , Z = L + X
  11084. , K = L - X;
  11085. e[d + 40] = K + Y,
  11086. e[d + 24] = K - Y,
  11087. e[d + 8] = Z + q,
  11088. e[d + 56] = Z - q,
  11089. d++
  11090. }
  11091. for (h = 0; h < 64; ++h)
  11092. u = e[h] * t[h],
  11093. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11094. return Q
  11095. }(e, t), c = 0; c < 64; ++c)
  11096. A[C[c]] = l[c];
  11097. var h = A[0] - i;
  11098. i = A[0],
  11099. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11100. _(v[o]));
  11101. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11102. ;
  11103. if (0 == u)
  11104. return _(a),
  11105. i;
  11106. for (var d, p = 1; p <= u; ) {
  11107. for (var f = p; 0 == A[p] && p <= u; ++p)
  11108. ;
  11109. var g = p - f;
  11110. if (16 <= g) {
  11111. d = g >> 4;
  11112. for (var m = 1; m <= d; ++m)
  11113. _(s);
  11114. g &= 15
  11115. }
  11116. o = 32767 + A[p],
  11117. _(r[(g << 4) + y[o]]),
  11118. _(v[o]),
  11119. p++
  11120. }
  11121. return 63 != u && _(a),
  11122. i
  11123. }
  11124. function x(e) {
  11125. if (e <= 0 && (e = 1),
  11126. 100 < e && (e = 100),
  11127. i != e) {
  11128. (function(e) {
  11129. 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++) {
  11130. var n = u((t[i] * e + 50) / 100);
  11131. n < 1 ? n = 1 : 255 < n && (n = 255),
  11132. O[C[i]] = n
  11133. }
  11134. 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++) {
  11135. var a = u((r[o] * e + 50) / 100);
  11136. a < 1 ? a = 1 : 255 < a && (a = 255),
  11137. L[C[o]] = a
  11138. }
  11139. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11140. for (var h = 0; h < 8; h++)
  11141. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11142. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11143. l++
  11144. }
  11145. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11146. i = e
  11147. }
  11148. }
  11149. var S, M, R, P, i, u = (Math.round,
  11150. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11151. this.encode = function(e, t) {
  11152. var i = ((new Date).getTime(),
  11153. t.quality);
  11154. i && x(i),
  11155. F = new Array,
  11156. B = 0,
  11157. V = 7,
  11158. w(65496),
  11159. w(65504),
  11160. w(16),
  11161. b(74),
  11162. b(70),
  11163. b(73),
  11164. b(70),
  11165. b(0),
  11166. b(1),
  11167. b(1),
  11168. b(0),
  11169. w(1),
  11170. w(1),
  11171. b(0),
  11172. b(0),
  11173. function() {
  11174. w(65499),
  11175. w(132),
  11176. b(0);
  11177. for (var e = 0; e < 64; e++)
  11178. b(O[e]);
  11179. b(1);
  11180. for (var t = 0; t < 64; t++)
  11181. b(L[t])
  11182. }(),
  11183. function(e, t) {
  11184. w(65472),
  11185. w(17),
  11186. b(8),
  11187. w(t),
  11188. w(e),
  11189. b(3),
  11190. b(1),
  11191. b(17),
  11192. b(0),
  11193. b(2),
  11194. b(17),
  11195. b(1),
  11196. b(3),
  11197. b(17),
  11198. b(1)
  11199. }(e.width, e.height),
  11200. function() {
  11201. w(65476),
  11202. w(418),
  11203. b(0);
  11204. for (var e = 0; e < 16; e++)
  11205. b(G[e + 1]);
  11206. for (var t = 0; t <= 11; t++)
  11207. b(W[t]);
  11208. b(16);
  11209. for (var i = 0; i < 16; i++)
  11210. b(j[i + 1]);
  11211. for (var n = 0; n <= 161; n++)
  11212. b(Y[n]);
  11213. b(1);
  11214. for (var r = 0; r < 16; r++)
  11215. b(q[r + 1]);
  11216. for (var o = 0; o <= 11; o++)
  11217. b(X[o]);
  11218. b(17);
  11219. for (var a = 0; a < 16; a++)
  11220. b(Z[a + 1]);
  11221. for (var s = 0; s <= 161; s++)
  11222. b(K[s])
  11223. }(),
  11224. w(65498),
  11225. w(12),
  11226. b(3),
  11227. b(1),
  11228. b(0),
  11229. b(2),
  11230. b(17),
  11231. b(3),
  11232. b(17),
  11233. b(0),
  11234. b(63),
  11235. b(0);
  11236. var n = 0
  11237. , r = 0
  11238. , o = 0;
  11239. B = 0,
  11240. V = 7,
  11241. this.encode.displayName = "_encode_";
  11242. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11243. for (a = 0; a < A; ) {
  11244. for (u = h = A * C + a,
  11245. d = -1,
  11246. f = p = 0; f < 64; f++)
  11247. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11248. v <= C + p && (u -= A * (C + 1 + p - v)),
  11249. A <= a + d && (u -= a + d - A + 4),
  11250. s = g[u++],
  11251. l = g[u++],
  11252. c = g[u++],
  11253. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11254. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11255. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11256. n = T(k, D, n, S, R),
  11257. r = T(U, N, r, M, P),
  11258. o = T(H, N, o, M, P),
  11259. a += 32
  11260. }
  11261. C += I
  11262. }
  11263. if (0 <= V) {
  11264. var E = [];
  11265. E[1] = V + 1,
  11266. E[0] = (1 << V + 1) - 1,
  11267. _(E)
  11268. }
  11269. return w(65497),
  11270. new J(F)
  11271. }
  11272. ,
  11273. (new Date).getTime(),
  11274. e = e || 50,
  11275. function() {
  11276. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11277. n[t] = e(t)
  11278. }(),
  11279. S = t(G, W),
  11280. M = t(q, X),
  11281. R = t(j, Y),
  11282. P = t(Z, K),
  11283. function() {
  11284. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11285. for (var n = e; n < t; n++)
  11286. y[32767 + n] = i,
  11287. v[32767 + n] = [],
  11288. v[32767 + n][1] = i,
  11289. v[32767 + n][0] = n;
  11290. for (var r = -(t - 1); r <= -e; r++)
  11291. y[32767 + r] = i,
  11292. v[32767 + r] = [],
  11293. v[32767 + r][1] = i,
  11294. v[32767 + r][0] = t - 1 + r;
  11295. e <<= 1,
  11296. t <<= 1
  11297. }
  11298. }(),
  11299. function() {
  11300. for (var e = 0; e < 256; e++)
  11301. z[e] = 19595 * e,
  11302. z[e + 256 >> 0] = 38470 * e,
  11303. z[e + 512 >> 0] = 7471 * e + 32768,
  11304. z[e + 768 >> 0] = -11059 * e,
  11305. z[e + 1024 >> 0] = -21709 * e,
  11306. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11307. z[e + 1536 >> 0] = -27439 * e,
  11308. z[e + 1792 >> 0] = -5329 * e
  11309. }(),
  11310. x(e),
  11311. (new Date).getTime()
  11312. }
  11313. t.exports.encode = function(e, t) {
  11314. return (t = t || {}).quality = t.quality || 50,
  11315. {
  11316. data: new i(t.quality).encode(e, t),
  11317. width: e.width,
  11318. height: e.height
  11319. }
  11320. }
  11321. }
  11322. ).call(this, e("buffer").Buffer)
  11323. }
  11324. , {
  11325. buffer: 198
  11326. }],
  11327. 95: [function(e, t, i) {
  11328. "use strict";
  11329. !function() {
  11330. if ("performance"in window == 0 && (window.performance = {}),
  11331. Date.now = Date.now || function() {
  11332. return (new Date).getTime()
  11333. }
  11334. ,
  11335. "now"in window.performance == 0) {
  11336. var e = Date.now();
  11337. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11338. window.performance.now = function() {
  11339. return Date.now() - e
  11340. }
  11341. }
  11342. }()
  11343. }
  11344. , {}],
  11345. 96: [function(e, t, i) {
  11346. "use strict";
  11347. var a = e("three");
  11348. a.EffectComposer = function(e, t) {
  11349. if (this.renderer = e,
  11350. void 0 === t) {
  11351. var i = {
  11352. minFilter: a.LinearFilter,
  11353. magFilter: a.LinearFilter,
  11354. format: a.RGBAFormat,
  11355. stencilBuffer: !1
  11356. }
  11357. , n = e.getSize();
  11358. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11359. }
  11360. this.renderTarget1 = t,
  11361. this.renderTarget2 = t.clone(),
  11362. this.writeBuffer = this.renderTarget1,
  11363. this.readBuffer = this.renderTarget2,
  11364. this.passes = [],
  11365. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11366. this.copyPass = new a.ShaderPass(a.CopyShader)
  11367. }
  11368. ,
  11369. a.EffectComposer.prototype = {
  11370. swapBuffers: function() {
  11371. var e = this.readBuffer;
  11372. this.readBuffer = this.writeBuffer,
  11373. this.writeBuffer = e
  11374. },
  11375. addPass: function(e) {
  11376. this.passes.push(e)
  11377. },
  11378. insertPass: function(e, t) {
  11379. this.passes.splice(t, 0, e)
  11380. },
  11381. render: function(e) {
  11382. this.writeBuffer = this.renderTarget1,
  11383. this.readBuffer = this.renderTarget2;
  11384. var t, i, n = !1, r = this.passes.length;
  11385. for (i = 0; i < r; i++)
  11386. if ((t = this.passes[i]).enabled) {
  11387. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11388. t.needsSwap) {
  11389. if (n) {
  11390. var o = this.renderer.context;
  11391. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11392. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11393. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11394. }
  11395. this.swapBuffers()
  11396. }
  11397. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11398. }
  11399. },
  11400. reset: function(e) {
  11401. if (void 0 === e) {
  11402. var t = this.renderer.getSize();
  11403. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11404. }
  11405. this.renderTarget1.dispose(),
  11406. this.renderTarget2.dispose(),
  11407. this.renderTarget1 = e,
  11408. this.renderTarget2 = e.clone(),
  11409. this.writeBuffer = this.renderTarget1,
  11410. this.readBuffer = this.renderTarget2
  11411. },
  11412. setSize: function(e, t) {
  11413. this.renderTarget1.setSize(e, t),
  11414. this.renderTarget2.setSize(e, t)
  11415. }
  11416. }
  11417. }
  11418. , {
  11419. three: 217
  11420. }],
  11421. 97: [function(e, t, i) {
  11422. "use strict";
  11423. var n = e("three");
  11424. n.MaskPass = function(e, t) {
  11425. this.scene = e,
  11426. this.camera = t,
  11427. this.enabled = !0,
  11428. this.clear = !0,
  11429. this.needsSwap = !1,
  11430. this.inverse = !1
  11431. }
  11432. ,
  11433. n.MaskPass.prototype = {
  11434. render: function(e, t, i, n) {
  11435. var r, o, a = e.context;
  11436. a.colorMask(!1, !1, !1, !1),
  11437. a.depthMask(!1),
  11438. o = this.inverse ? (r = 0,
  11439. 1) : (r = 1,
  11440. 0),
  11441. a.enable(a.STENCIL_TEST),
  11442. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11443. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11444. a.clearStencil(o),
  11445. e.render(this.scene, this.camera, i, this.clear),
  11446. e.render(this.scene, this.camera, t, this.clear),
  11447. a.colorMask(!0, !0, !0, !0),
  11448. a.depthMask(!0),
  11449. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11450. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11451. }
  11452. },
  11453. n.ClearMaskPass = function() {
  11454. this.enabled = !0
  11455. }
  11456. ,
  11457. n.ClearMaskPass.prototype = {
  11458. render: function(e, t, i, n) {
  11459. var r = e.context;
  11460. r.disable(r.STENCIL_TEST)
  11461. }
  11462. }
  11463. }
  11464. , {
  11465. three: 217
  11466. }],
  11467. 98: [function(e, t, i) {
  11468. "use strict";
  11469. var o = e("three");
  11470. o.RenderPass = function(e, t, i, n, r) {
  11471. this.scene = e,
  11472. this.camera = t,
  11473. this.overrideMaterial = i,
  11474. this.clearColor = n,
  11475. this.clearAlpha = void 0 !== r ? r : 1,
  11476. this.oldClearColor = new o.Color,
  11477. this.oldClearAlpha = 1,
  11478. this.enabled = !0,
  11479. this.clear = !0,
  11480. this.needsSwap = !1
  11481. }
  11482. ,
  11483. o.RenderPass.prototype = {
  11484. render: function(e, t, i, n) {
  11485. this.scene.overrideMaterial = this.overrideMaterial,
  11486. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11487. this.oldClearAlpha = e.getClearAlpha(),
  11488. e.setClearColor(this.clearColor, this.clearAlpha)),
  11489. e.render(this.scene, this.camera, i, this.clear),
  11490. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11491. this.scene.overrideMaterial = null
  11492. }
  11493. }
  11494. }
  11495. , {
  11496. three: 217
  11497. }],
  11498. 99: [function(e, t, i) {
  11499. "use strict";
  11500. var n = e("three");
  11501. n.ShaderPass = function(e, t) {
  11502. this.textureID = void 0 !== t ? t : "tDiffuse",
  11503. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11504. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11505. this.material = new n.ShaderMaterial({
  11506. defines: e.defines || {},
  11507. uniforms: this.uniforms,
  11508. vertexShader: e.vertexShader,
  11509. fragmentShader: e.fragmentShader
  11510. })),
  11511. this.renderToScreen = !1,
  11512. this.enabled = !0,
  11513. this.needsSwap = !0,
  11514. this.clear = !1,
  11515. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11516. this.scene = new n.Scene,
  11517. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11518. this.scene.add(this.quad)
  11519. }
  11520. ,
  11521. n.ShaderPass.prototype = {
  11522. render: function(e, t, i, n) {
  11523. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11524. this.quad.material = this.material,
  11525. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11526. }
  11527. }
  11528. }
  11529. , {
  11530. three: 217
  11531. }],
  11532. 100: [function(e, t, i) {
  11533. "use strict";
  11534. e("three").CopyShader = {
  11535. uniforms: {
  11536. tDiffuse: {
  11537. type: "t",
  11538. value: null
  11539. },
  11540. opacity: {
  11541. type: "f",
  11542. value: 1
  11543. }
  11544. },
  11545. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11546. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11547. }
  11548. }
  11549. , {
  11550. three: 217
  11551. }],
  11552. 101: [function(e, t, i) {
  11553. "use strict";
  11554. e("three").HorizontalBlurShader = {
  11555. uniforms: {
  11556. tDiffuse: {
  11557. type: "t",
  11558. value: null
  11559. },
  11560. h: {
  11561. type: "f",
  11562. value: 1 / 512
  11563. }
  11564. },
  11565. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11566. 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")
  11567. }
  11568. }
  11569. , {
  11570. three: 217
  11571. }],
  11572. 102: [function(e, t, i) {
  11573. "use strict";
  11574. e("three").VerticalBlurShader = {
  11575. uniforms: {
  11576. tDiffuse: {
  11577. type: "t",
  11578. value: null
  11579. },
  11580. v: {
  11581. type: "f",
  11582. value: 1 / 512
  11583. }
  11584. },
  11585. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11586. 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")
  11587. }
  11588. }
  11589. , {
  11590. three: 217
  11591. }],
  11592. 103: [function(e, t, i) {
  11593. "use strict";
  11594. var z = e("three");
  11595. !function() {
  11596. if ("performance"in window == 0 && (window.performance = {}),
  11597. "now"in window.performance == 0) {
  11598. var e = Date.now();
  11599. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11600. window.performance.now = function() {
  11601. return Date.now() - e
  11602. }
  11603. }
  11604. }(),
  11605. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11606. var t, i = this.extensions, n = this.context;
  11607. if (e === z.RepeatWrapping)
  11608. return n.REPEAT;
  11609. if (e === z.ClampToEdgeWrapping)
  11610. return n.CLAMP_TO_EDGE;
  11611. if (e === z.MirroredRepeatWrapping)
  11612. return n.MIRRORED_REPEAT;
  11613. if (e === z.NearestFilter)
  11614. return n.NEAREST;
  11615. if (e === z.NearestMipMapNearestFilter)
  11616. return n.NEAREST_MIPMAP_NEAREST;
  11617. if (e === z.NearestMipMapLinearFilter)
  11618. return n.NEAREST_MIPMAP_LINEAR;
  11619. if (e === z.LinearFilter)
  11620. return n.LINEAR;
  11621. if (e === z.LinearMipMapNearestFilter)
  11622. return n.LINEAR_MIPMAP_NEAREST;
  11623. if (e === z.LinearMipMapLinearFilter)
  11624. return n.LINEAR_MIPMAP_LINEAR;
  11625. if (e === z.UnsignedByteType)
  11626. return n.UNSIGNED_BYTE;
  11627. if (e === z.UnsignedShort4444Type)
  11628. return n.UNSIGNED_SHORT_4_4_4_4;
  11629. if (e === z.UnsignedShort5551Type)
  11630. return n.UNSIGNED_SHORT_5_5_5_1;
  11631. if (e === z.UnsignedShort565Type)
  11632. return n.UNSIGNED_SHORT_5_6_5;
  11633. if (e === z.ByteType)
  11634. return n.BYTE;
  11635. if (e === z.ShortType)
  11636. return n.SHORT;
  11637. if (e === z.UnsignedShortType)
  11638. return n.UNSIGNED_SHORT;
  11639. if (e === z.IntType)
  11640. return n.INT;
  11641. if (e === z.UnsignedIntType)
  11642. return n.UNSIGNED_INT;
  11643. if (e === z.FloatType)
  11644. return n.FLOAT;
  11645. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11646. return t.HALF_FLOAT_OES;
  11647. if (e === z.AlphaFormat)
  11648. return n.ALPHA;
  11649. if (e === z.RGBFormat)
  11650. return n.RGB;
  11651. if (e === z.RGBAFormat)
  11652. return n.RGBA;
  11653. if (e === z.LuminanceFormat)
  11654. return n.LUMINANCE;
  11655. if (e === z.LuminanceAlphaFormat)
  11656. return n.LUMINANCE_ALPHA;
  11657. if (e === z.AddEquation)
  11658. return n.FUNC_ADD;
  11659. if (e === z.SubtractEquation)
  11660. return n.FUNC_SUBTRACT;
  11661. if (e === z.ReverseSubtractEquation)
  11662. return n.FUNC_REVERSE_SUBTRACT;
  11663. if (e === z.ZeroFactor)
  11664. return n.ZERO;
  11665. if (e === z.OneFactor)
  11666. return n.ONE;
  11667. if (e === z.SrcColorFactor)
  11668. return n.SRC_COLOR;
  11669. if (e === z.OneMinusSrcColorFactor)
  11670. return n.ONE_MINUS_SRC_COLOR;
  11671. if (e === z.SrcAlphaFactor)
  11672. return n.SRC_ALPHA;
  11673. if (e === z.OneMinusSrcAlphaFactor)
  11674. return n.ONE_MINUS_SRC_ALPHA;
  11675. if (e === z.DstAlphaFactor)
  11676. return n.DST_ALPHA;
  11677. if (e === z.OneMinusDstAlphaFactor)
  11678. return n.ONE_MINUS_DST_ALPHA;
  11679. if (e === z.DstColorFactor)
  11680. return n.DST_COLOR;
  11681. if (e === z.OneMinusDstColorFactor)
  11682. return n.ONE_MINUS_DST_COLOR;
  11683. if (e === z.SrcAlphaSaturateFactor)
  11684. return n.SRC_ALPHA_SATURATE;
  11685. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11686. if (e === z.RGB_S3TC_DXT1_Format)
  11687. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11688. if (e === z.RGBA_S3TC_DXT1_Format)
  11689. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11690. if (e === z.RGBA_S3TC_DXT3_Format)
  11691. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11692. if (e === z.RGBA_S3TC_DXT5_Format)
  11693. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11694. }
  11695. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11696. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11697. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11698. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11699. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11700. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11701. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11702. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11703. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11704. }
  11705. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11706. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11707. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11708. if (e === z.MinEquation)
  11709. return t.MIN_EXT;
  11710. if (e === z.MaxEquation)
  11711. return t.MAX_EXT
  11712. }
  11713. return 0
  11714. }
  11715. ,
  11716. z.WebGLState = function(l, i, c) {
  11717. var n = this
  11718. , r = new z.Vector4
  11719. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11720. , o = new Uint8Array(e)
  11721. , a = new Uint8Array(e)
  11722. , s = new Uint8Array(e)
  11723. , t = {}
  11724. , h = null
  11725. , u = null
  11726. , d = null
  11727. , p = null
  11728. , f = null
  11729. , g = null
  11730. , m = null
  11731. , v = null
  11732. , y = !1
  11733. , A = null
  11734. , C = null
  11735. , I = null
  11736. , E = null
  11737. , _ = null
  11738. , b = null
  11739. , w = null
  11740. , T = null
  11741. , x = null
  11742. , S = null
  11743. , M = null
  11744. , R = null
  11745. , P = null
  11746. , O = null
  11747. , L = null
  11748. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11749. , N = void 0
  11750. , F = {}
  11751. , B = new z.Vector4
  11752. , V = null
  11753. , k = null
  11754. , U = new z.Vector4
  11755. , H = new z.Vector4;
  11756. this.init = function() {
  11757. this.clearColor(0, 0, 0, 1),
  11758. this.clearDepth(1),
  11759. this.clearStencil(0),
  11760. this.enable(l.DEPTH_TEST),
  11761. l.depthFunc(l.LEQUAL),
  11762. l.frontFace(l.CCW),
  11763. l.cullFace(l.BACK),
  11764. this.enable(l.CULL_FACE),
  11765. this.enable(l.BLEND),
  11766. l.blendEquation(l.FUNC_ADD),
  11767. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11768. }
  11769. ,
  11770. this.initAttributes = function() {
  11771. for (var e = 0, t = o.length; e < t; e++)
  11772. o[e] = 0
  11773. }
  11774. ,
  11775. this.enableAttribute = function(e) {
  11776. o[e] = 1,
  11777. 0 === a[e] && (l.enableVertexAttribArray(e),
  11778. a[e] = 1),
  11779. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11780. s[e] = 0)
  11781. }
  11782. ,
  11783. this.enableAttributeAndDivisor = function(e, t, i) {
  11784. o[e] = 1,
  11785. 0 === a[e] && (l.enableVertexAttribArray(e),
  11786. a[e] = 1),
  11787. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11788. s[e] = t)
  11789. }
  11790. ,
  11791. this.disableUnusedAttributes = function() {
  11792. for (var e = 0, t = a.length; e < t; e++)
  11793. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11794. a[e] = 0)
  11795. }
  11796. ,
  11797. this.enable = function(e) {
  11798. !0 !== t[e] && (l.enable(e),
  11799. t[e] = !0)
  11800. }
  11801. ,
  11802. this.disable = function(e) {
  11803. !1 !== t[e] && (l.disable(e),
  11804. t[e] = !1)
  11805. }
  11806. ,
  11807. this.getCompressedTextureFormats = function() {
  11808. if (null === h && (h = [],
  11809. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11810. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11811. h.push(e[t]);
  11812. return h
  11813. }
  11814. ,
  11815. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11816. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11817. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11818. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11819. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11820. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11821. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11822. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11823. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11824. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11825. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11826. u = e,
  11827. y = s),
  11828. e === z.CustomBlending ? (r = r || t,
  11829. o = o || i,
  11830. a = a || n,
  11831. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11832. d = t,
  11833. g = r),
  11834. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11835. p = i,
  11836. f = n,
  11837. m = o,
  11838. v = a)) : v = m = g = f = p = d = null
  11839. }
  11840. ,
  11841. this.setDepthFunc = function(e) {
  11842. if (A !== e) {
  11843. if (e)
  11844. switch (e) {
  11845. case z.NeverDepth:
  11846. l.depthFunc(l.NEVER);
  11847. break;
  11848. case z.AlwaysDepth:
  11849. l.depthFunc(l.ALWAYS);
  11850. break;
  11851. case z.LessDepth:
  11852. l.depthFunc(l.LESS);
  11853. break;
  11854. case z.LessEqualDepth:
  11855. l.depthFunc(l.LEQUAL);
  11856. break;
  11857. case z.EqualDepth:
  11858. l.depthFunc(l.EQUAL);
  11859. break;
  11860. case z.GreaterEqualDepth:
  11861. l.depthFunc(l.GEQUAL);
  11862. break;
  11863. case z.GreaterDepth:
  11864. l.depthFunc(l.GREATER);
  11865. break;
  11866. case z.NotEqualDepth:
  11867. l.depthFunc(l.NOTEQUAL);
  11868. break;
  11869. default:
  11870. l.depthFunc(l.LEQUAL)
  11871. }
  11872. else
  11873. l.depthFunc(l.LEQUAL);
  11874. A = e
  11875. }
  11876. }
  11877. ,
  11878. this.setDepthTest = function(e) {
  11879. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11880. }
  11881. ,
  11882. this.setDepthWrite = function(e) {
  11883. C !== e && (l.depthMask(e),
  11884. C = e)
  11885. }
  11886. ,
  11887. this.setColorWrite = function(e) {
  11888. I !== e && (l.colorMask(e, e, e, e),
  11889. I = e)
  11890. }
  11891. ,
  11892. this.setStencilFunc = function(e, t, i) {
  11893. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11894. _ = e,
  11895. b = t,
  11896. w = i)
  11897. }
  11898. ,
  11899. this.setStencilOp = function(e, t, i) {
  11900. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11901. T = e,
  11902. x = t,
  11903. S = i)
  11904. }
  11905. ,
  11906. this.setStencilTest = function(e) {
  11907. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11908. }
  11909. ,
  11910. this.setStencilWrite = function(e) {
  11911. E !== e && (l.stencilMask(e),
  11912. E = e)
  11913. }
  11914. ,
  11915. this.setFlipSided = function(e) {
  11916. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11917. M = e)
  11918. }
  11919. ,
  11920. this.setLineWidth = function(e) {
  11921. e !== R && (l.lineWidth(e),
  11922. R = e)
  11923. }
  11924. ,
  11925. this.setPolygonOffset = function(e, t, i) {
  11926. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11927. !e || P === t && O === i || (l.polygonOffset(t, i),
  11928. P = t,
  11929. O = i)
  11930. }
  11931. ,
  11932. this.getScissorTest = function() {
  11933. return L
  11934. }
  11935. ,
  11936. this.setScissorTest = function(e) {
  11937. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11938. }
  11939. ,
  11940. this.activeTexture = function(e) {
  11941. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11942. N !== e && (l.activeTexture(e),
  11943. N = e)
  11944. }
  11945. ,
  11946. this.bindTexture = function(e, t) {
  11947. void 0 === N && n.activeTexture();
  11948. var i = F[N];
  11949. void 0 === i && (i = {
  11950. type: void 0,
  11951. texture: void 0
  11952. },
  11953. F[N] = i),
  11954. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11955. i.type = e,
  11956. i.texture = t)
  11957. }
  11958. ,
  11959. this.compressedTexImage2D = function() {
  11960. try {
  11961. l.compressedTexImage2D.apply(l, arguments)
  11962. } catch (e) {
  11963. console.error(e)
  11964. }
  11965. }
  11966. ,
  11967. this.texImage2D = function() {
  11968. try {
  11969. l.texImage2D.apply(l, arguments)
  11970. } catch (e) {
  11971. console.error(e)
  11972. }
  11973. }
  11974. ,
  11975. this.clearColor = function(e, t, i, n) {
  11976. r.set(e, t, i, n),
  11977. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11978. B.copy(r))
  11979. }
  11980. ,
  11981. this.clearDepth = function(e) {
  11982. V !== e && (l.clearDepth(e),
  11983. V = e)
  11984. }
  11985. ,
  11986. this.clearStencil = function(e) {
  11987. k !== e && (l.clearStencil(e),
  11988. k = e)
  11989. }
  11990. ,
  11991. this.scissor = function(e) {
  11992. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11993. U.copy(e))
  11994. }
  11995. ,
  11996. this.viewport = function(e) {
  11997. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11998. H.copy(e))
  11999. }
  12000. ,
  12001. this.reset = function() {
  12002. for (var e = 0; e < a.length; e++)
  12003. 1 === a[e] && (l.disableVertexAttribArray(e),
  12004. a[e] = 0);
  12005. t = {},
  12006. N = void 0,
  12007. F = {},
  12008. M = E = C = I = u = h = null
  12009. }
  12010. }
  12011. }
  12012. , {
  12013. three: 217
  12014. }],
  12015. 104: [function(a, h, e) {
  12016. (function(i, e) {
  12017. "use strict";
  12018. function t(e) {
  12019. this.urls = e;
  12020. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12021. this.builder = n.loadProto(t),
  12022. this.decoder = this.builder.build("binary_mesh")
  12023. }
  12024. var s = a("three")
  12025. , n = a("protobufjs")
  12026. , r = a("../util/logger")
  12027. , o = (a("../util/common"),
  12028. a("../util/ajax"))
  12029. , l = a("../objects/Chunk")
  12030. , c = new r(e);
  12031. t.prototype = {
  12032. constructor: t,
  12033. load: function(t, i, n, r) {
  12034. return c.time("download"),
  12035. o.get(t, {
  12036. responseType: "arraybuffer"
  12037. }).done(function(e) {
  12038. c.timeEnd("download"),
  12039. this.parse(e, t, i, n, r)
  12040. }
  12041. .bind(this)).fail(r)
  12042. },
  12043. parse: function(e, t, i, n, r) {
  12044. var o = this.readProtobuf(e);
  12045. if (!o)
  12046. return r();
  12047. try {
  12048. c.time("convert to webgl"),
  12049. this.convertProtobufToSceneObject(o, t, i, n, r),
  12050. c.timeEnd("convert to webgl")
  12051. } catch (e) {
  12052. return c.error("failed parsing .dam"),
  12053. c.error(e.message),
  12054. r()
  12055. }
  12056. },
  12057. readProtobuf: function(e) {
  12058. var t;
  12059. try {
  12060. c.time("parse proto"),
  12061. t = this.decoder.decode(e),
  12062. c.timeEnd("parse proto")
  12063. } catch (e) {
  12064. return c.error("failed parsing proto for .dam"),
  12065. c.error(e.message),
  12066. null
  12067. }
  12068. return t
  12069. },
  12070. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12071. if (0 === e.chunk.length)
  12072. return c.warn("No chunks in damfile..."),
  12073. t([]);
  12074. var o = new s.Matrix4;
  12075. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12076. var a = e.chunk.map(function(e) {
  12077. var t = new s.BufferGeometry;
  12078. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12079. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12080. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12081. t.applyMatrix(o),
  12082. t.computeBoundingBox(),
  12083. new l({
  12084. geometry: t,
  12085. textureName: e.material_name,
  12086. name: e.chunk_name,
  12087. meshUrl: i
  12088. })
  12089. });
  12090. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12091. r())
  12092. }
  12093. },
  12094. h.exports = t
  12095. }
  12096. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12097. }
  12098. , {
  12099. "../objects/Chunk": 144,
  12100. "../util/ajax": 181,
  12101. "../util/common": 185,
  12102. "../util/logger": 189,
  12103. buffer: 198,
  12104. protobufjs: 214,
  12105. three: 217
  12106. }],
  12107. 105: [function(n, r, e) {
  12108. (function(e) {
  12109. "use strict";
  12110. var t = (n("three"),
  12111. n("../settings"),
  12112. n("../util/browser"),
  12113. n("./DamLoader"))
  12114. , i = n("../util/logger")
  12115. , u = (n("../ab"),
  12116. new i(e));
  12117. r.exports = {
  12118. getLoaders: function() {
  12119. return [["_50k", ".dam", t], ["", ".dam", t]]
  12120. },
  12121. load: function(e, t, i, n, r, o) {
  12122. var a = this.getLoaders()[o = o || 0];
  12123. if (a) {
  12124. var s = a[0]
  12125. , l = a[1]
  12126. , c = new a[2](t)
  12127. , h = t.get(e + s + l);
  12128. h ? (u.debug("Trying " + s + l),
  12129. c.load(h, i, n, function() {
  12130. this.load(e, t, i, n, r, ++o)
  12131. }
  12132. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12133. this.load(e, t, i, n, r, ++o))
  12134. } else
  12135. r && r("No suitable model file found...")
  12136. }
  12137. }
  12138. }
  12139. ).call(this, "/js/loaders/ModelLoader.js")
  12140. }
  12141. , {
  12142. "../ab": 3,
  12143. "../settings": 166,
  12144. "../util/browser": 182,
  12145. "../util/logger": 189,
  12146. "./DamLoader": 104,
  12147. three: 217
  12148. }],
  12149. 106: [function(i, n, e) {
  12150. (function(e) {
  12151. "use strict";
  12152. var l = i("../util/common")
  12153. , c = i("../util/texture")
  12154. , h = i("../util/browser")
  12155. , t = i("../util/logger")
  12156. , u = i("../settings")
  12157. , d = new t(e);
  12158. n.exports = {
  12159. load: function(i, n) {
  12160. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12161. return $.when();
  12162. var r = l.countUnique(i.chunks.map(function(e) {
  12163. return e.textureName
  12164. }))
  12165. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12166. , t = "_50k" == e ? "high" : "low";
  12167. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12168. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12169. t = "low"));
  12170. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12171. , a = $.Deferred()
  12172. , s = 0;
  12173. return i.chunks.forEach(function(e) {
  12174. if (!e.material.map && e.textureName) {
  12175. var t = i.urls.get(o + e.textureName);
  12176. e.setTextureMap(c.load(t, function(e, t) {
  12177. e || (n.push(t),
  12178. s++,
  12179. a.notify(s, r),
  12180. s === r && a.resolve())
  12181. }
  12182. .bind(this, c.isLoaded(t))))
  12183. }
  12184. }),
  12185. a.promise()
  12186. }
  12187. }
  12188. }
  12189. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12190. }
  12191. , {
  12192. "../settings": 166,
  12193. "../util/browser": 182,
  12194. "../util/common": 185,
  12195. "../util/logger": 189,
  12196. "../util/texture": 194
  12197. }],
  12198. 107: [function(s, l, e) {
  12199. (function(n, e) {
  12200. "use strict";
  12201. function t(e) {
  12202. this.model = e,
  12203. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12204. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12205. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12206. , i = r.loadProto(t);
  12207. this.decoder = i.build("VisionModeldata")
  12208. }
  12209. var r = s("protobufjs")
  12210. , i = s("../util/ajax")
  12211. , o = (s("../util/common"),
  12212. s("../util/math"))
  12213. , a = new (s("../util/logger"))(e);
  12214. t.prototype.load = function() {
  12215. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12216. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12217. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12218. $.when([]))
  12219. }
  12220. ,
  12221. t.prototype.loadVisionModelData = function() {
  12222. return i.get(this.modelDataPath, {
  12223. responseType: "arraybuffer"
  12224. }).then(function(e) {
  12225. var t;
  12226. try {
  12227. t = this.decoder.decode(e)
  12228. } catch (e) {
  12229. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12230. this.loadSweepLocationsCSV()
  12231. }
  12232. var i = t.sweepLocations.map(function(e) {
  12233. return {
  12234. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12235. position: {
  12236. x: e.pose.translation.x,
  12237. y: e.pose.translation.y,
  12238. z: e.pose.translation.z
  12239. },
  12240. quaternion: {
  12241. x: e.pose.rotation.x,
  12242. y: e.pose.rotation.y,
  12243. z: e.pose.rotation.z,
  12244. w: e.pose.rotation.w
  12245. },
  12246. puck: {
  12247. x: e.puck.x,
  12248. y: e.puck.y,
  12249. z: e.puck.z
  12250. },
  12251. floor: e.group,
  12252. neighbours: e.visibles,
  12253. alignmentType: e.alignment_type
  12254. }
  12255. }).map(function(e) {
  12256. return e.position = o.convertVisionVector(e.position),
  12257. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12258. e.puck = o.convertVisionVector(e.puck),
  12259. e
  12260. });
  12261. return i.forEach(function(e) {
  12262. e.neighbours = e.neighbours.map(function(e) {
  12263. return i[e].uuid
  12264. })
  12265. }),
  12266. i
  12267. }
  12268. .bind(this), function() {
  12269. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12270. this.loadSweepLocationsCSV()
  12271. }
  12272. .bind(this))
  12273. }
  12274. ,
  12275. t.prototype.loadSweepLocationsCSV = function() {
  12276. return i.get(this.sweepLocationsPath).then(function(e) {
  12277. return e.split("\n").map(function(e) {
  12278. return e.split(", ")
  12279. }).filter(function(e) {
  12280. return 1 < e.length
  12281. }).map(function(e) {
  12282. return {
  12283. uuid: e[0],
  12284. position: {
  12285. x: parseFloat(e[1]),
  12286. y: parseFloat(e[2]),
  12287. z: parseFloat(e[3])
  12288. },
  12289. quaternion: {
  12290. x: parseFloat(e[4]),
  12291. y: parseFloat(e[5]),
  12292. z: parseFloat(e[6]),
  12293. w: parseFloat(e[7])
  12294. }
  12295. }
  12296. }).map(function(e) {
  12297. return e.position = o.convertVisionVector(e.position),
  12298. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12299. e
  12300. })
  12301. }).fail(function() {
  12302. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12303. })
  12304. }
  12305. ,
  12306. l.exports = t
  12307. }
  12308. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12309. }
  12310. , {
  12311. "../util/ajax": 181,
  12312. "../util/common": 185,
  12313. "../util/logger": 189,
  12314. "../util/math": 190,
  12315. buffer: 198,
  12316. protobufjs: 214
  12317. }],
  12318. 108: [function(s, l, e) {
  12319. (function(e) {
  12320. "use strict";
  12321. function t() {
  12322. this.locale = null
  12323. }
  12324. var i = s("../settings")
  12325. , n = s("../util/common")
  12326. , r = s("../util/logger")
  12327. , o = s("../enum/Locale")
  12328. , a = new r(e);
  12329. t.prototype.init = function() {
  12330. var e;
  12331. switch (i.languageTag) {
  12332. case null:
  12333. case "en":
  12334. case o.EN_US:
  12335. this.locale = o.EN_US,
  12336. e = s("./strings-en-US");
  12337. break;
  12338. case "es":
  12339. case o.ES_MX:
  12340. this.locale = o.ES_MX,
  12341. e = s("./strings-es-MX");
  12342. break;
  12343. case "fr":
  12344. case o.FR_FR:
  12345. this.locale = o.FR_FR,
  12346. e = s("./strings-fr-FR");
  12347. break;
  12348. case "de":
  12349. case o.DE_DE:
  12350. this.locale = o.DE_DE,
  12351. e = s("./strings-de-DE");
  12352. break;
  12353. case "ru":
  12354. case o.RU_RU:
  12355. this.locale = o.RU_RU,
  12356. e = s("./strings-ru-RU");
  12357. break;
  12358. case "cn":
  12359. case o.CN_CN:
  12360. this.locale = o.CN_CN,
  12361. e = s("./strings-cn-CN");
  12362. break;
  12363. case "jp":
  12364. case o.JP_JP:
  12365. this.locale = o.JP_JP,
  12366. e = s("./strings-jp-JP");
  12367. break;
  12368. default:
  12369. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12370. this.locale = o.EN_US,
  12371. e = s("./strings-en-US")
  12372. }
  12373. a.info("Using locale '" + this.locale + "'"),
  12374. n.extendObject(this, e)
  12375. }
  12376. ,
  12377. t.prototype.localizeGUI = function() {
  12378. var e = document.querySelector("#gui-parent");
  12379. this.localizeTree(e),
  12380. this.localizeLoadingText()
  12381. }
  12382. ,
  12383. t.prototype.localizeLoadingText = function() {
  12384. document.querySelector("#help-dialog").classList.add(this.locale),
  12385. document.querySelector("#interaction-modal").classList.add(this.locale),
  12386. document.querySelector("#gui").classList.add(this.locale)
  12387. }
  12388. ,
  12389. t.prototype.localizeTree = function(e) {
  12390. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12391. if (e.nodeType === Node.TEXT_NODE)
  12392. (t = e.data.match(n)) && (i = t[1],
  12393. e.data = this.localizeText(i) || i);
  12394. else if (e.nodeType === Node.ELEMENT_NODE) {
  12395. var r = e.getAttribute("title");
  12396. r && ((t = r.match(n)) && (i = t[1],
  12397. e.setAttribute("title", this.localizeText(i) || i)))
  12398. }
  12399. for (e = e.firstChild; e; )
  12400. this.localizeTree(e),
  12401. e = e.nextSibling
  12402. }
  12403. ,
  12404. t.prototype.localizeText = function(e) {
  12405. var t = this[e];
  12406. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12407. t = s("./strings-en-US")[e]),
  12408. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12409. t
  12410. }
  12411. ,
  12412. l.exports = new t
  12413. }
  12414. ).call(this, "/js/localization/localize.js")
  12415. }
  12416. , {
  12417. "../enum/Locale": 31,
  12418. "../settings": 166,
  12419. "../util/common": 185,
  12420. "../util/logger": 189,
  12421. "./strings-cn-CN": 109,
  12422. "./strings-de-DE": 110,
  12423. "./strings-en-US": 111,
  12424. "./strings-es-MX": 112,
  12425. "./strings-fr-FR": 113,
  12426. "./strings-jp-JP": 114,
  12427. "./strings-ru-RU": 115
  12428. }],
  12429. 109: [function(e, t, i) {
  12430. "use strict";
  12431. t.exports = {
  12432. PAGE_TITLE: "",
  12433. LOADING: "正在加载",
  12434. PRESENTED_BY_CAPS: "呈现者:",
  12435. POWERED_BY: "技术支持:",
  12436. POWERED_BY_CAPS: "技术支持:",
  12437. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12438. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12439. PRESENTED_BY: "呈现者:",
  12440. MORE: "更多 ",
  12441. LESS: "更少 ",
  12442. TAG_CONTENT: "tag™ 内容",
  12443. SHOW: "显示",
  12444. HIDE: "隐藏",
  12445. DOLLHOUSE: "场景屋",
  12446. FLOOR_PLAN: "楼层平面图",
  12447. OPEN_HIGHLIGHTS: "打开精彩片段",
  12448. CLOSE_HIGHLIGHTS: "关闭",
  12449. PREVIOUS: "上一个",
  12450. PLAY: "播放",
  12451. PAUSE: "暂停",
  12452. NEXT: "下一个",
  12453. EXPLORE_3D_SPACE: "探索 3D 空间",
  12454. VIEW_DOLLHOUSE: "观看场景屋",
  12455. SOCIAL_SHARING: "分享这个空间",
  12456. VIEW_IN_VR: "以 VR 观看",
  12457. VIEW_FULLSCREEN: "全屏观看",
  12458. EXIT_FULLSCREEN: " 退出全屏",
  12459. ZOOM_IN: "放大",
  12460. ZOOM_OUT: "缩小",
  12461. FLOOR_NAME: "楼层",
  12462. FLOOR_ALL: "ALL",
  12463. FLOOR_Lang: ["Floor", ""],
  12464. TERMS: "条款",
  12465. PORT_TERMS: "port 条款",
  12466. TERMS_OF_USE: "使用条款",
  12467. CLOSE_TERMS: "关闭",
  12468. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12469. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12470. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12471. WEBVR_ENTER_WEBVR: "进入 VR",
  12472. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12473. WEBVR_LEARN_MORE: "了解更多",
  12474. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12475. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12476. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12477. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12478. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12479. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12480. VR_LEARN_MORE_CAPS: "了解更多",
  12481. VR_PREVIOUS_CAPS: "上一个’,",
  12482. VR_NEXT_CAPS: "下一个",
  12483. VR_GOT_IT_CAPS: "明白了",
  12484. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12485. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12486. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12487. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12488. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12489. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12490. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12491. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12492. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12493. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12494. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12495. VR_APP: "port VR 应用程序",
  12496. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12497. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12498. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12499. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12500. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12501. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12502. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12503. VR_ANDROID_DVICES: "Android 设备",
  12504. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12505. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12506. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12507. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12508. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12509. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12510. VR_DOWNLOAD_HERE: "在此下载",
  12511. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12512. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12513. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12514. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12515. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12516. SHARE_TO: "分享到",
  12517. SHARE_LINK: "直接链接",
  12518. SHARE_EXPLORE: "探索",
  12519. SHARE_AT: "在",
  12520. SHARE_WITH: "使用",
  12521. SHARE_3D: "以 3D",
  12522. SHARE_COPIED: "已复制!",
  12523. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12524. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12525. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12526. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12527. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12528. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12529. ERROR_GENERIC_ACTIONS_3: " 或",
  12530. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12531. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12532. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12533. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12534. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12535. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12536. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12537. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12538. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12539. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12540. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12541. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12542. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12543. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12544. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12545. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12546. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12547. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12548. LINK_TO_LOCATION: "地点链接",
  12549. MENU_COPY: "复制",
  12550. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12551. ROTATE: "旋转",
  12552. MOVE: "移动",
  12553. INSIDE: "内部",
  12554. ZOOM: "缩放",
  12555. HELP: "小帮手",
  12556. HELP_NAVIGATION_TAB: "导航",
  12557. HELP_MORE_HELP_TAB: "更多帮助",
  12558. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12559. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12560. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12561. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12562. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12563. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12564. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12565. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12566. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12567. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12568. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12569. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12570. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12571. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12572. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12573. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12574. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12575. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12576. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12577. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12578. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12579. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12580. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12581. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12582. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12583. HELP_MORE_HLR_A: "精彩片段集锦",
  12584. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12585. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12586. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12587. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12588. HELP_MORE_FLOORS_A: "楼层选择器",
  12589. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12590. HELP_MORE_TAG_A: "tag™ 贴文",
  12591. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12592. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12593. HELP_MORE_ZOOM_A: "缩放控件",
  12594. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12595. HELP_MORE_TOUR_A: "导览控件",
  12596. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12597. HELP_MORE_INSIDE_A: "内部视图",
  12598. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12599. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12600. HELP_MORE_VR_A: "VR 模式",
  12601. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12602. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12603. HELP_MORE_360_A: "360° 视图",
  12604. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12605. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12606. HELP_MORE_FULLSCREEN_A: "全屏",
  12607. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12608. CLOSE: "关闭"
  12609. }
  12610. }
  12611. , {}],
  12612. 110: [function(e, t, i) {
  12613. "use strict";
  12614. t.exports = {
  12615. PAGE_TITLE: "",
  12616. LOADING: "Lädt",
  12617. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12618. POWERED_BY: "Angetrieben von",
  12619. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12620. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12621. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12622. PRESENTED_BY: "Präsentiert von ",
  12623. MORE: "Mehr ",
  12624. LESS: "Weniger ",
  12625. TAG_CONTENT: "tag™ Inhalt",
  12626. SHOW: "Anzeigen",
  12627. HIDE: "Verbergen",
  12628. DOLLHOUSE: "Puppenhaus",
  12629. FLOOR_PLAN: "Grundriss",
  12630. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12631. CLOSE_HIGHLIGHTS: "Schließen",
  12632. PREVIOUS: "Vorheriges",
  12633. PLAY: "Abspielen",
  12634. PAUSE: "Pausieren",
  12635. NEXT: "Nächstes",
  12636. EXPLORE_3D_SPACE: "Innenraum betreten",
  12637. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12638. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12639. VIEW_IN_VR: "In VR ansehen",
  12640. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12641. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12642. ZOOM_IN: "Vergrößern",
  12643. ZOOM_OUT: "Verkleinern",
  12644. FLOOR_NAME: "Etage ",
  12645. FLOOR_ALL: "Alle",
  12646. TERMS: "Bedingungen",
  12647. PORT_TERMS: "port Bedingungen",
  12648. TERMS_OF_USE: "Nutzungsbedingungen",
  12649. TERMS_TEXT_FILE: "terms-de-DE.html",
  12650. CLOSE_TERMS: "Schließen",
  12651. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12652. HELP: "Hilfe",
  12653. HELP_NAVIGATION_TAB: "Navigation",
  12654. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12655. CLOSE: "Schließen",
  12656. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12657. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12658. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12659. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12660. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12661. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12662. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12663. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12664. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12665. 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.",
  12666. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12667. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12668. 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.",
  12669. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12670. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12671. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12672. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12673. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12674. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12675. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12676. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12677. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12678. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12679. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12680. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12681. HELP_MORE_HLR_A: "Liste das Highlight",
  12682. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12683. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12684. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12685. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12686. HELP_MORE_FLOORS_A: "Etage auswählen",
  12687. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12688. HELP_MORE_TAG_A: "tag™ Posts",
  12689. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12690. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12691. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12692. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12693. HELP_MORE_TOUR_A: "Tour Steuerung",
  12694. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12695. HELP_MORE_INSIDE_A: "Innenansicht",
  12696. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12697. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12698. HELP_MORE_VR_A: "VR Modus",
  12699. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12700. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12701. HELP_MORE_360_A: "360° Views Ansicht ",
  12702. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12703. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12704. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12705. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12706. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12707. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12708. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12709. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12710. WEBVR_LEARN_MORE: "Mehr Infos",
  12711. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12712. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12713. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12714. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12715. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12716. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12717. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12718. VR_APP: "port VR App",
  12719. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12720. 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",
  12721. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12722. VR_APP_FOR_ANDROID: "port VR app für Android",
  12723. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12724. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12725. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12726. VR_PREVIOUS_CAPS: "ZURÜCK",
  12727. VR_NEXT_CAPS: "WEITER",
  12728. VR_GOT_IT_CAPS: "VERSTANDEN",
  12729. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12730. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12731. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12732. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12733. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12734. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12735. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12736. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12737. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12738. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12739. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12740. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12741. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12742. VR_ANDROID_DVICES: "Android Geräte",
  12743. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12744. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12745. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12746. VR_DOWNLOAD_HERE: "Hier runterladen",
  12747. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12748. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12749. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12750. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12751. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12752. SHARE_TO: "Teilen auf",
  12753. SHARE_LINK: "Direkter Link",
  12754. SHARE_EXPLORE: "Umsehen",
  12755. SHARE_AT: "auf",
  12756. SHARE_WITH: "mit",
  12757. SHARE_3D: "in 3D",
  12758. SHARE_COPIED: "Kopiert!",
  12759. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12760. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12761. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12762. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12763. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12764. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12765. ERROR_GENERIC_ACTIONS_3: " oder ",
  12766. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12767. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12768. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12769. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12770. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12771. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12772. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12773. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12774. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12775. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12776. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12777. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12778. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12779. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12780. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12781. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12782. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12783. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12784. LINK_TO_LOCATION: "Link zu",
  12785. MENU_COPY: "Kopieren",
  12786. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12787. ROTATE: "Drehen",
  12788. INSIDE: "Drinnen",
  12789. MOVE: "Bewegen",
  12790. ZOOM: "Vergrößern"
  12791. }
  12792. }
  12793. , {}],
  12794. 111: [function(e, t, i) {
  12795. "use strict";
  12796. t.exports = {
  12797. PAGE_TITLE: "",
  12798. LOADING: "Loading",
  12799. PRESENTED_BY_CAPS: "PRESENTED BY",
  12800. POWERED_BY: "powered by ",
  12801. POWERED_BY_CAPS: "POWERED BY",
  12802. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12803. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12804. PRESENTED_BY: "Presented by ",
  12805. MORE: "More ",
  12806. LESS: "Less ",
  12807. TAG_CONTENT: "tag™ Content",
  12808. SHOW: "Show",
  12809. HIDE: "Hide",
  12810. DOLLHOUSE: "Dollhouse",
  12811. FLOOR_PLAN: "Floor plan",
  12812. OPEN_HIGHLIGHTS: "Open Highlights",
  12813. CLOSE_HIGHLIGHTS: "Close",
  12814. PREVIOUS: "Previous",
  12815. PLAY: "Play",
  12816. PAUSE: "Pause",
  12817. NEXT: "Next",
  12818. EXPLORE_3D_SPACE: "Explore 3D Space",
  12819. VIEW_DOLLHOUSE: "View dollhouse",
  12820. SOCIAL_SHARING: "Share this Space",
  12821. VIEW_IN_VR: "View in VR",
  12822. VIEW_FULLSCREEN: "全屏",
  12823. EXIT_FULLSCREEN: "退出全屏",
  12824. ZOOM_IN: "Zoom in",
  12825. ZOOM_OUT: "Zoom out",
  12826. FLOOR_NAME: "Floor ",
  12827. FLOOR_ALL: "全部",
  12828. TERMS: "Terms",
  12829. PORT_TERMS: "port terms",
  12830. TERMS_OF_USE: "Terms of Use",
  12831. TERMS_TEXT_FILE: "terms-en-US.html",
  12832. CLOSE_TERMS: "Close",
  12833. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12834. HELP: "Help",
  12835. HELP_NAVIGATION_TAB: "Navigation",
  12836. HELP_MORE_HELP_TAB: "More Help",
  12837. CLOSE: "Close",
  12838. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12839. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12840. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12841. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12842. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12843. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12844. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12845. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12846. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12847. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12848. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12849. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12850. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12851. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12852. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12853. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12854. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12855. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12856. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12857. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12858. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12859. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12860. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12861. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12862. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12863. HELP_MORE_HLR_A: "Highlight Reel",
  12864. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12865. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12866. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12867. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12868. HELP_MORE_FLOORS_A: "Floor Selector",
  12869. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12870. HELP_MORE_TAG_A: "tag™ Posts",
  12871. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12872. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12873. HELP_MORE_ZOOM_A: "Zoom Controls",
  12874. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12875. HELP_MORE_TOUR_A: "Tour Controls",
  12876. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12877. HELP_MORE_INSIDE_A: "Inside View",
  12878. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12879. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12880. HELP_MORE_VR_A: "VR Mode",
  12881. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12882. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12883. HELP_MORE_360_A: "360° Views",
  12884. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12885. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12886. HELP_MORE_FULLSCREEN_A: "Full screen",
  12887. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12888. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12889. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12890. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12891. WEBVR_ENTER_WEBVR: "ENTER VR",
  12892. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12893. WEBVR_LEARN_MORE: "Learn more",
  12894. WEBVR_VIEW_SPACE: "View Space in VR",
  12895. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12896. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12897. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12898. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12899. VR_PREVIOUS_CAPS: "PREVIOUS",
  12900. VR_NEXT_CAPS: "NEXT",
  12901. VR_GOT_IT_CAPS: "GOT IT",
  12902. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12903. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12904. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12905. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12906. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12907. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12908. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12909. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12910. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12911. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12912. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12913. VR_APP: "port VR App",
  12914. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12915. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12916. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12917. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12918. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12919. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12920. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12921. VR_ANDROID_DVICES: "Android Devices",
  12922. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12923. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12924. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12925. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12926. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12927. VR_APP_OPEN: "Open with the port VR app instead",
  12928. VR_DOWNLOAD_HERE: "Download here",
  12929. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12930. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12931. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12932. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12933. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12934. SHARE_TO: "Share to",
  12935. SHARE_LINK: "Direct Link",
  12936. SHARE_EXPLORE: "Explore ",
  12937. SHARE_AT: "at",
  12938. SHARE_WITH: "with",
  12939. SHARE_3D: " in 3D",
  12940. SHARE_COPIED: "Copied!",
  12941. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12942. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12943. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12944. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12945. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12946. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12947. ERROR_GENERIC_ACTIONS_3: " or ",
  12948. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12949. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12950. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12951. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12952. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12953. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12954. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12955. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12956. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12957. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12958. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12959. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12960. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12961. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12962. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12963. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12964. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12965. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12966. LINK_TO_LOCATION: "Link to location",
  12967. MENU_COPY: "Copy",
  12968. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12969. ROTATE: "Rotate",
  12970. INSIDE: "Inside",
  12971. MOVE: "Move",
  12972. ZOOM: "Zoom"
  12973. }
  12974. }
  12975. , {}],
  12976. 112: [function(e, t, i) {
  12977. "use strict";
  12978. t.exports = {
  12979. PAGE_TITLE: "",
  12980. LOADING: "Cargando",
  12981. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12982. POWERED_BY: "potenciando por ",
  12983. POWERED_BY_CAPS: "POTENCIADO POR ",
  12984. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12985. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12986. PRESENTED_BY: "Presentado por ",
  12987. MORE: "Más ",
  12988. LESS: "Menos ",
  12989. TAG_CONTENT: "Contenido de tag™",
  12990. SHOW: "Mostrar",
  12991. HIDE: "Ocultar",
  12992. DOLLHOUSE: "Dollhouse",
  12993. FLOOR_PLAN: "Planos",
  12994. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12995. CLOSE_HIGHLIGHTS: "Cerrar",
  12996. PREVIOUS: "Anterior",
  12997. PLAY: "Play",
  12998. PAUSE: "Pausa",
  12999. NEXT: "Siguiente",
  13000. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13001. VIEW_DOLLHOUSE: "Ver dollhouse",
  13002. SOCIAL_SHARING: "Compartir este espacio",
  13003. VIEW_IN_VR: "Ver en realidad virtual",
  13004. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13005. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13006. ZOOM_IN: "Acercar",
  13007. ZOOM_OUT: "Alejar",
  13008. FLOOR_NAME: "Piso ",
  13009. FLOOR_ALL: "Todas",
  13010. TERMS: "Condiciones",
  13011. PORT_TERMS: "port términos de uso",
  13012. TERMS_OF_USE: "Términos de uso",
  13013. TERMS_TEXT_FILE: "terms-es-MX.html",
  13014. CLOSE_TERMS: "Cerrar",
  13015. 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.",
  13016. HELP: "Ayuda",
  13017. HELP_NAVIGATION_TAB: "Navegación",
  13018. HELP_MORE_HELP_TAB: "Más Ayuda",
  13019. CLOSE: "Cerrar",
  13020. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13021. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13022. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13023. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13024. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13025. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13026. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13027. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13028. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13029. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13030. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13031. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13032. 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.",
  13033. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13034. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13035. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13036. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13037. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13038. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13039. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13040. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13041. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13042. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13043. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13044. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13045. HELP_MORE_HLR_A: "Galería destacada",
  13046. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13047. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13048. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13049. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13050. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13051. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13052. HELP_MORE_TAG_A: "tag™ Posts",
  13053. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13054. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13055. HELP_MORE_ZOOM_A: "Controles de zoom",
  13056. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13057. HELP_MORE_TOUR_A: "Controles de recorrido",
  13058. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13059. HELP_MORE_INSIDE_A: "Vista interior",
  13060. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13061. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13062. HELP_MORE_VR_A: "Modo de realidad virtual",
  13063. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13064. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13065. HELP_MORE_360_A: "360° Views",
  13066. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13067. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13068. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13069. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13070. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13071. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13072. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13073. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13074. WEBVR_LEARN_MORE: "Más información",
  13075. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13076. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13077. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13078. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13079. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13080. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13081. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13082. VR_APP: "port VR App",
  13083. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13084. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13085. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13086. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13087. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13088. VR_PREVIOUS_CAPS: "ANTERIOR",
  13089. VR_NEXT_CAPS: "SIGUIENTE",
  13090. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13091. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13092. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13093. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13094. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13095. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13096. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13097. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13098. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13099. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13100. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13101. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13102. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13103. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13104. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13105. VR_ANDROID_DVICES: "Dispositivos Android",
  13106. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13107. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13108. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13109. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13110. VR_DOWNLOAD_HERE: "Descargar aquí",
  13111. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13112. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13113. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13114. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13115. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13116. SHARE_TO: "Compartir en",
  13117. SHARE_LINK: "Enlace directo",
  13118. SHARE_EXPLORE: "Explorar ",
  13119. SHARE_AT: "en",
  13120. SHARE_WITH: "con",
  13121. SHARE_3D: " en 3D",
  13122. SHARE_COPIED: "¡Copiado!",
  13123. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13124. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13125. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13126. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13127. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13128. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13129. ERROR_GENERIC_ACTIONS_3: " o ",
  13130. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13131. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13132. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13133. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13134. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13135. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13136. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13137. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13138. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13139. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13140. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13141. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13142. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13143. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13144. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13145. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13146. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13147. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13148. LINK_TO_LOCATION: "Enlace a la ubicación",
  13149. MENU_COPY: "Copiar",
  13150. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13151. ROTATE: "Girar",
  13152. INSIDE: "Interior",
  13153. MOVE: "Moverse",
  13154. ZOOM: "Acercar o alejar"
  13155. }
  13156. }
  13157. , {}],
  13158. 113: [function(e, t, i) {
  13159. "use strict";
  13160. t.exports = {
  13161. PAGE_TITLE: "",
  13162. LOADING: "Chargement",
  13163. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13164. POWERED_BY: "alimenté par ",
  13165. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13166. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13167. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13168. PRESENTED_BY: "Présenté par ",
  13169. MORE: "Plus ",
  13170. LESS: "Moins ",
  13171. TAG_CONTENT: "Contenu tag™",
  13172. SHOW: "Montrer",
  13173. HIDE: "Cacher",
  13174. DOLLHOUSE: "Dollhouse",
  13175. FLOOR_PLAN: "Plan de sol",
  13176. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13177. CLOSE_HIGHLIGHTS: "Fermer",
  13178. PREVIOUS: "Précédent",
  13179. PLAY: "Lecture",
  13180. PAUSE: "Pause",
  13181. NEXT: "Suivant",
  13182. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13183. VIEW_DOLLHOUSE: "Voir dollhouse",
  13184. SOCIAL_SHARING: "Partager cet espace",
  13185. VIEW_IN_VR: "Voir en VR",
  13186. VIEW_FULLSCREEN: "Plein écran",
  13187. EXIT_FULLSCREEN: "Fermer plein écran",
  13188. ZOOM_IN: "Zoom avant",
  13189. ZOOM_OUT: "Zoom arrière",
  13190. FLOOR_NAME: "Étage ",
  13191. FLOOR_ALL: "Tous",
  13192. TERMS: "Mentions légales",
  13193. PORT_TERMS: "port mentions légales",
  13194. TERMS_OF_USE: "Conditions d'utilisation",
  13195. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13196. CLOSE_TERMS: "Fermer",
  13197. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13198. HELP: "Aide",
  13199. HELP_NAVIGATION_TAB: "Navigation",
  13200. HELP_MORE_HELP_TAB: "Aide",
  13201. CLOSE: "Fermer",
  13202. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13203. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13204. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13205. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13206. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13207. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13208. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13209. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13210. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13211. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13212. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13213. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13214. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13215. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13216. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13217. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13218. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13219. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13220. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13221. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13222. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13223. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13224. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13225. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13226. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13227. HELP_MORE_HLR_A: "Carrousel",
  13228. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13229. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13230. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13231. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13232. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13233. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13234. HELP_MORE_TAG_A: "tag™ Posts",
  13235. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13236. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13237. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13238. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13239. HELP_MORE_TOUR_A: "Commandes de la visite",
  13240. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13241. HELP_MORE_INSIDE_A: "Vue intérieure",
  13242. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13243. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13244. HELP_MORE_VR_A: "Mode RV",
  13245. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13246. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13247. HELP_MORE_360_A: "Vues 360°",
  13248. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13249. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13250. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13251. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13252. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13253. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13254. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13255. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13256. WEBVR_LEARN_MORE: "En savoir plus",
  13257. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13258. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13259. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13260. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13261. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13262. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13263. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13264. VR_NEXT_CAPS: "SUIVANT",
  13265. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13266. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13267. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13268. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13269. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13270. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13271. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13272. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13273. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13274. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13275. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13276. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13277. VR_APP: "port VR App",
  13278. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13279. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13280. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13281. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13282. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13283. 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",
  13284. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13285. VR_ANDROID_DVICES: "Appareils Android",
  13286. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13287. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13288. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13289. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13290. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13291. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13292. VR_DOWNLOAD_HERE: "Télécharger ici",
  13293. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13294. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13295. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13296. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13297. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13298. SHARE_TO: "Partager sur",
  13299. SHARE_LINK: "Lien direct",
  13300. SHARE_EXPLORE: "Explorer ",
  13301. SHARE_AT: "à",
  13302. SHARE_WITH: "avec",
  13303. SHARE_3D: " en 3D",
  13304. SHARE_COPIED: "Copié!",
  13305. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13306. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13307. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13308. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13309. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13310. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13311. ERROR_GENERIC_ACTIONS_3: " ou ",
  13312. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13313. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13314. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13315. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13316. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13317. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13318. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13319. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13320. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13321. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13322. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13323. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13324. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13325. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13326. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13327. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13328. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13329. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13330. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13331. MENU_COPY: "Copie",
  13332. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13333. ROTATE: "Faire pivoter",
  13334. INSIDE: "Intérieure",
  13335. MOVE: "Se déplacer",
  13336. ZOOM: "Zoom"
  13337. }
  13338. }
  13339. , {}],
  13340. 114: [function(e, t, i) {
  13341. "use strict";
  13342. t.exports = {
  13343. PAGE_TITLE: "",
  13344. LOADING: "読み込み中",
  13345. PRESENTED_BY_CAPS: "PRESENTED BY",
  13346. POWERED_BY: "powered by",
  13347. POWERED_BY_CAPS: "POWERED BY",
  13348. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13349. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13350. PRESENTED_BY: "Presented by ",
  13351. MORE: "全て表示 ",
  13352. LESS: "閉じる ",
  13353. TAG_CONTENT: "tag™コンテンツ ",
  13354. SHOW: "表示",
  13355. HIDE: "非表示",
  13356. DOLLHOUSE: "ドールハウス",
  13357. FLOOR_PLAN: "フロアプラン",
  13358. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13359. CLOSE_HIGHLIGHTS: "閉じる",
  13360. PREVIOUS: "前へ",
  13361. PLAY: "再生",
  13362. PAUSE: "一時停止",
  13363. NEXT: "次へ",
  13364. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13365. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13366. SOCIAL_SHARING: "このSpaceを共有する",
  13367. VIEW_IN_VR: "VRで表示",
  13368. VIEW_FULLSCREEN: "フルスクリーン表示",
  13369. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13370. ZOOM_IN: "ズームイン",
  13371. ZOOM_OUT: "ズームアウト",
  13372. FLOOR_NAME: "フロア ",
  13373. FLOOR_ALL: "すべて",
  13374. TERMS: "規約",
  13375. PORT_TERMS: "port規約",
  13376. TERMS_OF_USE: "利用規約",
  13377. CLOSE_TERMS: "閉じる",
  13378. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13379. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13380. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13381. WEBVR_ENTER_WEBVR: "VRに入る",
  13382. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13383. WEBVR_LEARN_MORE: "もっと詳しく",
  13384. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13385. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13386. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13387. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13388. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13389. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13390. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13391. VR_PREVIOUS_CAPS: "前へ",
  13392. VR_NEXT_CAPS: "次へ",
  13393. VR_GOT_IT_CAPS: "了解",
  13394. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13395. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13396. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13397. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13398. VR_WHAT_YOU_NEED: "必要なもの",
  13399. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13400. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13401. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13402. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13403. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13404. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13405. VR_APP: "port VRアプリ",
  13406. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13407. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13408. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13409. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13410. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13411. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13412. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13413. VR_ANDROID_DVICES: "Androidデバイス",
  13414. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13415. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13416. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13417. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13418. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13419. VR_APP_OPEN: "port VRアプリで開く",
  13420. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13421. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13422. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13423. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13424. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13425. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13426. SHARE_TO: "共有先",
  13427. SHARE_LINK: "ダイレクトリンク",
  13428. SHARE_EXPLORE: "探索",
  13429. SHARE_AT: "場所",
  13430. SHARE_WITH: "使用アプリ",
  13431. SHARE_3D: "3Dで",
  13432. SHARE_COPIED: "コピーされました!",
  13433. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13434. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13435. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13436. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13437. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13438. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13439. ERROR_GENERIC_ACTIONS_3: "または",
  13440. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13441. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13442. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13443. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13444. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13445. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13446. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13447. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13448. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13449. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13450. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13451. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13452. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13453. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13454. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13455. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13456. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13457. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13458. LINK_TO_LOCATION: "ロケーションへのリンク",
  13459. MENU_COPY: "コピー",
  13460. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13461. ROTATE: "回転",
  13462. MOVE: "移動",
  13463. INSIDE: "内側",
  13464. ZOOM: "ズーム",
  13465. HELP: "ヘルプ",
  13466. HELP_NAVIGATION_TAB: "ナビゲーション",
  13467. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13468. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13469. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13470. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13471. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13472. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13473. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13474. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13475. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13476. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13477. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13478. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13479. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13480. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13481. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13482. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13483. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13484. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13485. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13486. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13487. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13488. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13489. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13490. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13491. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13492. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13493. HELP_MORE_HLR_A: "ハイライト",
  13494. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13495. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13496. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13497. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13498. HELP_MORE_FLOORS_A: "フロアセレクター",
  13499. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13500. HELP_MORE_TAG_A: "tag™ Posts",
  13501. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13502. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13503. HELP_MORE_ZOOM_A: "ズームコントロール",
  13504. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13505. HELP_MORE_TOUR_A: "ツアーコントロール",
  13506. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13507. HELP_MORE_INSIDE_A: "内側ビュー",
  13508. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13509. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13510. HELP_MORE_VR_A: "VRモード",
  13511. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13512. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13513. HELP_MORE_360_A: "360° Views",
  13514. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13515. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13516. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13517. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13518. CLOSE: "閉じる"
  13519. }
  13520. }
  13521. , {}],
  13522. 115: [function(e, t, i) {
  13523. "use strict";
  13524. t.exports = {
  13525. PAGE_TITLE: "",
  13526. LOADING: "Загрузка",
  13527. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13528. POWERED_BY: "разработано на платформе ",
  13529. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13530. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13531. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13532. PRESENTED_BY: "Представлено ",
  13533. MORE: "Больше ",
  13534. LESS: "Меньше ",
  13535. TAG_CONTENT: "tag™ Контент",
  13536. SHOW: "Показать",
  13537. HIDE: "Скрыть",
  13538. DOLLHOUSE: "Dollhouse",
  13539. FLOOR_PLAN: "Планировка",
  13540. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13541. CLOSE_HIGHLIGHTS: "Закрыть",
  13542. PREVIOUS: "Предыдущий",
  13543. PLAY: "Воспроизвести",
  13544. PAUSE: "Пауза",
  13545. NEXT: "Следующий",
  13546. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13547. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13548. SOCIAL_SHARING: "Поделиться этой моделью",
  13549. VIEW_IN_VR: "Посмотреть в VR",
  13550. VIEW_FULLSCREEN: "Полный экран",
  13551. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13552. ZOOM_IN: "Увеличить",
  13553. ZOOM_OUT: "Уменьшить",
  13554. FLOOR_NAME: "Этаж ",
  13555. FLOOR_ALL: "Все",
  13556. TERMS: "Условия",
  13557. PORT_TERMS: "Правила пользования",
  13558. TERMS_OF_USE: "Условия использования",
  13559. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13560. CLOSE_TERMS: "Закрыть",
  13561. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13562. HELP: "Помощь",
  13563. HELP_NAVIGATION_TAB: "Навигация",
  13564. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13565. CLOSE: "Закрыть",
  13566. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13567. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13568. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13569. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13570. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13571. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13572. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13573. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13574. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13575. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13576. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13577. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13578. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13579. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13580. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13581. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13582. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13583. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13584. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13585. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13586. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13587. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13588. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13589. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13590. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13591. HELP_MORE_HLR_A: "Фотоколлаж",
  13592. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13593. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13594. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13595. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13596. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13597. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13598. HELP_MORE_TAG_A: "tag™ Posts",
  13599. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13600. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13601. HELP_MORE_ZOOM_A: "Масштаб",
  13602. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13603. HELP_MORE_TOUR_A: "Управление Туром",
  13604. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13605. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13606. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13607. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13608. HELP_MORE_VR_A: "Режим VR",
  13609. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13610. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13611. HELP_MORE_360_A: "360° Views",
  13612. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13613. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13614. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13615. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13616. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13617. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13618. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13619. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13620. WEBVR_LEARN_MORE: "Узнать больше",
  13621. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13622. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13623. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13624. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13625. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13626. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13627. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13628. VR_APP: "port VR App",
  13629. VR_APP_OPEN: "Или открыть через приложение port VR",
  13630. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13631. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13632. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13633. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13634. VR_VIEW_SPACE: "Запустить модель в VR",
  13635. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13636. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13637. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13638. VR_GOT_IT_CAPS: "ЯСНО",
  13639. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13640. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13641. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13642. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13643. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13644. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13645. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13646. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13647. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13648. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13649. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13650. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13651. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13652. VR_ANDROID_DVICES: "Android устройства",
  13653. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13654. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13655. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13656. VR_DOWNLOAD_HERE: "Скачать здесь",
  13657. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13658. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13659. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13660. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13661. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13662. SHARE_TO: "Поделиться",
  13663. SHARE_LINK: "Прямая ссылка",
  13664. SHARE_EXPLORE: "просмотреть",
  13665. SHARE_AT: "на",
  13666. SHARE_WITH: "с",
  13667. SHARE_3D: "в 3D",
  13668. SHARE_COPIED: "Скопировано!",
  13669. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13670. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13671. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13672. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13673. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13674. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13675. ERROR_GENERIC_ACTIONS_3: " или ",
  13676. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13677. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13678. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13679. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13680. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13681. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13682. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13683. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13684. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13685. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13686. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13687. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13688. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13689. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13690. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13691. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13692. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13693. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13694. LINK_TO_LOCATION: "Ссылка на местоположение",
  13695. MENU_COPY: "Копировать",
  13696. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13697. ROTATE: "Вращать",
  13698. MOVE: "Передвигаться",
  13699. INSIDE: "Вид изнутри",
  13700. ZOOM: "Масштаб"
  13701. }
  13702. }
  13703. , {}],
  13704. 116: [function(r, e, t) {
  13705. (function(i) {
  13706. "use strict";
  13707. function re(e) {
  13708. console.log("e1:" + e),
  13709. e = Math.round(.4 * e * 100),
  13710. console.log("e2:" + e);
  13711. var t = $(".progressbar");
  13712. t.find(".bar").css("width", e + "%"),
  13713. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13714. t.find(".perc").text(e + "%")
  13715. }
  13716. $("#gui-loading").fadeIn(200),
  13717. re(.1);
  13718. var e = g_version ? "modeldata.js" : "someData.json";
  13719. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13720. dataType: "json"
  13721. }).done(function(e) {
  13722. var t = matcher(e);
  13723. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13724. t.user = {
  13725. is_authenticated: !1,
  13726. 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"]
  13727. }
  13728. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  13729. var newImages = [];
  13730. t.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  13731. t.model.images = newImages
  13732. }catch(e){console.log(e) }
  13733. window.MP_PREFETCHED_MODELDATA = t
  13734. t.model.summary = t.summary
  13735. t.model.name = t.name
  13736. for(let i in t){
  13737. t[i] == "false" && (t[i] = false)
  13738. }
  13739. re(.7),
  13740. function() {
  13741. function y(e) {
  13742. t.update(e)
  13743. }
  13744. function A(e, t) {
  13745. ne.error(t),
  13746. n.error(t),
  13747. N.report(e, "error-" + t)
  13748. }
  13749. function C(e, t, i) {
  13750. try {
  13751. e.start(t)
  13752. } catch (e) {
  13753. throw ne.warn(e.message),
  13754. function(e) {
  13755. var t = O.details();
  13756. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13757. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13758. N.report(e, "error-webgl-generic"))
  13759. }(i.sid),
  13760. e
  13761. }
  13762. }
  13763. function I(e) {
  13764. e.stopPropagation(),
  13765. e.preventDefault()
  13766. }
  13767. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13768. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13769. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13770. });
  13771. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13772. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13773. */
  13774. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  13775. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  13776. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  13777. $("#volume").show();
  13778. }else if (g_version === "one"){
  13779. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  13780. //g_bgAudio.src = manage.dealURL(src) ;
  13781. }
  13782. //隐藏公司logo
  13783. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13784. r("./lib/three75-shim"),
  13785. r("./lib/array-polyfill"),
  13786. r("./lib/performance-polyfill"),
  13787. r("./lib/shaders/CopyShader.js"),
  13788. r("./lib/shaders/HorizontalBlurShader.js"),
  13789. r("./lib/shaders/VerticalBlurShader.js"),
  13790. r("./lib/postprocessing/EffectComposer.js"),
  13791. r("./lib/postprocessing/RenderPass.js"),
  13792. r("./lib/postprocessing/MaskPass.js"),
  13793. r("./lib/postprocessing/ShaderPass.js"),
  13794. window.Promise || (window.Promise = r("promise-polyfill"));
  13795. var E = r("three")
  13796. , _ = r("three")
  13797. , b = (r("./util/sentry"),
  13798. r("./player"))
  13799. , w = r("./director")
  13800. , T = r("./controls/CameraControls")
  13801. , x = r("./model/ModelManager")
  13802. , S = r("./DisplayController")
  13803. , M = r("./label/LabelDisplayController")
  13804. , R = r("./enum/Viewmode")
  13805. , e = r("./util/logger")
  13806. , P = r("./showcase")
  13807. , O = r("./util/browser")
  13808. , L = r("./settings")
  13809. , D = r("./gui/gui")
  13810. , n = r("./gui/error")
  13811. , N = r("./analytics")
  13812. , F = r("./util/transitions")
  13813. , B = r("./effects")
  13814. , V = r("./objects/Skybox")
  13815. , k = (r("./util/common"),
  13816. r("./util/PanoramaCollection"),
  13817. r("./util/math"),
  13818. r("./util/showcase"))
  13819. , U = r("./util/camera")
  13820. , H = (r("./objects/Panorama"),
  13821. r("./cameras/PanoramaCamera"),
  13822. r("./preloaders"))
  13823. , z = r("events").EventEmitter
  13824. , G = r("./featureflags")
  13825. , W = (r("./util/lerp"),
  13826. r("./util/ajax"),
  13827. r("./ab"))
  13828. , j = r("./sdk/automation.js")
  13829. , Y = r("./scene/SceneRenderer")
  13830. , q = r("./scene/QuickstartManager")
  13831. , X = r("./tile/QualityManager.js")
  13832. , Z = r("./localization/localize")
  13833. , K = r("./tag/tagManager")
  13834. , Q = r("./tile/TileDownloader")
  13835. , J = r("./tile/PanoRenderer")
  13836. , ee = (r("./enum/PanoSizeClass"),
  13837. r("./enum/PanoramaEvents"),
  13838. r("./enum/SceneRendererEvents"))
  13839. , t = r("./gui/memoryUsage")
  13840. , te = r("./enum/RenderLayers")
  13841. , ie = r("./TimingData")
  13842. , ne = new e(i);
  13843. e.level = L.logLevel,
  13844. e.consoleEnabled = L.console,
  13845. function() {
  13846. var e = k.getModelIDFromQueryString();
  13847. if (!e)
  13848. return A(null, "loading-failed");
  13849. var t = k.parseSidUrl(e)
  13850. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13851. , n = {
  13852. panoElementsToLoad: 6,
  13853. modelElementsToLoad: 0,
  13854. totalElementsLoaded: 0,
  13855. totalElementsToLoad: 0,
  13856. totalPercentageLoaded: 0,
  13857. progressCallback: null
  13858. }
  13859. , r = document.getElementById("player")
  13860. , o = L.quickstart.enabled
  13861. , a = null
  13862. , s = null
  13863. , l = null
  13864. , c = null
  13865. , h = null
  13866. , u = null
  13867. , d = null
  13868. , p = null
  13869. , f = null
  13870. , g = null
  13871. , m = null
  13872. , v = new ie;
  13873. !function(e) {
  13874. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13875. z.defaultMaxListeners = 1e3,
  13876. function(e) {
  13877. e.addEventListener("dragenter", I, !1),
  13878. e.addEventListener("dragover", I, !1)
  13879. }(e),
  13880. O.valueFromHash("title", !0) || $(document).ready(function() {
  13881. $(".model-title").hide()
  13882. })
  13883. }(r),
  13884. function(e) {
  13885. return G.loadFeatureFlags(e).done(function(e) {
  13886. G.updateDependentSettings(e, L)
  13887. })
  13888. }({
  13889. urlBase: t.urlBase
  13890. }).then(function() {
  13891. return Z.init(),
  13892. function(e, t) {
  13893. var i = P.getModel({
  13894. url: t,
  13895. floors: O.valueFromHash("f", !0),
  13896. autoload: !1
  13897. });
  13898. return $.when(i, y).then(null, function(e) {
  13899. return this
  13900. })
  13901. }(0, e)
  13902. }).then(function(e) {
  13903. return re(.9),
  13904. function(e, t, i, n, r) {
  13905. ne.info("Model data loaded"),
  13906. ne.debug("UUID: " + e.data.job.uuid),
  13907. W.init(G.getFlags()),
  13908. i && N.initKeen({
  13909. token: i,
  13910. appId: n
  13911. }),
  13912. N.initSegment({
  13913. model: e.sid,
  13914. version: "2.25.6-0-gd87e5b1",
  13915. startSource: r.startSource,
  13916. token: t,
  13917. autoplay: r.autoplay,
  13918. quickstart: r.quickstart
  13919. })
  13920. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13921. startSource: i,
  13922. autoplay: L.autoplay,
  13923. quickstart: o
  13924. }),
  13925. g.urls.init()
  13926. }).then(function() {
  13927. return g.loadPanos()
  13928. }).then(function() {
  13929. s = U.getStartCameraOptions(g, g.panos);
  13930. //初始画面
  13931. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  13932. $("<img/>").attr("src", e).on("load", function() {
  13933. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  13934. $(this).remove()
  13935. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  13936. })
  13937. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  13938. d = function(e) {
  13939. var t = new E.PerspectiveCamera;
  13940. t.layers.enable(te.PANOMARKERS),
  13941. t.layers.enable(te.RETICULE),
  13942. t.layers.enable(te.TAG);
  13943. var o = new E.Scene
  13944. , i = new E.AmbientLight(16777215);
  13945. return o.add(i),
  13946. o.skybox = new V,
  13947. o.add(o.skybox),
  13948. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13949. side: E.DoubleSide
  13950. })),
  13951. o.plane.position.y = 0,
  13952. o.plane.rotateX(-Math.PI / 2),
  13953. o.plane.material.visible = !1,
  13954. o.add(o.plane),
  13955. o.updateMatrixWorld(),
  13956. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13957. if (e.metadata && e.metadata.camera_position) {
  13958. var t = e.metadata.camera_position
  13959. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13960. i.position = t.clone(),
  13961. o.add(i);
  13962. var n = e.metadata.camera_quaternion
  13963. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13964. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13965. }
  13966. }),
  13967. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13968. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13969. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13970. new Y(o,t,B)
  13971. }(g),
  13972. m = function(e, t) {
  13973. var i = e ? 1 : 1e3
  13974. , n = W.tilegen || W.imgopt ? 6 : 2;
  13975. n = O.valueFromHash("tileconc", n);
  13976. var r = new X
  13977. , o = new Q({
  13978. concurrentDownloads: n
  13979. })
  13980. , a = new J
  13981. , s = new x
  13982. , l = new w
  13983. , c = new b(t)
  13984. , h = new T
  13985. , u = new S(i)
  13986. , d = new M
  13987. , p = new K;
  13988. return {
  13989. qualityManager: r,
  13990. panoRenderer: a,
  13991. tileDownloader: o,
  13992. player: c,
  13993. director: l,
  13994. modelManager: s,
  13995. tagManager: p,
  13996. displayController: u,
  13997. labelDisplayController: d,
  13998. controls: h
  13999. }
  14000. }(o, s.mode),
  14001. l = m.controls,
  14002. c = m.player,
  14003. h = m.director,
  14004. u = m.tagManager,
  14005. p = m.tileDownloader,
  14006. f = m.qualityManager,
  14007. m.panoRenderer,
  14008. function(e, t, i, n) {
  14009. var r = i.controls
  14010. , o = i.qualityManager
  14011. , a = i.panoRenderer
  14012. , s = i.tileDownloader
  14013. , l = i.modelManager;
  14014. r.init(n, l),
  14015. j.init(i.director, r, i.player, l, t),
  14016. o.init(l),
  14017. s.init(o),
  14018. a.init(t, s, o),
  14019. l.init(s, a, o),
  14020. l.addModel(e),
  14021. t.addComponent(F)
  14022. }(g, d, m, r),
  14023. c.director = h,
  14024. g.supportsTiles && p.start(),
  14025. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14026. o = !1);
  14027. var e = null;
  14028. if (o) {
  14029. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14030. var t = l.controls[R.PANORAMA];
  14031. a = new q(f,d.scene,d.camera,t,r),
  14032. C(d, r, g),
  14033. e = a.load(s).then(function() {
  14034. d.addComponent(a),
  14035. d.once(ee.AfterRender, function() {
  14036. ne.warn("First render after quickstart load finished.")
  14037. })
  14038. })
  14039. }
  14040. return window.flyToFirst = function() {
  14041. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14042. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14043. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14044. c.flyToPano({
  14045. pano: e,
  14046. lookAtPoint: i
  14047. })
  14048. }
  14049. ,
  14050. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14051. }).then(function() {
  14052. return function(e, t, i, n, r) {
  14053. return r.progressCallback = t,
  14054. N.sessionStart(),
  14055. e.load(n).progress(function(e, t) {
  14056. e.modelElementsToLoad = t[1],
  14057. function(e) {
  14058. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14059. }(e),
  14060. function(e) {
  14061. e.totalElementsLoaded++,
  14062. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14063. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14064. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14065. console.log("pro:" + e.totalPercentageLoaded),
  14066. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14067. }(e)
  14068. }
  14069. .bind(this, r))
  14070. }(g, D.onProgress, 0, !o, n)
  14071. }).then(function() {
  14072. s.quickstart = o,
  14073. function(e, t, i, n) {
  14074. var r = i.qualityManager
  14075. , o = i.panoRenderer
  14076. , a = i.tileDownloader
  14077. , s = i.modelManager
  14078. , l = i.player
  14079. , c = i.director
  14080. , h = i.tagManager
  14081. , u = i.displayController
  14082. , d = i.labelDisplayController
  14083. , p = i.controls;
  14084. t.scene.add(e),
  14085. t.qualityManager = r;
  14086. var f = {
  14087. camera: t.camera,
  14088. director: c,
  14089. modelManager: s,
  14090. tileDownloader: a,
  14091. panoRenderer: o,
  14092. qualityManager: r,
  14093. tagManager: h,
  14094. container: n,
  14095. controls: p
  14096. };
  14097. l.init(f),
  14098. l.setScene(t.scene),
  14099. h.init(s, l),
  14100. c.init(l, s),
  14101. u.init(c, l, s, h, n),
  14102. d.init(l, s, n),
  14103. B.bindEvents(l),
  14104. t.addComponent(h),
  14105. t.addComponent(l),
  14106. t.addComponent(o),
  14107. l.sceneRenderer = t
  14108. }(g, d, m, r),
  14109. d.started || C(d, r, g),
  14110. N.modelLoaded(g, c, l, L.autoplay),
  14111. function(e, t, i, n) {
  14112. return ne.info("Starting player in " + i.mode),
  14113. N.report(t.sid, "started-playing", n, i.quickstart),
  14114. e.start(i)
  14115. }(c, g, s, L.autoplay).done(function() {
  14116. h.autoTour()
  14117. }),
  14118. g.supportsTiles || new H(g,c).start();
  14119. o && (d.removeComponent(a),
  14120. a.destroy(),
  14121. s.pano.enter()),
  14122. D.init(g, h, c, l, d, s, N.getSessionId()),
  14123. D.endLoading(g, h, u),
  14124. d.once(ee.AfterRender, function() {
  14125. v.setAppReadyTime();
  14126. var e = v.calcFullLoadingTime();
  14127. ne.warn("Total load time: " + e / 1e3),
  14128. N.loadComplete(e),
  14129. ne.warn("First render after model load finished.")
  14130. }),
  14131. d.on(ee.MemoryUsageUpdated, y)
  14132. }).fail(A.bind(this, e))
  14133. }()
  14134. }()
  14135. })
  14136. }
  14137. ).call(this, "/js/main.js")
  14138. }
  14139. , {
  14140. "./DisplayController": 1,
  14141. "./TimingData": 2,
  14142. "./ab": 3,
  14143. "./analytics": 4,
  14144. "./cameras/PanoramaCamera": 7,
  14145. "./controls/CameraControls": 9,
  14146. "./director": 15,
  14147. "./effects": 16,
  14148. "./enum/PanoSizeClass": 36,
  14149. "./enum/PanoramaEvents": 37,
  14150. "./enum/RenderLayers": 41,
  14151. "./enum/SceneRendererEvents": 43,
  14152. "./enum/Viewmode": 51,
  14153. "./featureflags": 59,
  14154. "./gui/error": 64,
  14155. "./gui/gui": 65,
  14156. "./gui/memoryUsage": 73,
  14157. "./label/LabelDisplayController": 91,
  14158. "./lib/array-polyfill": 92,
  14159. "./lib/performance-polyfill": 95,
  14160. "./lib/postprocessing/EffectComposer.js": 96,
  14161. "./lib/postprocessing/MaskPass.js": 97,
  14162. "./lib/postprocessing/RenderPass.js": 98,
  14163. "./lib/postprocessing/ShaderPass.js": 99,
  14164. "./lib/shaders/CopyShader.js": 100,
  14165. "./lib/shaders/HorizontalBlurShader.js": 101,
  14166. "./lib/shaders/VerticalBlurShader.js": 102,
  14167. "./lib/three75-shim": 103,
  14168. "./localization/localize": 108,
  14169. "./tag/tagManager": 124,
  14170. "./model/ModelManager": 140,
  14171. "./objects/Panorama": 148,
  14172. "./objects/Skybox": 152,
  14173. "./player": 155,
  14174. "./preloaders": 156,
  14175. "./scene/QuickstartManager": 157,
  14176. "./scene/SceneRenderer": 158,
  14177. "./sdk/automation.js": 164,
  14178. "./settings": 166,
  14179. "./showcase": 168,
  14180. "./tile/PanoRenderer": 169,
  14181. "./tile/QualityManager.js": 170,
  14182. "./tile/TileDownloader": 171,
  14183. "./util/PanoramaCollection": 178,
  14184. "./util/ajax": 181,
  14185. "./util/browser": 182,
  14186. "./util/camera": 183,
  14187. "./util/common": 185,
  14188. "./util/lerp": 188,
  14189. "./util/logger": 189,
  14190. "./util/math": 190,
  14191. "./util/sentry": 192,
  14192. "./util/showcase": 193,
  14193. "./util/transitions": 195,
  14194. events: 202,
  14195. "promise-polyfill": 213,
  14196. three: 217
  14197. }],
  14198. 117: [function(e, t, i) {
  14199. "use strict";
  14200. function n(e) {
  14201. e = e || {},
  14202. r.RawShaderMaterial.call(this, a.extendObject({
  14203. fragmentShader: o.cube.fragmentShader,
  14204. vertexShader: o.cube.vertexShader,
  14205. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14206. name: "CubemapMaterial"
  14207. }, e))
  14208. }
  14209. var r = e("three")
  14210. , o = e("../shaders")
  14211. , a = e("../util/common");
  14212. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14213. t.exports = n
  14214. }
  14215. , {
  14216. "../shaders": 167,
  14217. "../util/common": 185,
  14218. three: 217
  14219. }],
  14220. 118: [function(e, t, i) {
  14221. "use strict";
  14222. function n(e) {
  14223. e = e || {},
  14224. r.RawShaderMaterial.call(this, a.extendObject({
  14225. fragmentShader: o.model.fragmentShader,
  14226. vertexShader: o.model.vertexShader,
  14227. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14228. name: "ModelTextureMaterial"
  14229. }, e))
  14230. }
  14231. var r = e("three")
  14232. , o = e("../shaders")
  14233. , a = e("../util/common");
  14234. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14235. i && (this.uniforms.progress.value = 0),
  14236. e.ensureSkyboxReadyForRender(),
  14237. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14238. this.uniforms.pano0Position.value.copy(e.position),
  14239. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14240. t.ensureSkyboxReadyForRender(),
  14241. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14242. this.uniforms.pano1Position.value.copy(t.position),
  14243. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14244. }
  14245. ,
  14246. t.exports = n
  14247. }
  14248. , {
  14249. "../shaders": 167,
  14250. "../util/common": 185,
  14251. three: 217
  14252. }],
  14253. 119: [function(m, v, e) {
  14254. (function(e) {
  14255. "use strict";
  14256. function t(e, t, i, n) {
  14257. this.div = null,
  14258. this.body = null,
  14259. this.label = e,
  14260. this.description = t,
  14261. this.parsedDescription = [],
  14262. this.media = i || {
  14263. type: null
  14264. },
  14265. this.loadingSpinner = null,
  14266. this.parser = new r({
  14267. supportLinks: !c.valueFromHash("mls"),
  14268. keepLinkLabels: !0
  14269. }),
  14270. this.state = g.CLOSED,
  14271. this.orientation = "",
  14272. this.initialTransform = "",
  14273. this.hovering = !1,
  14274. this.openTransition = null,
  14275. this.closeTransition = null,
  14276. this.openPromise = null,
  14277. this.closePromise = null,
  14278. this.animationTransition = null,
  14279. this.animationScale = 0
  14280. }
  14281. var r = m("../Parser/DescriptionParser")
  14282. , i = m("../Media/Link")
  14283. , n = m("../Media/Image")
  14284. , o = m("../Media/EmbedlyPlayer")
  14285. , a = m("../Media/EmbedlyEmbed")
  14286. , s = m("../../util/transitions")
  14287. , l = m("../../util/lerp")
  14288. , c = m("../../util/browser")
  14289. , b = m("./BillboardEvent")
  14290. , w = m("../Media/MediaEvent")
  14291. , h = m("../Parser/DescriptionChunkType")
  14292. , u = m("events").EventEmitter
  14293. , d = m("./billboardSettings")
  14294. , T = m("./overlaySettings")
  14295. , p = new (m("../../util/logger"))(e)
  14296. , f = document.getElementById("tag-billboards");
  14297. f.addEventListener("touchend", function(e) {
  14298. f.style.pointerEvents = "none"
  14299. }),
  14300. f.addEventListener("touchcancel", function(e) {
  14301. f.style.pointerEvents = "none"
  14302. });
  14303. var g = {
  14304. CLOSED: "closed",
  14305. OPENING: "opening",
  14306. OPEN: "open",
  14307. CLOSING: "closing",
  14308. ACTIVE: "active"
  14309. };
  14310. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14311. this.parsedDescription = this.parser.parse(this.description);
  14312. var t = document.createElement("div");
  14313. t.className = "tag-container has-hotzone",
  14314. this.div = t,
  14315. this.body = document.createElement("div"),
  14316. this.body.className = "tag-body";
  14317. var i = document.createElement("div");
  14318. i.classList.add("tag-content");
  14319. var n = document.createElement("div");
  14320. n.classList.add("tag-text-content");
  14321. var r = document.createElement("div");
  14322. r.className = "tag-label",
  14323. r.textContent = this.label,
  14324. n.appendChild(r);
  14325. var o = document.createElement("div");
  14326. o.className = "tag-desc",
  14327. n.appendChild(o),
  14328. i.appendChild(n),
  14329. this.body.appendChild(i),
  14330. this.appendDescriptionElements(this.parsedDescription, o),
  14331. this.appendMedia(),
  14332. t.appendChild(this.body),
  14333. f.appendChild(t),
  14334. this.bindEvents(t, this.body)
  14335. }
  14336. ,
  14337. t.prototype.bindEvents = function(i, e) {
  14338. function t(n) {
  14339. return function(e) {
  14340. if (!this.div.classList.contains("overlay")) {
  14341. var t, i = document.getElementById("player");
  14342. try {
  14343. t = new MouseEvent(n,e)
  14344. } catch (i) {
  14345. (t = document.createEvent("MouseEvents")).initMouseEvent(n, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  14346. }
  14347. i.dispatchEvent(t)
  14348. }
  14349. }
  14350. }
  14351. e.addEventListener("mousedown", function(e) {
  14352. e.stopPropagation()
  14353. }),
  14354. e.addEventListener("mouseup", function(e) {
  14355. e.stopPropagation()
  14356. }),
  14357. i.addEventListener("touchstart", function(e) {
  14358. f.style.pointerEvents = "auto"
  14359. }),
  14360. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14361. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14362. e.addEventListener("mouseover", function(e) {
  14363. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14364. }
  14365. .bind(this)),
  14366. i.addEventListener("mouseenter", function(e) {
  14367. this.state !== g.CLOSING && (this.hovering = !0,
  14368. this.emit(b.ENTER))
  14369. }
  14370. .bind(this)),
  14371. i.addEventListener("mouseleave", function(e) {
  14372. this.hovering = !1,
  14373. this.emit(b.LEAVE)
  14374. }
  14375. .bind(this)),
  14376. i.addEventListener("gesturestart", function(e) {
  14377. e.preventDefault()
  14378. });
  14379. var n = i.querySelector(".tag-text-content")
  14380. , r = 0;
  14381. n.addEventListener("touchstart", function(e) {
  14382. r = e.changedTouches[0].clientY
  14383. }),
  14384. n.addEventListener("touchmove", function(t) {
  14385. function e(e) {
  14386. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14387. }
  14388. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14389. }),
  14390. i.addEventListener("touchmove", function(e) {
  14391. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14392. })
  14393. }
  14394. ,
  14395. t.prototype.appendDescriptionElements = function(e, i) {
  14396. 0 < e.length && this.div.classList.add("has-text"),
  14397. e.forEach(function(e, t) {
  14398. switch (e.type) {
  14399. case h.TEXT:
  14400. i.appendChild(this.createTextElement(e.text));
  14401. break;
  14402. case h.LINK:
  14403. i.appendChild(this.createLinkElement(e.link))
  14404. }
  14405. }
  14406. .bind(this))
  14407. }
  14408. ,
  14409. t.prototype.appendLoadingSpinner = function() {
  14410. this.loadingSpinner = document.createElement("div"),
  14411. this.loadingSpinner.classList.add("loading-spinner");
  14412. var e = document.createElement("div");
  14413. e.classList.add("gui-spinner-icon"),
  14414. this.loadingSpinner.appendChild(e),
  14415. this.body.appendChild(this.loadingSpinner)
  14416. }
  14417. ,
  14418. t.prototype.onMediaLoadFinished = function() {
  14419. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14420. this.applyOrientation(this.orientation),
  14421. this.loadingSpinner = null)
  14422. }
  14423. ,
  14424. t.prototype.appendMedia = function() {
  14425. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14426. this.appendLoadingSpinner();
  14427. var e = document.createElement("div");
  14428. e.classList.add("tag-media-content");
  14429. var t = document.createElement("i");
  14430. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14431. t.classList.add(e)
  14432. }),
  14433. this.body.appendChild(t),
  14434. this.body.appendChild(e),
  14435. this.media.type) {
  14436. case h.IMAGE:
  14437. e.appendChild(this.createImageElement(this.media, this.body));
  14438. break;
  14439. case h.VIDEO:
  14440. e.appendChild(this.createVideoElement(this.media, this.body));
  14441. break;
  14442. case h.RICH:
  14443. e.appendChild(this.createEmbedElement(this.media, this.body))
  14444. }
  14445. }
  14446. }
  14447. ,
  14448. t.prototype.createTextElement = function(e) {
  14449. var t = document.createElement("span");
  14450. return t.textContent = e,
  14451. t
  14452. }
  14453. ,
  14454. t.prototype.createLinkElement = function(e) {
  14455. var t = new i(e);
  14456. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14457. t.createDomElement()
  14458. }
  14459. ,
  14460. t.prototype.createImageElement = function(t, C) {
  14461. function e() {
  14462. function e() {
  14463. p || (E.classList.remove("view-image"),
  14464. a.classList.add("overlay"),
  14465. t(),
  14466. window.addEventListener("resize", A),
  14467. a.addEventListener("click", i),
  14468. c.addEventListener("click", r),
  14469. o.addEventListener("click", n),
  14470. p = !0,
  14471. _.emit(w.IMAGE_OPENED))
  14472. }
  14473. function t() {
  14474. C.classList.add("show-info"),
  14475. s.classList.remove("collapsible"),
  14476. s.style.height = "";
  14477. var e = parseFloat(getComputedStyle(v).lineHeight)
  14478. , t = g + e
  14479. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14480. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14481. , r = n
  14482. , o = r * I.aspect;
  14483. i < o && (r = (o = i) / I.aspect),
  14484. n < r && (o = (r = n) * I.aspect),
  14485. o += m,
  14486. r += m + t,
  14487. C.style.width = o + "px",
  14488. C.style.height = r + "px",
  14489. l.style.paddingTop = e + m + "px",
  14490. 0 < _.description.length && (s.classList.add("collapsible"),
  14491. s.style.height = s.clientHeight + 12 + "px",
  14492. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14493. }
  14494. function i(e) {
  14495. e.target === a && n()
  14496. }
  14497. function n() {
  14498. p && (p = !1,
  14499. E.classList.add("view-image"),
  14500. a.classList.remove("overlay"),
  14501. s.style.height = "",
  14502. l.style.paddingTop = "",
  14503. C.style.width = "",
  14504. C.style.height = "",
  14505. window.removeEventListener("resize", A),
  14506. a.removeEventListener("click", i),
  14507. c.removeEventListener("click", r),
  14508. o.removeEventListener("click", n),
  14509. _.emit(w.IMAGE_CLOSED),
  14510. _.close(!0))
  14511. }
  14512. function r(e) {
  14513. C.classList.toggle("show-info")
  14514. }
  14515. var a = _.div
  14516. , s = a.getElementsByClassName("tag-content")[0]
  14517. , l = a.getElementsByClassName("tag-media-content")[0]
  14518. , o = C.getElementsByClassName("close")[0]
  14519. , c = s.getElementsByClassName("tag-label")[0];
  14520. a.classList.add("has-image"),
  14521. E.classList.add("view-image"),
  14522. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14523. _.applyOrientation(_.orientation);
  14524. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14525. function() {
  14526. clearInterval(h),
  14527. clearTimeout(u),
  14528. h = setInterval(function() {
  14529. var e = a.clientHeight;
  14530. d !== e && (t(),
  14531. d = e)
  14532. }, 100),
  14533. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14534. }
  14535. );
  14536. I.on(w.IMAGE_OPENING, e),
  14537. _.on(b.ACTIVATE, e),
  14538. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14539. _.on(b.CLOSING, n)
  14540. }
  14541. var I = new n
  14542. , E = I.createDomElement();
  14543. this.once(b.OPENED, function() {
  14544. I.load(t.src).then(e).catch(function(e) {
  14545. p.warn("Failed to load image:", t.src),
  14546. p.warn("with error:", e)
  14547. }).then(this.onMediaLoadFinished.bind(this))
  14548. });
  14549. var _ = this;
  14550. return E
  14551. }
  14552. ,
  14553. t.prototype.createVideoElement = function(t, e) {
  14554. var i = new o({
  14555. autoPlay: !0,
  14556. autoResume: !0,
  14557. startMuted: !1,
  14558. loop: !1
  14559. })
  14560. , n = i.createDomElement();
  14561. return this.once(b.OPENED, function() {
  14562. i.load(t.src).then(function() {
  14563. this.div.classList.add("has-video"),
  14564. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14565. i.play()),
  14566. this.on(b.OPENING, i.show.bind(i)),
  14567. this.on(b.OPENED, i.play.bind(i)),
  14568. this.on(b.CLOSING, i.pause.bind(i)),
  14569. this.on(b.CLOSED, i.hide.bind(i))
  14570. }
  14571. .bind(this)).catch(function(e) {
  14572. p.warn("Failed to embed video:", t.src),
  14573. p.warn("with error:", e)
  14574. }).then(this.onMediaLoadFinished.bind(this))
  14575. }
  14576. .bind(this)),
  14577. n
  14578. }
  14579. ,
  14580. t.prototype.createEmbedElement = function(t, e) {
  14581. var i = new a
  14582. , n = i.createDomElement();
  14583. return this.once(b.OPENED, function() {
  14584. i.load(t.src).then(function() {
  14585. this.div.classList.add("has-embed"),
  14586. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14587. this.applyOrientation(this.orientation),
  14588. this.on(b.OPENING, i.show.bind(i)),
  14589. this.on(b.CLOSED, i.hide.bind(i))
  14590. }
  14591. .bind(this)).catch(function(e) {
  14592. p.warn("Failed to embed:", t.src),
  14593. p.warn("with error:", e)
  14594. }).then(this.onMediaLoadFinished.bind(this))
  14595. }
  14596. .bind(this)),
  14597. n
  14598. }
  14599. ,
  14600. t.prototype.open = function(e) {
  14601. return this.openPromise = $.Deferred(),
  14602. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14603. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14604. this.state !== g.OPEN && (this.emit(b.OPENING),
  14605. e && this.emit(b.ACTIVATING),
  14606. this.state = g.OPENING,
  14607. this.animateOpen(function() {
  14608. e && this.setActiveState(),
  14609. this.openPromise.resolve()
  14610. }
  14611. .bind(this)))
  14612. }
  14613. .bind(this), d.animation.openDelay),
  14614. s.cancel(this.closeTransition),
  14615. this.closePromise && this.closePromise.reject(),
  14616. this.closeTransition = void 0,
  14617. this.openPromise.promise())
  14618. }
  14619. ,
  14620. t.prototype.close = function(e) {
  14621. return this.closePromise = $.Deferred(),
  14622. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14623. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14624. this.state = g.CLOSING,
  14625. this.animateClose())
  14626. }
  14627. .bind(this), d.animation.closeDelay)),
  14628. s.cancel(this.openTransition),
  14629. this.openPromise && this.openPromise.reject(),
  14630. this.openTransition = void 0,
  14631. this.closePromise.resolve(),
  14632. this.closePromise.promise())
  14633. }
  14634. ,
  14635. t.prototype.setActiveState = function() {
  14636. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14637. this.emit(b.ACTIVATE),
  14638. this.div.classList.remove("has-hotzone"))
  14639. }
  14640. ,
  14641. t.prototype.animateOpen = function(e) {
  14642. if (this.state === g.OPENING) {
  14643. if (s.cancel(this.animationTransition),
  14644. c.detectSamsungNative())
  14645. return this.boardOrientation = null,
  14646. this.div.style.visibility = "visible",
  14647. this.emit(b.OPENED),
  14648. this.state = g.OPEN,
  14649. void (e && e());
  14650. this.div.style.webkitTransform = "scale(0)",
  14651. this.div.style.transform = "scale(0)",
  14652. this.div.style.visibility = "visible",
  14653. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14654. this.emit(b.OPENED),
  14655. this.state = g.OPEN,
  14656. e && e()
  14657. }
  14658. .bind(this))
  14659. }
  14660. }
  14661. ,
  14662. t.prototype.animateClose = function(e) {
  14663. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14664. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14665. this.emit(b.CLOSED),
  14666. this.state = g.CLOSED,
  14667. this.div.style.visibility = "hidden",
  14668. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14669. e && e()
  14670. }
  14671. .bind(this)))
  14672. }
  14673. ,
  14674. t.prototype.needsUpdate = function() {
  14675. return this.state !== g.CLOSED
  14676. }
  14677. ,
  14678. t.prototype.update = function(e, t) {
  14679. if (this.needsUpdate()) {
  14680. var i = (this.updateOrientation(e),
  14681. this.calcScale(t))
  14682. , n = {
  14683. x: (e.x + 1) * $("#player").width() / 2,
  14684. y: (e.y + 1) * $("#player").height() / 2
  14685. };
  14686. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14687. this.div.style.webkitTransform = this.div.screenTransform,
  14688. this.div.style.transform = this.div.screenTransform
  14689. }
  14690. }
  14691. ,
  14692. t.prototype.getDimensions = function() {
  14693. return this.div.getBoundingClientRect()
  14694. }
  14695. ,
  14696. t.prototype.calcScale = function(e) {
  14697. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14698. }
  14699. ,
  14700. t.prototype.updateOrientation = function(e) {
  14701. if (this.state !== g.ACTIVE) {
  14702. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14703. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14704. , n = "";
  14705. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14706. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14707. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14708. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14709. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14710. }
  14711. }
  14712. ,
  14713. t.prototype.applyOrientation = function(e) {
  14714. this.div.style.transform = this.div.style.webkitTransform = "",
  14715. this.div.classList.remove("tag-container-" + this.orientation),
  14716. this.div.classList.add("tag-container-" + e);
  14717. var t = window.getComputedStyle(this.div);
  14718. this.initialTransform = t.transform || t.webkitTransform,
  14719. "none" === this.initialTransform && (this.initialTransform = "");
  14720. var i = t.transform.slice(7, -1).split(",")
  14721. , n = -i[4]
  14722. , r = -i[5];
  14723. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14724. this.div.style.transformOrigin = n + "px " + r + "px",
  14725. this.orientation = e
  14726. }
  14727. ,
  14728. v.exports = t
  14729. }
  14730. ).call(this, "/js/tag/Billboard/Billboard.js")
  14731. }
  14732. , {
  14733. "../../util/browser": 182,
  14734. "../../util/lerp": 188,
  14735. "../../util/logger": 189,
  14736. "../../util/transitions": 195,
  14737. "../Media/EmbedlyEmbed": 125,
  14738. "../Media/EmbedlyPlayer": 126,
  14739. "../Media/Image": 128,
  14740. "../Media/Link": 129,
  14741. "../Media/MediaEvent": 131,
  14742. "../Parser/DescriptionChunkType": 133,
  14743. "../Parser/DescriptionParser": 134,
  14744. "./BillboardEvent": 120,
  14745. "./billboardSettings": 121,
  14746. "./overlaySettings": 122,
  14747. events: 202
  14748. }],
  14749. 120: [function(e, t, i) {
  14750. "use strict";
  14751. t.exports = Object.freeze({
  14752. ENTER: "billboard.enter",
  14753. LEAVE: "billboard.leave",
  14754. OPENING: "billboard.opening",
  14755. OPENED: "billboard.open",
  14756. CLOSING: "billboard.closing",
  14757. CLOSED: "billboard.closed",
  14758. ACTIVATING: "billboard.activating",
  14759. ACTIVATE: "billboard.activate"
  14760. })
  14761. }
  14762. , {}],
  14763. 121: [function(e, t, i) {
  14764. "use strict";
  14765. t.exports = Object.freeze({
  14766. animation: Object.freeze({
  14767. hoverOnClosing: !1,
  14768. openDelay: 100,
  14769. closeDelay: 50,
  14770. openDuration: 200,
  14771. closeDuration: 100
  14772. }),
  14773. boardToDiscRatio: 1.2
  14774. })
  14775. }
  14776. , {}],
  14777. 122: [function(e, t, i) {
  14778. "use strict";
  14779. t.exports = Object.freeze({
  14780. boundaryWidth: 30,
  14781. boundaryHeight: 0
  14782. })
  14783. }
  14784. , {}],
  14785. hot: [function(e, t, i) {
  14786. "use strict";
  14787. function n(e, t, i) {
  14788. this.sid = e,
  14789. this.position = this.convertValue(t.position, g.Vector3)
  14790. if(t.quaternion){
  14791. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14792. }else{
  14793. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14794. }
  14795. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14796. this.isSprite = t.isSprite
  14797. this.noAction = t.noAction
  14798. this.linkType = t.linkType || "common"
  14799. this.link = t.link,
  14800. this.model = i,
  14801. this.size = t.size;
  14802. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14803. this.build()
  14804. //t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14805. this.changeTex()
  14806. if(t.infoAttribute){
  14807. this.createTitleElem(t.infoAttribute.hardware ? t.infoAttribute.hardware.name : t.infoAttribute.title)
  14808. }
  14809. this.setVisiblePanos(t.visiblePanos);
  14810. this.infoAttribute = t.infoAttribute;
  14811. }
  14812. var g = e("three")
  14813. , r = e("../shaders")
  14814. , m = e("../settings")
  14815. , v = e("../enum/Viewmode")
  14816. , d = e("../objects/Panorama")
  14817. , o = e("../util/texture")
  14818. , math = e("../util/math")
  14819. , p = new g.Raycaster
  14820. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14821. var defaultTex1 = o.load(g_HotImage.point);
  14822. var defaultTex2 = o.load(g_HotImage.point2)
  14823. n.prototype.changeTex = function(){
  14824. var u = this.mesh.material.uniforms
  14825. if(this.styleTex.length){
  14826. u.texture1.value = o.load(this.styleTex[0].src);
  14827. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14828. }else{
  14829. u.texture1.value = defaultTex1;
  14830. u.texture2.value = defaultTex2;
  14831. }
  14832. }
  14833. n.prototype.initStyleImg = function(t){
  14834. this.styleTex = []
  14835. t.styleImg = t.styleImg || [];
  14836. t.styleImg.forEach((src)=>{
  14837. this.styleTex.push({src:manage.dealURL(src)})
  14838. })
  14839. this.changeTex()
  14840. }
  14841. n.prototype.update = function(camera) {
  14842. if(this.isSprite){
  14843. this.mesh.quaternion.copy(camera.quaternion)
  14844. }
  14845. if(window.hotNeedUpdatePannel == this){
  14846. this.updatePannel()
  14847. }
  14848. }
  14849. n.prototype.setVisiblePanos = function(visibleData){
  14850. if(visibleData == "get"){
  14851. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  14852. }else if(visibleData){
  14853. this.visiblePanos = visibleData;
  14854. }
  14855. }
  14856. n.prototype.build = function() {
  14857. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14858. var e = new g.Mesh(a, new g.ShaderMaterial({
  14859. uniforms: t,
  14860. vertexShader: r.hot.vertexShader,
  14861. fragmentShader: r.hot.fragmentShader,
  14862. transparent: !0
  14863. }))
  14864. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14865. e.dynamic = !0,
  14866. e.position.copy(this.position);
  14867. e.quaternion.copy(this.quaternion)
  14868. t && e.scale.set(t, t, t),
  14869. e.name = this.sid,
  14870. e.type = "hotSprite",
  14871. (e.belongHot = this).link && (e.hotLink = this.link),
  14872. this.mesh = e,
  14873. this.model.add(e),
  14874. g_HotMeshes.push(e);
  14875. }
  14876. n.prototype.showPannel = function(){
  14877. var hardware = this.hardwareTemp || this.infoAttribute.hardware //hardwareTemp为编辑时绝对有的,如果是{}代表没有
  14878. if(hardware && hardware.id!=void 0){
  14879. $("#hotPannel>div").css("display","block");
  14880. $("#hotPannel .title").text(hardware.name);
  14881. this.updatePannel()
  14882. window.hotNeedUpdatePannel = this
  14883. return true
  14884. }else{
  14885. $("#hotPannel>div").css("display","");
  14886. window.hotNeedUpdatePannel = null
  14887. }
  14888. }
  14889. n.prototype.updatePannel = function(){
  14890. var pos = math.getPos2d(this.position, player.camera, $("#player")[0]);
  14891. if(pos.trueSide){
  14892. $("#hotPannel>div").css( {display:'block', "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14893. }else{
  14894. $("#hotPannel>div").css({display:'none'})
  14895. }
  14896. }
  14897. n.prototype.createTitleElem = function(title){
  14898. if(!title)return;
  14899. var root = $("#hot");
  14900. var elem = $(`<div> ${title}</div>`)
  14901. root.append(elem);
  14902. this.titleElem = elem;
  14903. }
  14904. n.prototype.showTitle = function(){
  14905. if(!this.titleElem)return;
  14906. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  14907. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14908. this.titleElem.css("display","block");
  14909. }
  14910. n.prototype.hideTitle = function(){
  14911. if(!this.titleElem)return;
  14912. this.titleElem.css("display","none");
  14913. }
  14914. ,
  14915. n.prototype.closestPanoTowardTag = function(e, t) {
  14916. var i = []
  14917. , n = []
  14918. , r = this.mesh.position;
  14919. if (e === v.PANORAMA) {
  14920. var o = t.position.clone().sub(r).normalize();
  14921. n.push(d.scoreFunctions.direction(r, o))
  14922. }
  14923. var a = new g.Vector3;
  14924. i.push(function(e) {
  14925. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14926. }, function(e) {
  14927. a.copy(r).sub(e.position);
  14928. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14929. , i = m.tags.navigate.tiltTolerance;
  14930. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14931. },
  14932. (pano)=>{ // add
  14933. player.checkHasNeighbor(pano)
  14934. }
  14935. ),
  14936. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14937. var s = t.model.panos.sortByScore(i, n);
  14938. if (s && m.tags.navigate.lineOfSight) {
  14939. for (var l = 0; l < s.length; l++) {
  14940. var c = s[l].pano
  14941. , h = c.position.distanceTo(r);
  14942. p.set(c.position, r.clone().sub(c.position).normalize());
  14943. var u = p.intersectObjects(t.model.colliders);
  14944. if (0 === u.length || u[0].distance > h)
  14945. return console.log(l),
  14946. c
  14947. }
  14948. return null
  14949. }
  14950. return s && 0 < s.length && s[0].pano
  14951. }
  14952. var getLink = function(link){
  14953. var src = '';
  14954. var r = link.substring(link.indexOf("html") + 4)
  14955. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14956. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  14957. return src
  14958. }
  14959. n.prototype.examine = function(e, options) {
  14960. options = options || {}
  14961. var hotPop = document.getElementById('popup');
  14962. var hasHardware
  14963. if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  14964. hasHardware = this.showPannel();
  14965. if(player.mode != 'panorama' || !player.currentPano)return;
  14966. }else{
  14967. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  14968. var src = getLink(this.infoAttribute.iframe[0]);
  14969. if(this.linkType=="jumpLink"){
  14970. var newPage = window.open(src, "_blank" );
  14971. newPage.focus();
  14972. }else if(this.linkType=="iframeDiv"){
  14973. var div = document.createElement("div");
  14974. $("body").append(div);
  14975. div.style.position = 'fixed';
  14976. div.style.width = div.style.height = "100%";
  14977. div.style.left = div.style.top = '0';
  14978. div.style["z-index"] = "999"
  14979. var exit = document.createElement("div");
  14980. exit.style["background-image"] = "url(images/vrOffImg.png)";
  14981. exit.style.position = 'absolute';
  14982. exit.style.width = exit.style.height = "50px";
  14983. exit.style.left = '17px'; exit.style.top = "20px"
  14984. exit.style.cursor = "pointer";
  14985. exit.style["background-repeat"] = "no-repeat";
  14986. exit.style["background-size"] = "25%";
  14987. exit.style["background-position"] = "center center";
  14988. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  14989. exit.style["border-radius"] = "50%";
  14990. exit.style["z-index"] = "3"
  14991. exit.onclick = ()=>{
  14992. $(div).remove()
  14993. if(g_bgAudio && g_bgAudio.pauseByHot){
  14994. manage.switchBgmState(true)
  14995. }
  14996. }
  14997. var myElement = document.createElement("iframe");
  14998. myElement.style.position = 'absolute';
  14999. myElement.style.width = myElement.style.height = "100%";
  15000. myElement.style.left = myElement.style.top = '0';
  15001. myElement.src = src
  15002. div.appendChild(exit);
  15003. div.appendChild(myElement)
  15004. if(g_bgAudio && !g_bgAudio.paused){
  15005. manage.switchBgmState(false);
  15006. g_bgAudio.pauseByHot = true
  15007. }
  15008. if(g_tourAudio)g_tourAudio.pause()
  15009. }
  15010. return;
  15011. }
  15012. }
  15013. if(!player.currentPano)return;
  15014. var i = document.getElementById("popup");
  15015. if (this.link && !options.dontOpen && !hasHardware) {
  15016. g_currentHot = this,
  15017. i.style.display = "block",
  15018. i.classList.add("wait");
  15019. var n = document.createElement("iframe");
  15020. if(g_bgAudio && !g_bgAudio.paused){
  15021. manage.switchBgmState(false);
  15022. g_bgAudio.pauseByHot = true
  15023. }
  15024. if(g_tourAudio)g_tourAudio.pause()
  15025. var src = getLink(this.link )
  15026. n.src = src;
  15027. n.id = "id1",
  15028. n.allowTransparency = "true";
  15029. var a = document.getElementById("id1");
  15030. if (void 0 === a || null == a) {
  15031. document.querySelector(".popup-content").appendChild(n);
  15032. var s = !1;
  15033. window.loaddingSuccess = function() {
  15034. s = !0
  15035. }
  15036. ,
  15037. setTimeout(function e() {
  15038. if (s) {
  15039. var t = document.querySelector("#id1").contentWindow.document;
  15040. t.querySelector("video") && (t.querySelector("video").play(),
  15041. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15042. t.querySelector("audio") && t.querySelector("audio").play()
  15043. } else
  15044. setTimeout(e, 300)
  15045. }, 800)
  15046. }
  15047. }
  15048. var l = e.mode
  15049. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15050. , h = this.mesh.position;
  15051. e.flyingToTag = !0;
  15052. var u = function() {
  15053. e.flyingToTag = !1;
  15054. options.dontOpen || this.link && i.classList.remove("wait")
  15055. }
  15056. .bind(this);
  15057. if (l === v.PANORAMA) {
  15058. var d = {
  15059. pano: c,
  15060. lookAtPoint: h,
  15061. duration: null,
  15062. maxDistanceOverride: null,
  15063. skipWarpingCheck: !1
  15064. };
  15065. e.flyToPano(d, u)
  15066. } else {
  15067. var p = {
  15068. pano: c
  15069. };
  15070. if (h) {
  15071. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15072. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15073. }
  15074. p.callback = u,
  15075. p.duration = 1500,
  15076. p.mode = v.PANORAMA,
  15077. e.flyToNewMode(p)
  15078. }
  15079. }
  15080. ,
  15081. n.prototype.dispose = function(){
  15082. this.mesh.parent.remove(this.mesh);
  15083. var index = g_HotMeshes.indexOf(this.mesh);
  15084. g_HotMeshes.splice(index,1)
  15085. }
  15086. /* n.prototype.conversionArray = function(e) {
  15087. if ("[object Array]" == Object.prototype.toString.call(e))
  15088. return e;
  15089. var t = [];
  15090. for (var i in e)
  15091. t.push(parseFloat(e[i]));
  15092. return t
  15093. } */
  15094. n.prototype.convertValue = function(v ,Type){
  15095. var value;
  15096. if(v instanceof Array){
  15097. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15098. value = new Type().fromArray(v);
  15099. }else{
  15100. for(let i in v){v[i] = parseFloat(v[i])}
  15101. value = new Type().copy(v);
  15102. }
  15103. return value
  15104. }
  15105. ,
  15106. t.exports = n
  15107. }
  15108. , {
  15109. three: 217,
  15110. "../shaders": 167,
  15111. "../enum/Viewmode": 51,
  15112. "../objects/Panorama": 148,
  15113. "../util/texture": 194,
  15114. "../settings": 166,
  15115. "../util/math": 190,
  15116. }],
  15117. 123: [function(M, R, e) {
  15118. (function(e) {
  15119. "use strict";
  15120. function d(e, t, i) {
  15121. var n = i.version || "0";
  15122. "0" !== n && w.info("tag defined using version " + n),
  15123. this.model = e,
  15124. this.sid = t,
  15125. this.color = (new f.Color).set(i.color || o.tagDefault),
  15126. this.hoverColor = o._darken(this.color, .2),
  15127. this.floor = null,
  15128. this.floorIndex = i.floor,
  15129. this.mode = m.PANORAMA,
  15130. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15131. this.obj3d = null,
  15132. this.disc = null,
  15133. this.materials = {
  15134. disc: null,
  15135. pole: null
  15136. },
  15137. this.position = (new f.Vector3).copy(i.position),
  15138. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15139. this.discWorldPosition = null,
  15140. this.discScale = .05,
  15141. this.poleEnabled = i.stem.enabled,
  15142. this.billboard = new r(i.label,i.description,i.media,this),
  15143. this.visibleTransition = null,
  15144. this.hoveringDisc = !1
  15145. }
  15146. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  15147. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="), x = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"), S = new f.PlaneBufferGeometry(1,1);
  15148. d.prototype = Object.create(b.prototype),
  15149. d.raycaster = new f.Raycaster,
  15150. d.prototype.bindEvents = function() {
  15151. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15152. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15153. }
  15154. ,
  15155. d.prototype.build = function() {
  15156. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15157. this.floor && (this.billboard.build(this.model.sid),
  15158. this.obj3d = this.buildObject3D(),
  15159. this.floor.add(this.obj3d)),
  15160. this
  15161. }
  15162. ,
  15163. d.prototype.buildObject3D = function() {
  15164. var e = new f.Object3D;
  15165. e.position.copy(this.position);
  15166. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15167. t.bg.value = x,
  15168. t.mask.value = T,
  15169. t.color.value.copy(this.color),
  15170. this.materials.disc = new f.RawShaderMaterial({
  15171. transparent: !0,
  15172. vertexShader: A.tagDisc.vertexShader,
  15173. fragmentShader: A.tagDisc.fragmentShader,
  15174. uniforms: t
  15175. }),
  15176. this.disc = new f.Mesh(S,this.materials.disc),
  15177. this.disc.layers.set(a.TAG),
  15178. this.disc.position.copy(this.discPosition),
  15179. this.disc.renderOrder = s.tagDisc;
  15180. var i = (this.disc.tag = this).buildPole();
  15181. return i.layers.set(a.TAG),
  15182. i.renderOrder = s.tagStem,
  15183. e.add(i),
  15184. e.layers.set(a.TAG),
  15185. e.add(this.disc)
  15186. }
  15187. ,
  15188. d.prototype.buildPole = function() {
  15189. var e = new f.BufferGeometry
  15190. , t = new Float32Array(6);
  15191. return t[0] = t[1] = t[2] = 0,
  15192. t[3] = this.discPosition.x,
  15193. t[4] = this.discPosition.y,
  15194. t[5] = this.discPosition.z,
  15195. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15196. this.materials.pole = new f.LineBasicMaterial({
  15197. linewidth: g.tags.pole.width,
  15198. color: g.tags.pole.color,
  15199. opacity: 0,
  15200. visible: this.poleEnabled,
  15201. transparent: !0,
  15202. depthWrite: !1
  15203. }),
  15204. new f.Line(e,this.materials.pole)
  15205. }
  15206. ,
  15207. d.prototype.setFreeState = function(e) {
  15208. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15209. this.materials.disc.uniforms.color.value = this.color
  15210. }
  15211. .bind(this))
  15212. }
  15213. ,
  15214. d.prototype.setHoverState = function(e) {
  15215. this.billboard.open(e),
  15216. this.materials.disc.uniforms.color.value = this.hoverColor
  15217. }
  15218. ,
  15219. d.prototype.hide = function(e, t) {
  15220. var i = $.Deferred();
  15221. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15222. return i.resolve().promise();
  15223. e = e || 0,
  15224. t = t || 0,
  15225. C.cancel(this.visibleTransition);
  15226. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15227. return this.visibleTransition = C.start((n = this,
  15228. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15229. o = I.property(n.materials.pole, "opacity", 0),
  15230. function(e) {
  15231. r(e),
  15232. n.materials.pole && o(e)
  15233. }
  15234. ), s * a, function() {
  15235. i.resolve()
  15236. }, l, E[g.warp.blendEasing]),
  15237. i.promise()
  15238. }
  15239. ,
  15240. d.prototype.show = function(e, t) {
  15241. var i = $.Deferred();
  15242. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15243. return i.resolve().promise();
  15244. e = e || 0,
  15245. t = t || 0,
  15246. C.cancel(this.visibleTransition);
  15247. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15248. return this.visibleTransition = C.start((n = this,
  15249. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15250. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15251. function(e) {
  15252. r(e),
  15253. n.materials.pole && o(e)
  15254. }
  15255. ), s * a, function() {
  15256. i.resolve()
  15257. }, l, E[g.warp.blendEasing]),
  15258. i.promise()
  15259. }
  15260. ,
  15261. d.prototype.closestPanoTowardTag = function(e, t) {
  15262. var i = []
  15263. , n = []
  15264. , r = this.disc.getWorldPosition();
  15265. if (e === m.PANORAMA) {
  15266. var o = t.position.clone().sub(r).normalize();
  15267. i.push(y.filters.isPanoAligned()),
  15268. i.push(y.filters.inPanoDirection(r, o, .5)),
  15269. i.push(y.filters.isNeighbourPanoTo(t)),
  15270. n.push(y.scoreFunctions.direction(r, o))
  15271. }
  15272. var a = new f.Vector3;
  15273. i.push(function(e) {
  15274. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15275. }, function(e) {
  15276. a.copy(r).sub(e.position);
  15277. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15278. , i = g.tags.navigate.tiltTolerance;
  15279. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15280. }),
  15281. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15282. var s = this.model.panos.sortByScore(i, n);
  15283. if (g.tags.navigate.lineOfSight) {
  15284. for (var l = 0; l < s.length; l++) {
  15285. var c = s[l].pano
  15286. , h = c.position.distanceTo(r);
  15287. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15288. return null;
  15289. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15290. var u = d.raycaster.intersectObjects(this.model.colliders);
  15291. if (0 === u.length || u[0].distance > h)
  15292. return c
  15293. }
  15294. return null
  15295. }
  15296. return 0 < s.length && s[0].pano
  15297. }
  15298. ,
  15299. d.prototype.examine = function(i) {
  15300. if(!player.currentPano)return;
  15301. var e = i.mode
  15302. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15303. , t = this.disc.getWorldPosition();
  15304. this.billboard.setActiveState();
  15305. var r = function() {
  15306. var e = this.billboard.getDimensions()
  15307. , t = new f.Vector3;
  15308. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15309. t.unproject(i.camera),
  15310. i.flyToPano({
  15311. pano: n,
  15312. lookAtPoint: t
  15313. })
  15314. }
  15315. .bind(this);
  15316. if (e === m.PANORAMA)
  15317. if (n !== i.currentPano) {
  15318. var o = {
  15319. pano: n,
  15320. lookAtPoint: t,
  15321. duration: null,
  15322. maxDistanceOverride: null,
  15323. skipWarpingCheck: !1
  15324. };
  15325. i.flyToPano(o, r)
  15326. } else
  15327. setTimeout(function() {
  15328. this.billboard.open().then(function() {
  15329. r()
  15330. })
  15331. }
  15332. .bind(this), 0);
  15333. else {
  15334. var a = {
  15335. pano: n
  15336. };
  15337. if (t) {
  15338. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15339. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15340. }
  15341. a.callback = r,
  15342. a.duration = 1500,
  15343. a.mode = m.PANORAMA,
  15344. i.flyToNewMode(a)
  15345. }
  15346. }
  15347. ,
  15348. d.prototype.update = (n = new f.Vector3,
  15349. function(e, t) {
  15350. this.discWorldPosition = this.disc.getWorldPosition(),
  15351. this.updateDisc(e, t),
  15352. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15353. n.z < 1 && (n.y *= -1,
  15354. this.billboard.update(n, this.getDiscRadius(n, t))))
  15355. }
  15356. ),
  15357. d.prototype.updateDisc = (l = new f.Vector3,
  15358. c = new f.Vector3,
  15359. h = new f.Vector3,
  15360. u = new f.Vector3,
  15361. p = new f.Vector3,
  15362. function(e, t) {
  15363. var i = g.tags.visibility
  15364. , n = g.tags.disc.scale
  15365. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15366. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15367. this.obj3d.visible) {
  15368. this.disc.quaternion.copy(t.quaternion);
  15369. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15370. l.copy(this.discWorldPosition).project(t),
  15371. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15372. h.set(o / 2, 0, 0).add(c),
  15373. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15374. p.copy(u).unproject(t);
  15375. var a = p.distanceTo(this.discWorldPosition)
  15376. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15377. this.discScale = a * s,
  15378. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15379. }
  15380. }
  15381. ),
  15382. d.prototype.getDiscRadius = (i = new f.Vector3,
  15383. function(e, t) {
  15384. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15385. Math.abs(e.x - i.x) * $("#player").width()
  15386. }
  15387. ),
  15388. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15389. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15390. }
  15391. ,
  15392. d.prototype.offScreen = function(e, t) {
  15393. var i = e.getWorldPosition().project(t);
  15394. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15395. }
  15396. ,
  15397. d.viewportScale = function() {
  15398. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15399. d.viewportHeight = $("#player").height(),
  15400. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15401. d.currentViewportScale
  15402. }
  15403. ,
  15404. R.exports = d
  15405. }
  15406. ).call(this, "/js/tag/tag.js")
  15407. }
  15408. , {
  15409. "../enum/Colors": 19,
  15410. "../enum/RenderLayers": 41,
  15411. "../enum/RenderOrder": 42,
  15412. "../enum/Viewmode": 51,
  15413. "../objects/Panorama": 148,
  15414. "../settings": 166,
  15415. "../shaders": 167,
  15416. "../util/common": 185,
  15417. "../util/easing": 186,
  15418. "../util/lerp": 188,
  15419. "../util/logger": 189,
  15420. "../util/math": 190,
  15421. "../util/texture": 194,
  15422. "../util/transitions": 195,
  15423. "./Billboard/Billboard": 119,
  15424. "./Billboard/BillboardEvent": 120,
  15425. events: 202,
  15426. three: 217
  15427. }],
  15428. 124: [function(M, R, e) {
  15429. (function(e) {
  15430. "use strict";
  15431. function t() {
  15432. this.tagState = T.IDLE,
  15433. this.intersectTag = null,
  15434. this.hoveredTag = null,
  15435. this.activeTag = null,
  15436. this.tagDiscs = [],
  15437. this.raycaster = new i.Raycaster,
  15438. this.modelManager = null,
  15439. this.player = null,
  15440. this.totaltags = 0,
  15441. this.navigatingViaTag = !1,
  15442. this.enabled = !1
  15443. }
  15444. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15445. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15446. r.extend(t, x),
  15447. t.prototype.init = function(e, t) {
  15448. this.modelManager = e,
  15449. this.player = t,
  15450. this.updateModel(),
  15451. this.bindEvents()
  15452. }
  15453. ,
  15454. t.prototype.update = function(e) {
  15455. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15456. }
  15457. ,
  15458. t.prototype.updateTags = function(e, t, i, n) {
  15459. for (var r in this.model.tags)
  15460. this.model.tags[r].update(e, t, i, n)
  15461. }
  15462. ,
  15463. t.prototype.updateModel = function() {
  15464. this.model = this.modelManager.getActiveModel(),
  15465. this.gettagsFromModel(),
  15466. this.totaltags = Object.keys(this.model.tags).length
  15467. }
  15468. ,
  15469. t.prototype.gettagsFromModel = function() {
  15470. for (var e in this.tagDiscs = [],
  15471. this.model.tags) {
  15472. var t = this.model.tags[e].disc;
  15473. t && this.tagDiscs.push(t)
  15474. }
  15475. }
  15476. ,
  15477. t.prototype.bindEvents = function() {
  15478. function e() {
  15479. Object.keys(this.model.tags).forEach(function(e) {
  15480. var t = this.model.tags[e];
  15481. t.bindEvents(),
  15482. t.billboard.on(y.LINK_CLICK, function(e) {
  15483. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15484. }
  15485. .bind(this)),
  15486. t.billboard.on(y.IMAGE_OPENED, function() {
  15487. this.tagState = T.EXAMINE,
  15488. this.emit(y.IMAGE_OPENED)
  15489. }
  15490. .bind(this)),
  15491. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15492. }
  15493. .bind(this))
  15494. }
  15495. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15496. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15497. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15498. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15499. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15500. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15501. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15502. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15503. e.call(this)
  15504. }
  15505. ,
  15506. t.prototype.navigateViaLink = function(e) {
  15507. var t = a.deserialize(e);
  15508. if (t)
  15509. if (t.mode === C.PANORAMA) {
  15510. try {
  15511. this.player.model.panos.get(t.panoId)
  15512. } catch (e) {
  15513. return void S.warn("Unable to find panorama location", t.panoId)
  15514. }
  15515. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15516. } else {
  15517. var i = {
  15518. cameraMode: t.mode,
  15519. position: t.position,
  15520. quaternion: t.quaternion,
  15521. scanId: t.panoId,
  15522. orthoZoom: t.zoom,
  15523. floorVisibility: t.floorVisibility,
  15524. thumbUrl: null,
  15525. name: null
  15526. };
  15527. this.player.flyToNewMode({
  15528. mode: t.mode,
  15529. duration: m.warp.outsideTime,
  15530. warpDest: new g(i),
  15531. force: !0
  15532. })
  15533. }
  15534. }
  15535. ,
  15536. t.prototype.handleWarpStart = function(e, t, i, n) {
  15537. this.dismissExaminedTag(),
  15538. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15539. e && (i = E.END),
  15540. this.hideShowTagsForBlackoutStyle(i, n))
  15541. }
  15542. ,
  15543. t.prototype.handleWarpInterruption = function(e, t, i) {
  15544. null != i || (i = m.warp.teleportTime),
  15545. this.hideShowTagsForBlackoutStyle(t, i)
  15546. }
  15547. ,
  15548. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15549. var i = 0
  15550. , n = 0
  15551. , r = t / 2;
  15552. switch (null != e || (e = E.MIDDLE),
  15553. e) {
  15554. case E.END:
  15555. this.hideAlltags(r);
  15556. break;
  15557. case E.BEGINNING:
  15558. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15559. break;
  15560. case E.NONE:
  15561. break;
  15562. case E.MIDDLE:
  15563. n = i = r,
  15564. this.hideAlltags(n),
  15565. setTimeout(function() {
  15566. this.showAlltags(i)
  15567. }
  15568. .bind(this), n);
  15569. break;
  15570. case E.FADEIN:
  15571. setTimeout(function() {
  15572. this.showAlltags(r)
  15573. }
  15574. .bind(this), r)
  15575. }
  15576. }
  15577. ,
  15578. t.prototype.onPlayerModeChanging = function(e, t) {
  15579. t !== C.PANORAMA && this.dismissExaminedTag(),
  15580. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15581. var i = t !== C.OUTDOOR;
  15582. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15583. }
  15584. ,
  15585. t.prototype.onPanoChange = function(e, t) {
  15586. var i = this.navigatingViaTag;
  15587. if (this.navigatingViaTag = !1,
  15588. !i) {
  15589. this.dismissExaminedTag();
  15590. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15591. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15592. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15593. }
  15594. }
  15595. ,
  15596. t.prototype.onPlayerReady = function(e, t, i) {
  15597. this.startAlltags(e, t ? i : null)
  15598. }
  15599. ,
  15600. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15601. this.updateClosestTags(e)
  15602. }
  15603. ,
  15604. t.prototype.dismissExaminedTag = function() {
  15605. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15606. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15607. this.hoveredTag = null)
  15608. }
  15609. ,
  15610. t.prototype.startAlltags = function(e, t) {
  15611. this.model.shouldShowtags = m.tags.enabled,
  15612. this.enabled = !0,
  15613. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15614. t && setTimeout(function() {
  15615. this.activateTag(this.model.getTagBySid(t))
  15616. }
  15617. .bind(this), m.tags.startup.fadeInDuration / 2))
  15618. }
  15619. ,
  15620. t.prototype.showAlltags = function(e, t, i) {
  15621. function n() {
  15622. ++o === this.totaltags && (this.model.tagsShown = !0,
  15623. r.resolve())
  15624. }
  15625. var r = $.Deferred();
  15626. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15627. return r.resolve().promise();
  15628. var o = 0;
  15629. for (var a in this.model.tags) {
  15630. this.model.tags[a].show(e, t).done(n.bind(this))
  15631. }
  15632. return r.promise()
  15633. }
  15634. ,
  15635. t.prototype.hideAlltags = function(e, t) {
  15636. function i() {
  15637. ++r === this.totaltags && (this.model.tagsShown = !1,
  15638. n.resolve())
  15639. }
  15640. var n = $.Deferred()
  15641. , r = 0;
  15642. for (var o in this.model.tags) {
  15643. var a = this.model.tags[o];
  15644. a.hide(e, t).done(i.bind(this)),
  15645. a === this.activeTag && this.dismissActiveTag()
  15646. }
  15647. return n.promise()
  15648. }
  15649. ,
  15650. t.prototype.enableHovering = function() {
  15651. this.enabled = !0
  15652. }
  15653. ,
  15654. t.prototype.disableHovering = function() {
  15655. this.enabled = !1
  15656. }
  15657. ,
  15658. t.prototype.activateTag = function(e, t) {
  15659. t = t || T.EXAMINE,
  15660. this.activeTag = e,
  15661. this.activeTag.hoveringDisc = !0,
  15662. this.activeTag.setHoverState(t === T.EXAMINE),
  15663. this.tagState = t,
  15664. this.emit(b.TagActivated, e)
  15665. }
  15666. ,
  15667. t.prototype.dismissActiveTag = function() {
  15668. this.activeTag.hoveringDisc = !1,
  15669. this.activeTag.setFreeState(!0);
  15670. var e = this.activeTag;
  15671. this.activeTag = null,
  15672. this.tagState = T.IDLE,
  15673. this.emit(b.TagDismissed, e)
  15674. }
  15675. ,
  15676. t.prototype.clickedOnTag = function(e) {
  15677. var t = function() {
  15678. this.navigatingViaTag = !0,
  15679. this.activeTag.examine(this.player),
  15680. this.emit(b.TagNavigation, this.activeTag)
  15681. }
  15682. .bind(this);
  15683. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15684. this.activeTag = this.intersectTag,
  15685. t(),
  15686. !0) : (this.dismissActiveTag(),
  15687. !1)
  15688. }
  15689. ,
  15690. t.prototype.intersecttag = (s = new i.Vector3,
  15691. l = new i.Vector3,
  15692. c = new i.Vector3,
  15693. function(e, t, i) {
  15694. if (!this.enabled)
  15695. return null;
  15696. var n = null
  15697. , r = this.tagDiscs.filter(function(e) {
  15698. return e.parent.visible
  15699. });
  15700. if (0 < r.length) {
  15701. var o = this.model.floors.reduce(function(e, t) {
  15702. return t.hidden ? e : e.concat(t.collider.children)
  15703. }, r);
  15704. s.set(e.x, e.y, -1).unproject(i),
  15705. l.set(e.x, e.y, 1).unproject(i),
  15706. c.copy(l).sub(s).normalize(),
  15707. this.raycaster.set(s, c);
  15708. var a = this.raycaster.intersectObjects(o);
  15709. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15710. }
  15711. return this.intersectTag = n,
  15712. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15713. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15714. this.hoveredTag = n
  15715. }
  15716. .bind(this)),
  15717. n.billboard.on(v.LEAVE, function() {
  15718. this.hoveredTag = null
  15719. }
  15720. .bind(this))),
  15721. this.activateTag(n, T.BROWSE))),
  15722. n
  15723. }
  15724. ),
  15725. t.prototype.rankedtagInDirection = (h = [],
  15726. u = [],
  15727. d = new i.Vector3,
  15728. p = new i.Vector3,
  15729. f = new i.Vector3,
  15730. function(e, t, i, n) {
  15731. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15732. var a = this.closesttags[o];
  15733. p.copy(a.position),
  15734. p.add(a.discPosition),
  15735. d.copy(t),
  15736. d.sub(p).negate(),
  15737. d.normalize();
  15738. var s = d.dot(n);
  15739. if (0 <= s && (f.copy(p),
  15740. f.project(i),
  15741. this.intersecttag(f, !1, i))) {
  15742. if (r >= h.length)
  15743. for (var l = 0; l < 64; l++)
  15744. h.push({
  15745. tag: a,
  15746. dot: s
  15747. });
  15748. var c = h[r];
  15749. c.tag = a,
  15750. c.dot = s,
  15751. c.position = math.projectPositionToCanvas(p, i),
  15752. u.push(c),
  15753. r++
  15754. }
  15755. }
  15756. return u.sort(function(e, t) {
  15757. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15758. }),
  15759. e < u.length ? u[e].tag : null
  15760. }
  15761. ),
  15762. t.prototype.updateClosestTags = (o = new i.Vector3,
  15763. function(e) {
  15764. this.closesttags || (this.closesttags = []),
  15765. this.closesttags.length = 0;
  15766. var t = this.model.tags;
  15767. if (t)
  15768. for (var i in t)
  15769. if (t.hasOwnProperty(i)) {
  15770. var n = t[i]
  15771. , r = n.position;
  15772. o.copy(e),
  15773. o.sub(r).negate(),
  15774. o.lengthSq() < 30 && this.closesttags.push(n)
  15775. }
  15776. }
  15777. ),
  15778. R.exports = t
  15779. }
  15780. ).call(this, "/js/tag/tagManager.js")
  15781. }
  15782. , {
  15783. "../controls/serializer": 14,
  15784. "../enum/BlackoutStyle": 18,
  15785. "../enum/tagEvents": 32,
  15786. "../enum/ModelManagerEvents": 33,
  15787. "../enum/PlayerEvents": 40,
  15788. "../enum/TagStates": 44,
  15789. "../enum/Viewmode": 51,
  15790. "../enum/WarpStyle": 52,
  15791. "../objects/Snapshot": 153,
  15792. "../settings": 166,
  15793. "../util/common": 185,
  15794. "../util/lerp": 188,
  15795. "../util/logger": 189,
  15796. "./Billboard/BillboardEvent": 120,
  15797. "./Media/LinkType": 130,
  15798. "./Media/MediaEvent": 131,
  15799. events: 202,
  15800. three: 217
  15801. }],
  15802. 125: [function(r, o, e) {
  15803. (function(e) {
  15804. "use strict";
  15805. function t() {
  15806. this.embedWrapper = null,
  15807. this.embedElement = null
  15808. }
  15809. var i = r("../../util/ajax")
  15810. , a = r("./mediaSettings")
  15811. , n = r("../../settings")
  15812. , s = new (r("../../util/logger"))(e);
  15813. t.prototype.createDomElement = function() {
  15814. return this.embedWrapper = document.createElement("div"),
  15815. this.embedWrapper.classList.add("tag-embed"),
  15816. this.embedWrapper.classList.add("hidden"),
  15817. this.embedWrapper
  15818. }
  15819. ,
  15820. t.prototype.load = function(e) {
  15821. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15822. return new Promise(function(r, o) {
  15823. i.get(t).then(function(e) {
  15824. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15825. this.embedWrapper.innerHTML = e.html;
  15826. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15827. if (this.embedWrapper.style.width = t + "px",
  15828. e.height) {
  15829. var i = e.height / e.width;
  15830. this.embedWrapper.style.height = t * i + "px"
  15831. }
  15832. this.embedElement = this.embedWrapper.firstChild;
  15833. var n = [];
  15834. try {
  15835. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15836. } catch (e) {
  15837. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15838. }
  15839. n.forEach(function(e) {
  15840. e.setAttribute("target", "_blank")
  15841. }),
  15842. this.embedElement.classList.add("hidden"),
  15843. this.embedWrapper.classList.remove("hidden"),
  15844. r()
  15845. } else
  15846. o("Not a valid embed")
  15847. }
  15848. .bind(this), function(e) {
  15849. o(e.response)
  15850. })
  15851. }
  15852. .bind(this))
  15853. }
  15854. ,
  15855. t.prototype.show = function() {
  15856. this.embedElement && this.embedElement.classList.remove("hidden")
  15857. }
  15858. ,
  15859. t.prototype.hide = function() {
  15860. this.embedElement && this.embedElement.classList.add("hidden")
  15861. }
  15862. ,
  15863. o.exports = t
  15864. }
  15865. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15866. }
  15867. , {
  15868. "../../settings": 166,
  15869. "../../util/ajax": 181,
  15870. "../../util/logger": 189,
  15871. "./mediaSettings": 132
  15872. }],
  15873. 126: [function(a, s, e) {
  15874. (function(e) {
  15875. "use strict";
  15876. function t(e) {
  15877. r.call(this),
  15878. this.options = e,
  15879. this.playerControls = null,
  15880. this.state = o.NOT_READY
  15881. }
  15882. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15883. Object.freeze({
  15884. NOT_READY: "player.not.ready",
  15885. CUED: "player.cued",
  15886. PLAYING: "player.playing",
  15887. PAUSED: "player.paused"
  15888. }));
  15889. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15890. return this.embedWrapper = document.createElement("div"),
  15891. this.embedWrapper.classList.add("tag-video"),
  15892. this.embedWrapper.classList.add("hidden"),
  15893. this.embedWrapper
  15894. }
  15895. ,
  15896. t.prototype.load = function(e) {
  15897. var t = function() {
  15898. function e(e) {
  15899. this.playerState = e
  15900. }
  15901. this.playerControls = new playerjs.Player(this.embedElement),
  15902. this.playerControls.on("ready", function(e) {
  15903. this.playerState = o.CUED,
  15904. this.options.startMuted && this.playerControls.mute()
  15905. }
  15906. .bind(this)),
  15907. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15908. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15909. this.playerControls.on("ended", function(e) {
  15910. this.playerControls.setCurrentTime(0),
  15911. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15912. }
  15913. .bind(this))
  15914. }
  15915. .bind(this);
  15916. return r.prototype.load.call(this, e).then(t.bind(this))
  15917. }
  15918. ,
  15919. t.prototype.play = (i = n.isMobile(),
  15920. function() {
  15921. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15922. }
  15923. ),
  15924. t.prototype.pause = function() {
  15925. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15926. }
  15927. ,
  15928. s.exports = t
  15929. }
  15930. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15931. }
  15932. , {
  15933. "../../util/browser": 182,
  15934. "../../util/logger": 189,
  15935. "./EmbedlyEmbed": 125
  15936. }],
  15937. 127: [function(t, i, e) {
  15938. (function(e) {
  15939. "use strict";
  15940. var r = t("../../util/ajax")
  15941. , o = new (t("./mediaSettings"),
  15942. t("../../util/logger"))(e)
  15943. , a = Promise.resolve();
  15944. i.exports.enqueue = function(i) {
  15945. function n() {}
  15946. return a = new Promise(function(e, t) {
  15947. a.catch(n).then(function() {
  15948. (o.debug("requesting file from embedly:", i.href),
  15949. r.get(i.href, {
  15950. responseType: i.responseType
  15951. }).then(function(e) {
  15952. return o.debug("requesting file finished:", i.href),
  15953. e
  15954. })).then(e, t)
  15955. })
  15956. }
  15957. )
  15958. }
  15959. }
  15960. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15961. }
  15962. , {
  15963. "../../util/ajax": 181,
  15964. "../../util/logger": 189,
  15965. "./mediaSettings": 132
  15966. }],
  15967. 128: [function(s, l, e) {
  15968. (function(e) {
  15969. "use strict";
  15970. function t() {
  15971. this.imageWrapper = null,
  15972. this.width = 0,
  15973. this.height = 0,
  15974. this.aspect = 1
  15975. }
  15976. var i = s("./MediaEvent")
  15977. , n = s("./EmbedlyQueue")
  15978. , r = s("events").EventEmitter
  15979. , o = s("../../util/logger")
  15980. , a = s("../../settings");
  15981. new o(e),
  15982. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15983. return this.imageWrapper = document.createElement("div"),
  15984. this.imageWrapper.classList.add("tag-image"),
  15985. this.imageWrapper.classList.add("hidden"),
  15986. this.imageWrapper.addEventListener("click", function(e) {
  15987. e.stopPropagation(),
  15988. this.emit(i.IMAGE_OPENING),
  15989. this.imageWrapper.style.pointerEvents = "none"
  15990. }
  15991. .bind(this)),
  15992. this.imageWrapper
  15993. }
  15994. ,
  15995. t.prototype.onClosed = function() {
  15996. this.imageWrapper.style.pointerEvents = "auto"
  15997. }
  15998. ,
  15999. t.prototype.load = function(e) {
  16000. var t = Math.max(window.screen.height, window.screen.width)
  16001. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16002. return new Promise(function(o, e) {
  16003. n.enqueue({
  16004. href: i,
  16005. responseType: "arraybuffer"
  16006. }).then(function(e) {
  16007. var t = new Uint8Array(e)
  16008. , i = new Blob([t])
  16009. , n = new window.Image;
  16010. n.addEventListener("load", function(e) {
  16011. var t = e.target;
  16012. this.width = t.naturalWidth,
  16013. this.height = t.naturalHeight,
  16014. this.aspect = this.width / this.height;
  16015. var i = e.target.src;
  16016. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16017. this.imageWrapper.style.width = this.width + "px",
  16018. this.imageWrapper.style.height = this.height + "px",
  16019. this.imageWrapper.classList.remove("hidden"),
  16020. o()
  16021. }
  16022. .bind(this));
  16023. var r = URL.createObjectURL(i);
  16024. n.src = r
  16025. }
  16026. .bind(this), e)
  16027. }
  16028. .bind(this))
  16029. }
  16030. ,
  16031. l.exports = t
  16032. }
  16033. ).call(this, "/js/tag/Media/Image.js")
  16034. }
  16035. , {
  16036. "../../settings": 166,
  16037. "../../util/logger": 189,
  16038. "./EmbedlyQueue": 127,
  16039. "./MediaEvent": 131,
  16040. events: 202
  16041. }],
  16042. 129: [function(e, t, i) {
  16043. "use strict";
  16044. function n(e) {
  16045. this.label = e.label,
  16046. this.href = e.url,
  16047. this.type = this.updateLinkForType(),
  16048. this.domElement = null,
  16049. this.id = c++
  16050. }
  16051. var r = e("./LinkType")
  16052. , o = e("./MediaEvent")
  16053. , a = e("../../util/browser")
  16054. , s = e("../../analytics")
  16055. , l = e("events").EventEmitter
  16056. , c = 0;
  16057. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16058. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16059. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  16060. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16061. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16062. r.MODEL) : r.EXT_LINK
  16063. }
  16064. ;
  16065. var h = {};
  16066. n.prototype.createDomElement = function() {
  16067. if (this.domElement = document.createElement("a"),
  16068. this.domElement.classList.add("tag-link"),
  16069. this.domElement.textContent = this.label,
  16070. this.type === r.EXT_LINK) {
  16071. this.domElement.textContent += " ";
  16072. var e = document.createElement("i");
  16073. e.classList.add("icon-ext-link"),
  16074. e.title = "Link to external web site",
  16075. this.domElement.appendChild(e)
  16076. }
  16077. return this.domElement.addEventListener("click", function(e) {
  16078. switch (e.stopPropagation(),
  16079. h[this.id] = !0,
  16080. s.trackAlways("click_tag_link", {
  16081. link_type: this.type,
  16082. link_count: c,
  16083. links_clicked: Object.keys(h).length
  16084. }),
  16085. this.type) {
  16086. case r.MODEL:
  16087. window.location.replace(this.href);
  16088. break;
  16089. case r.EXT_LINK:
  16090. window.open(this.href, "_blank")
  16091. }
  16092. this.emit(o.LINK_CLICK, {
  16093. type: this.type,
  16094. url: this.href
  16095. })
  16096. }
  16097. .bind(this)),
  16098. this.domElement
  16099. }
  16100. ,
  16101. t.exports = n
  16102. }
  16103. , {
  16104. "../../analytics": 4,
  16105. "../../util/browser": 182,
  16106. "./LinkType": 130,
  16107. "./MediaEvent": 131,
  16108. events: 202
  16109. }],
  16110. 130: [function(e, t, i) {
  16111. "use strict";
  16112. t.exports = {
  16113. NAVIGATION: "navigation",
  16114. MODEL: "model",
  16115. EXT_LINK: "ext-link"
  16116. }
  16117. }
  16118. , {}],
  16119. 131: [function(e, t, i) {
  16120. "use strict";
  16121. t.exports = Object.freeze({
  16122. LINK_CLICK: "mtmedia.link",
  16123. IMAGE_LOADED: "mtmedia.image.loaded",
  16124. IMAGE_OPENING: "mtmedia.image.opening",
  16125. IMAGE_OPENED: "mtmedia.image.opened",
  16126. IMAGE_CLOSING: "mtmedia.image.closing",
  16127. IMAGE_CLOSED: "mtmedia.image.closed",
  16128. VIDEO_START: "mtmedia.video.start",
  16129. VIDEO_PAUSE: "mtmedia.video.pause",
  16130. VIDEO_ENDED: "mtmedia.video.end"
  16131. })
  16132. }
  16133. , {}],
  16134. 132: [function(e, t, i) {
  16135. "use strict";
  16136. t.exports = Object.freeze({
  16137. maxEmbedWidth: 350,
  16138. defaultAspectRatio: .75
  16139. })
  16140. }
  16141. , {}],
  16142. 133: [function(e, t, i) {
  16143. "use strict";
  16144. t.exports = Object.freeze({
  16145. TEXT: "text",
  16146. LINK: "link",
  16147. IMAGE: "photo",
  16148. VIDEO: "video",
  16149. RICH: "rich"
  16150. })
  16151. }
  16152. , {}],
  16153. 134: [function(e, t, i) {
  16154. "use strict";
  16155. function n(e) {
  16156. this.capabilities = {
  16157. links: {
  16158. enable: e.supportLinks,
  16159. keepLabels: e.keepLinkLabels
  16160. }
  16161. }
  16162. }
  16163. var r = e("./DescriptionChunkType");
  16164. n.prototype.parse = function(e, i) {
  16165. var n = [];
  16166. return e.split("[").map(function(e, t) {
  16167. return 0 === t ? e : "[" + e
  16168. }).forEach(function(e) {
  16169. var t = this.findMarkdown(e);
  16170. if (t) {
  16171. if (-1 !== t.url.indexOf("javascript:"))
  16172. return;
  16173. this.addLinkChunk(n, t, i),
  16174. this.addTextChunk(n, e.slice(t.markdown.length))
  16175. } else
  16176. this.addTextChunk(n, e)
  16177. }
  16178. .bind(this)),
  16179. n
  16180. }
  16181. ,
  16182. n.prototype.findMarkdown = function(e) {
  16183. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16184. if (t) {
  16185. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16186. 0 !== n); )
  16187. r++;
  16188. var o = i.length - r;
  16189. return {
  16190. markdown: t[0].substring(0, t[0].length - o),
  16191. label: t[1],
  16192. url: t[2].substring(0, r)
  16193. }
  16194. }
  16195. }
  16196. ,
  16197. n.prototype.addTextChunk = function(e, t) {
  16198. 0 !== t.length && e.push({
  16199. type: r.TEXT,
  16200. text: t
  16201. })
  16202. }
  16203. ,
  16204. n.prototype.addLinkChunk = function(e, t) {
  16205. if (this.capabilities.links.enable) {
  16206. var i = {
  16207. label: t.label,
  16208. url: t.url
  16209. };
  16210. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16211. e.push({
  16212. type: r.LINK,
  16213. link: i
  16214. })
  16215. } else
  16216. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16217. }
  16218. ,
  16219. t.exports = n
  16220. }
  16221. , {
  16222. "./DescriptionChunkType": 133
  16223. }],
  16224. 135: [function(t, r, e) {
  16225. (function(e) {
  16226. "use strict";
  16227. var i = new (t("../util/logger"))(e)
  16228. , n = {
  16229. parseIdsFromChunkName: function(e, t) {
  16230. t.floorId = n.parseFloor(e),
  16231. t.roomId = n.parseRoom(e)
  16232. },
  16233. parseFloor: function(e) {
  16234. var t = e.match(/_group([0-9]+)/);
  16235. if (!t)
  16236. return 0;
  16237. try {
  16238. return parseInt(t[1], 10)
  16239. } catch (e) {
  16240. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16241. 0
  16242. }
  16243. },
  16244. parseRoom: function(e) {
  16245. var t = e.match(/_sub([0-9]+)/);
  16246. if (!t)
  16247. return -1;
  16248. try {
  16249. return parseInt(t[1], 10)
  16250. } catch (e) {
  16251. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16252. 0
  16253. }
  16254. }
  16255. };
  16256. r.exports = n
  16257. }
  16258. ).call(this, "/js/model/Chunks.js")
  16259. }
  16260. , {
  16261. "../util/logger": 189
  16262. }],
  16263. 136: [function(a, c, e) {
  16264. (function(e) {
  16265. "use strict";
  16266. function t(e) {
  16267. r.call(this),
  16268. this.model = e,
  16269. this.exploded = !1
  16270. }
  16271. var i = a("../objects/Floor")
  16272. , n = (a("../settings"),
  16273. a("../util/logger"))
  16274. , s = a("../util/transitions")
  16275. , r = a("../util/IndexedCollection")
  16276. , o = a("../util/common")
  16277. , l = a("../util/easing");
  16278. new n(e),
  16279. o.inherit(t, r),
  16280. t.prototype.add = function(e) {
  16281. r.prototype.add.call(this, e),
  16282. this.model.add(e)
  16283. }
  16284. ,
  16285. t.prototype.getIndex = function(e) {
  16286. return e.floorIndex
  16287. }
  16288. ,
  16289. t.prototype.build = function() {
  16290. this.list.forEach(function(e) {
  16291. e.build()
  16292. })
  16293. }
  16294. ,
  16295. t.prototype.size = function() {
  16296. return this.length
  16297. }
  16298. ,
  16299. t.prototype.sort = function() {
  16300. r.prototype.sort.call(this, function(e, t) {
  16301. return e.floorIndex - t.floorIndex
  16302. })
  16303. }
  16304. ,
  16305. t.prototype.nextFloor = function(e, t) {
  16306. return this.index[e.floorIndex + t] || null
  16307. }
  16308. ,
  16309. t.prototype.getFloorAtPoint = function(e) {
  16310. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16311. var r = this.list[n]
  16312. , o = r.distanceToPoint(e);
  16313. (!t || o < i) && (i = o,
  16314. t = r)
  16315. }
  16316. return t
  16317. }
  16318. ,
  16319. t.prototype.getOrMakeFloor = function(e) {
  16320. var t = this.index[e];
  16321. return t || (t = new i(this.model,e),
  16322. this.add(t)),
  16323. t
  16324. }
  16325. ,
  16326. t.prototype.hide = function() {
  16327. this.list.forEach(function(e) {
  16328. e.hide()
  16329. })
  16330. }
  16331. ,
  16332. t.prototype.show = function() {
  16333. this.list.forEach(function(e) {
  16334. e.show()
  16335. })
  16336. }
  16337. ,
  16338. t.prototype.names = function() {
  16339. return this.list.reduce(function(e, t) {
  16340. return e.concat(t.name)
  16341. }, [])
  16342. }
  16343. ,
  16344. t.prototype.toggleExplodeHorizontal = function() {
  16345. function i(e, t) {
  16346. a.copy(e.position),
  16347. e.position.x = r[e.floorIndex] * t,
  16348. e.position.y = 1 * e.floorIndex * t,
  16349. a.sub(e.position).multiplyScalar(-1),
  16350. e.panos.forEach(function(e) {
  16351. e.translate(a)
  16352. })
  16353. }
  16354. var n, r = [], o = 0;
  16355. this.list.forEach(function(e, t, i) {
  16356. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16357. o += n,
  16358. r[t] = o
  16359. }),
  16360. r = r.map(function(e) {
  16361. return e - o / 2
  16362. });
  16363. var a = this.list[0].position.clone();
  16364. this.exploded ? this.list.forEach(function(t) {
  16365. s.start(function(e) {
  16366. i(t, 1 - e)
  16367. }, 1500, null, 0, l.easeOutExpo)
  16368. }) : this.list.forEach(function(t) {
  16369. s.start(function(e) {
  16370. i(t, e)
  16371. }, 1500, null, 0, l.easeOutExpo)
  16372. }),
  16373. this.exploded = !this.exploded
  16374. }
  16375. ,
  16376. t.prototype.toggleExplodeVertical = function() {
  16377. function i(e, t) {
  16378. var i = i.copy(e.position);
  16379. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16380. i.sub(e.position).multiplyScalar(-1),
  16381. e.panos.forEach(function(e) {
  16382. e.translate(i)
  16383. })
  16384. }
  16385. var n = this.model.size;
  16386. this.list[0].position.clone(),
  16387. this.exploded ? this.list.forEach(function(t) {
  16388. s.start(function(e) {
  16389. i(t, 1 - e)
  16390. }, 1500, null, 0, l.easeOutExpo)
  16391. }) : this.list.forEach(function(t) {
  16392. s.start(function(e) {
  16393. i(t, e)
  16394. }, 1500, null, 0, l.easeOutExpo)
  16395. }),
  16396. this.exploded = !this.exploded
  16397. }
  16398. ,
  16399. c.exports = t
  16400. }
  16401. ).call(this, "/js/model/FloorCollection.js")
  16402. }
  16403. , {
  16404. "../objects/Floor": 146,
  16405. "../settings": 166,
  16406. "../util/IndexedCollection": 175,
  16407. "../util/common": 185,
  16408. "../util/easing": 186,
  16409. "../util/logger": 189,
  16410. "../util/transitions": 195
  16411. }],
  16412. 137: [function(r, o, e) {
  16413. (function(e) {
  16414. "use strict";
  16415. function h() {
  16416. n.call(this)
  16417. }
  16418. var u = r("../settings")
  16419. , t = r("../util/logger")
  16420. , d = r("../enum/Viewmode")
  16421. , p = r("../objects/Snapshot")
  16422. , i = (r("../util/math"),
  16423. r("../util/common"))
  16424. , n = r("../util/IndexedCollection")
  16425. , l = new t(e);
  16426. i.inherit(h, n),
  16427. h.prototype.getImage = function(e) {
  16428. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16429. }
  16430. ,
  16431. h.prototype.filterByModesAndReel = function(e, t) {
  16432. for (var i = [], n = 0; n < t.length; n += 1) {
  16433. var r = t[n]
  16434. , o = this.index[r.sid];
  16435. o && i.push(o)
  16436. }
  16437. var a = e[d.DOLLHOUSE]
  16438. , s = e[d.FLOORPLAN];
  16439. (i = i.filter(function(e) {
  16440. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16441. return !0;
  16442. var t;
  16443. try {
  16444. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16445. } catch (e) {
  16446. return l.debug(e.message),
  16447. !1
  16448. }
  16449. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16450. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16451. this.list = i,
  16452. this.reIndex()
  16453. }
  16454. ,
  16455. h.prototype.getHeroLocations = function(e) {
  16456. if (0 === this.list.length)
  16457. return [];
  16458. for (var t = [], i = 0; i < this.list.length; ++i) {
  16459. var n = this.list[i]
  16460. , r = n.thumbnail_signed_src
  16461. , o = n.name || "";
  16462. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16463. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16464. var a = e.get(n.metadata.scan_id);
  16465. if (a && !a.isAligned())
  16466. continue
  16467. }
  16468. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16469. if (s === d.MESH)
  16470. continue;
  16471. if(window.isLocal)var src = manage.dealURL(r)
  16472. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16473. var l = {
  16474. cameraMode: s,
  16475. position: n.metadata.camera_position,
  16476. quaternion: n.metadata.camera_quaternion,
  16477. zoom: n.metadata.zoom,
  16478. panoId: n.metadata.scan_id,
  16479. orthoZoom: n.metadata.ortho_zoom,
  16480. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16481. thumbUrl: src,
  16482. name: h.filterImageName(o),
  16483. sid: n.sid
  16484. }
  16485. , c = new p(l);
  16486. t.push(c)
  16487. }
  16488. }
  16489. return t
  16490. }
  16491. ,
  16492. h.prototype.getIndex = function(e) {
  16493. return e.sid
  16494. }
  16495. ,
  16496. h.filterImageName = function(e) {
  16497. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16498. }
  16499. ,
  16500. o.exports = h
  16501. }
  16502. ).call(this, "/js/model/ImageCollection.js")
  16503. }
  16504. , {
  16505. "../enum/Viewmode": 51,
  16506. "../objects/Snapshot": 153,
  16507. "../settings": 166,
  16508. "../util/IndexedCollection": 175,
  16509. "../util/common": 185,
  16510. "../util/logger": 189,
  16511. "../util/math": 190
  16512. }],
  16513. 138: [function(h, u, e) {
  16514. (function(e) {
  16515. "use strict";
  16516. function n() {
  16517. c.call(this)
  16518. }
  16519. var r = h("../label/Label")
  16520. , i = h("../settings")
  16521. , t = h("../util/logger")
  16522. , o = h("../util/math")
  16523. , a = h("../util/ajax")
  16524. , s = h("./RoomCollection")
  16525. , l = h("../util/common")
  16526. , c = h("../util/IndexedCollection");
  16527. new t(e),
  16528. l.inherit(n, c),
  16529. n.prototype.getIndex = function(e) {
  16530. return e.labelId
  16531. }
  16532. ,
  16533. n.prototype.associateWithRooms = function(e) {
  16534. this.forEach(function(t) {
  16535. e.forEach(function(e) {
  16536. e.roomId === t.roomId && (t.room = e)
  16537. })
  16538. })
  16539. }
  16540. ,
  16541. n.prototype.createFromLabelData = function(e) {
  16542. e.forEach(function(e) {
  16543. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16544. t = s.generateRoomId(e.floorId, t);
  16545. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16546. i.position = o.convertWorkshopVector(i.position),
  16547. this.add(i),
  16548. i.build()
  16549. }
  16550. .bind(this))
  16551. }
  16552. ,
  16553. n.prototype.load = function(e, t) {
  16554. return a.get(e, {
  16555. responseType: "json",
  16556. auth: t ? i.authorizationHeader : null
  16557. }).done(function(e) {
  16558. var t = [];
  16559. for (var i in e) {
  16560. var n = e[i];
  16561. t.push(n)
  16562. }
  16563. this.createFromLabelData(t)
  16564. }
  16565. .bind(this))
  16566. }
  16567. ,
  16568. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16569. var t = -1;
  16570. if (e) {
  16571. var i = e.split("_");
  16572. t = parseInt(i[0])
  16573. }
  16574. return t
  16575. }
  16576. ,
  16577. u.exports = n
  16578. }
  16579. ).call(this, "/js/model/LabelCollection.js")
  16580. }
  16581. , {
  16582. "../label/Label": 90,
  16583. "../settings": 166,
  16584. "../util/IndexedCollection": 175,
  16585. "../util/ajax": 181,
  16586. "../util/common": 185,
  16587. "../util/logger": 189,
  16588. "../util/math": 190,
  16589. "./RoomCollection": 141
  16590. }],
  16591. 139: [function(P, O, e) {
  16592. (function(e) {
  16593. "use strict";
  16594. function t(e, t) {
  16595. o.Object3D.call(this),
  16596. this.sid = window.number;//t.sid,
  16597. this.data = t,
  16598. this.options = e,
  16599. this.urls = new i(e.urlFiles),
  16600. this.isPublic = void 0 !== t.is_public && t.is_public,
  16601. this.images = new E(this),
  16602. this.images.extend(t.images),
  16603. this.heroImage = this.images.getImage(t.icon),
  16604. this.heroLocations = [],
  16605. this.outdoorPanoLocations = [],
  16606. this.floors = new c(this),
  16607. this.floorsEnabled = void 0 === e.floors || e.floors,
  16608. this.changingFloor = !1,
  16609. this.chunks = [],
  16610. this.panos = new g,
  16611. this.colliders = [],
  16612. this.loadPanosPromise = null,
  16613. this.loadMeshTexturesPromise = null,
  16614. this.auxDataPromise = null,
  16615. this.meshTexturesLoaded = !1,
  16616. this.meshTextures = [],
  16617. this.tags = {},
  16618. this.tagsShown = !1,
  16619. this.shouldShowtags = !1,
  16620. this.has360Views = !1,
  16621. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16622. this.supportedModes = {},
  16623. this.supportedModes[s.PANORAMA] = !0,
  16624. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16625. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16626. this.supportedModes[s.TRANSITIONING] = !0,
  16627. this.supportsTiles = this.configureTiling(),
  16628. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16629. this.mode = s.DOLLHOUSE,
  16630. this.size = null,
  16631. this.center = null,
  16632. this.boundingBox = new o.Box3,
  16633. this.currentFloor = null,
  16634. this.allFloorsVisible = !0,
  16635. this.projectedPano0 = null,
  16636. this.projectedPano1 = null,
  16637. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16638. this.addFloor(new r(this,t,e.trim()))
  16639. }
  16640. .bind(this)),
  16641. this.waitQueue = [],
  16642. this.on("load", function(e) {
  16643. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16644. return !e.isLoadedCallback()
  16645. }),
  16646. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16647. }
  16648. .bind(this)),
  16649. this.setupCustomProperties(),
  16650. this.hots = {}
  16651. }
  16652. var o = P("three")
  16653. , a = P("../util/ajax")
  16654. , i = P("../util/ModelUrls")
  16655. , n = P("../objects/BoundingTextureSkybox")
  16656. , s = P("../enum/Viewmode")
  16657. , l = P("../enum/RenderOrder")
  16658. , r = (P("../enum/AlignmentType"),
  16659. P("../objects/Floor"))
  16660. , c = P("./FloorCollection")
  16661. , h = P("../objects/Chunk")
  16662. , u = (P("../objects/Room"),
  16663. P("../objects/Snapshot"),
  16664. P("../label/Label"),
  16665. P("../util/math"),
  16666. P("../settings"))
  16667. , d = P("../shaders")
  16668. , p = P("../util/logger")
  16669. , f = (P("../tag/tag"),
  16670. P("../tag/tagManager"),
  16671. P("../objects/Panorama"))
  16672. , g = P("../util/PanoramaCollection")
  16673. , m = P("../loaders/ModelLoader")
  16674. , v = P("../loaders/ModelTextureLoader")
  16675. , y = P("../loaders/SweepDataLoader")
  16676. , A = P("../util/transitions")
  16677. , C = (P("../util/easing"),
  16678. P("../util/lerp"),
  16679. P("../util/common"))
  16680. , I = (P("../util/texture"),
  16681. P("./../util/browser"))
  16682. , E = P("./ImageCollection")
  16683. , _ = P("./RoomCollection")
  16684. , b = P("./LabelCollection")
  16685. , w = P("./Chunks")
  16686. , T = P("./../util/showcase")
  16687. , x = P("../exception/BasicException")
  16688. , S = (P("../constants"),
  16689. P("events").EventEmitter)
  16690. , M = P("hot")
  16691. , R = new p(e);
  16692. t.prototype = Object.create(o.Object3D.prototype),
  16693. C.extend(t, S),
  16694. t.prototype.setupCustomProperties = function() {
  16695. var t = u.modelAlpha;
  16696. Object.defineProperty(this, "alpha", {
  16697. get: function() {
  16698. return t
  16699. },
  16700. set: function(e) {
  16701. t = e,
  16702. this.chunks.forEach(function(e) {
  16703. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16704. })
  16705. }
  16706. })
  16707. }
  16708. ,
  16709. t.prototype.configureTiling = function() {
  16710. var e = function() {
  16711. try {
  16712. var e = document.createElement("canvas")
  16713. , t = e.getContext("webgl");
  16714. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16715. } catch (e) {
  16716. return 0
  16717. }
  16718. }();
  16719. if (e < 2048)
  16720. return !1;
  16721. R.warn("Max cube texture size: " + e);
  16722. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16723. var i = u.tiling.tilingFlagNames[t];
  16724. if ("1" === I.valueFromHash(i, null))
  16725. return !0;
  16726. if ("0" === I.valueFromHash(i, null))
  16727. return !1
  16728. }
  16729. return !!T.modelDataPromisesTiles(this.data)
  16730. }
  16731. ,
  16732. t.prototype.toggleAlpha = function() {
  16733. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16734. }
  16735. ,
  16736. t.prototype.load = function(e) {
  16737. var t = this.urls.init().then(function() {
  16738. return $.when(this.loadPanos(), this.loadMesh())
  16739. }
  16740. .bind(this));
  16741. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16742. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16743. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16744. }
  16745. ,
  16746. t.prototype.loadMesh = function() {
  16747. var n = $.Deferred()
  16748. , r = this;
  16749. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16750. if (0 === e.length) {
  16751. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16752. r.supportedModes[s.DOLLHOUSE] = !1,
  16753. r.supportedModes[s.FLOORPLAN] = !1;
  16754. var i = new h({
  16755. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16756. });
  16757. i.material.visible = !1,
  16758. i.rotateX(-Math.PI / 2),
  16759. i.geometry.computeBoundingBox(),
  16760. e = [i]
  16761. }
  16762. e.forEach(function(e) {
  16763. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16764. r.addChunk(t, e)
  16765. }),
  16766. r.floors.sort(),
  16767. n.resolve(r)
  16768. }, function(e, t) {
  16769. n.notify(e, t)
  16770. }, function(e) {
  16771. R.error(e),
  16772. n.reject("loading-failed")
  16773. }),
  16774. n.promise()
  16775. }
  16776. ,
  16777. t.prototype.loadMeshTextures = function() {
  16778. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16779. this.meshTexturesLoaded = !0
  16780. }
  16781. .bind(this))),
  16782. this.loadTexturesPromise
  16783. }
  16784. ,
  16785. t.prototype.shineHots = function() {
  16786. A.trigger({
  16787. func: function(e) {
  16788. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16789. for(var i in this.hots){
  16790. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16791. }
  16792. }
  16793. .bind(this),
  16794. cycling: !0,
  16795. duration: 3e3,
  16796. name: "hotShine"
  16797. })
  16798. }
  16799. ,
  16800. t.prototype.createHotItem = function(e, t) {
  16801. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16802. var o = document.createElement("li")
  16803. , a = document.createElement("span");
  16804. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16805. o.hot = t[n[r]],
  16806. o.appendChild(a),
  16807. i.appendChild(o)
  16808. }
  16809. document.querySelector("#hotListContent ul").appendChild(i),
  16810. console.log(i)
  16811. }
  16812. ,
  16813. t.prototype.loadOverlays = function(overlays){
  16814. var overlays = window.data2 && window.data2.overlays /* ||
  16815. [
  16816. { depth: 0.02,
  16817. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16818. hasBox: 0,
  16819. height: 0.8165,
  16820. media: ["video"],
  16821. pos: [-4.3132, 0.6788, -13.5162],
  16822. qua: [0, 0.9396, 0, 0.3421],
  16823. sid: "1591079418827",
  16824. width: 0.6124
  16825. }] */
  16826. overlays && overlays.forEach((info)=>{
  16827. new Overlay(info)
  16828. })
  16829. }
  16830. ,
  16831. t.prototype.loadhots = function() {
  16832. var r = $.Deferred()
  16833. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16834. return a.get(e, {
  16835. responseType: "json",
  16836. auth: this.isPublic ? null : u.authorizationHeader
  16837. }).done(function(e) {
  16838. window.data2 = e;
  16839. if(!e){
  16840. console.error("data2 is null")
  16841. }else{
  16842. g_data2 = hotMatcher(e)
  16843. this.hotsCount = 0;
  16844. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16845. window.hotData = {}
  16846. if(e.hots){
  16847. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16848. sids.forEach((sid)=>{
  16849. this.hotsCount++,
  16850. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16851. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16852. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16853. window.hotData[sid] = e.hots[sid];
  16854. })
  16855. }
  16856. this.createHotItem(window.hotData, this.hots);
  16857. g_index = I.valueFromHash("m"),
  16858. e.tourAudio && (g_tourAudio = new Audio,
  16859. g_tourAudio.loop = !1,
  16860. g_tourAudio.addEventListener("ended", function() {
  16861. var e = document.createEvent("MouseEvent");
  16862. e.initEvent("tourAudioEnded", !0, !0),
  16863. window.dispatchEvent(e)
  16864. }));
  16865. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16866. //window.wx && manage.weixinShare(),
  16867. }
  16868. /* var i = $.Deferred()
  16869. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16870. a.get(n, {
  16871. responseType: "json",
  16872. auth: this.isPublic ? null : u.authorizationHeader
  16873. }).done(function(e) {
  16874. window.hotData = e,
  16875. this.createHotItem(e, this.hots);
  16876. for(let i in this.hots){
  16877. e[i] && this.hots[i].initStyleImg(e[i]);
  16878. }
  16879. i.resolve()
  16880. }
  16881. .bind(this)).fail(function() {
  16882. console.log("Data.js is empty");
  16883. i.resolve()
  16884. }),
  16885. */
  16886. r.resolve()
  16887. }
  16888. .bind(this)).fail(function() {
  16889. console.log("没有热点"),
  16890. //window.wx && manage.weixinShare(),
  16891. r.resolve()
  16892. }),
  16893. r
  16894. }
  16895. ,
  16896. t.prototype.loadPanos = function() {
  16897. if (this.loadPanosPromise)
  16898. return this.loadPanosPromise;
  16899. var e = new y(this);
  16900. return this.loadPanosPromise = e.load().then(function(e) {
  16901. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16902. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16903. else console.log(e.uuid)
  16904. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16905. }
  16906. .bind(this))),
  16907. this.panos.extend(e.map(function(e) {
  16908. return new f(this,e.uuid,e,this.supportsTiles)
  16909. }
  16910. .bind(this))),
  16911. this.panos.forEach(function(i) {
  16912. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16913. var t = this.panos.get(e);
  16914. t && this.panos.setNeighbour(i, t, !0)
  16915. }
  16916. .bind(this)),
  16917. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16918. }
  16919. .bind(this)),
  16920. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16921. this.supportedModes[s.PANORAMA] = !1),
  16922. $.when(this)
  16923. }
  16924. .bind(this)),
  16925. this.loadPanosPromise
  16926. }
  16927. ,
  16928. t.prototype.loadHighlightReel = function() {
  16929. var t = $.Deferred()
  16930. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16931. return a.get(e, {
  16932. responseType: "json",
  16933. auth: this.isPublic ? null : u.authorizationHeader
  16934. }).done(function(e) {
  16935. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16936. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16937. t.resolve()
  16938. }
  16939. .bind(this)).fail(function() {
  16940. R.warn("Getting highlight reel failed, no highlights available"),
  16941. t.resolve()
  16942. }),
  16943. t
  16944. }
  16945. ,
  16946. t.prototype.waitForLoad = function(e, t) {
  16947. t() || (this.waitQueue.push({
  16948. object: e,
  16949. isLoadedCallback: t
  16950. }),
  16951. 1 === this.waitQueue.length && this.emit("waiting"))
  16952. }
  16953. ,
  16954. t.prototype.hide = function() {
  16955. this.floors.hide()
  16956. }
  16957. ,
  16958. t.prototype.show = function() {
  16959. this.floors.show()
  16960. }
  16961. ,
  16962. t.prototype.floorNames = function() {
  16963. return this.floors.names()
  16964. }
  16965. ,
  16966. t.prototype.warpDestFloors = function(e, t) {
  16967. if (e && this.floors.length === e.length) {
  16968. var i = e.findIndex(function(e) {
  16969. return e
  16970. }
  16971. .bind(this));
  16972. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16973. } else
  16974. this.toggleAllFloors(!0)
  16975. }
  16976. ,
  16977. t.prototype.setFloor = function(e, t, i) {
  16978. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16979. this.allFloorsVisible = !1,
  16980. this._setFloor(e, t, i)
  16981. }
  16982. ,
  16983. t.prototype.toggleAllFloors = function(e) {
  16984. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16985. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16986. this._setFloor(this.currentFloor)
  16987. }
  16988. ,
  16989. t.prototype._setFloor = function(e, t, i) {
  16990. var n;
  16991. if (t = t || this.mode,
  16992. this.emit("floor.changed", e, t, this.currentFloor),
  16993. this.currentFloor = e,
  16994. t === s.PANORAMA) {
  16995. if (this.show(),
  16996. this.shouldShowtags && this.tagsShown)
  16997. for (n in this.tags)
  16998. this.tags[n].show(u.showFloorDuration)
  16999. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17000. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17001. }
  17002. .bind(this)),
  17003. this.shouldShowtags && this.tagsShown))
  17004. for (n in this.tags) {
  17005. var r = this.tags[n];
  17006. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17007. }
  17008. var o = this
  17009. , a = e;
  17010. A.start(function() {}, u.showFloorDelay, function() {
  17011. o.floors.forEach(function(t) {
  17012. t.chunks.forEach(function(e) {
  17013. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17014. })
  17015. })
  17016. }
  17017. .bind(this))
  17018. }
  17019. ,
  17020. t.prototype.toggleExplode = function() {
  17021. this.floors.toggleExplodeHorizontal()
  17022. }
  17023. ,
  17024. t.prototype.toggleExplodeUp = function() {
  17025. this.floors.toggleExplodeVertical()
  17026. }
  17027. ,
  17028. t.prototype.nextFloor = function(e) {
  17029. return this.floors.nextFloor(this.currentFloor, e)
  17030. }
  17031. ,
  17032. t.prototype.addFloor = function(e) {
  17033. this.floors.add(e)
  17034. }
  17035. ,
  17036. t.prototype.getFloorAtPoint = function(e) {
  17037. return this.floors.getFloorAtPoint(e)
  17038. }
  17039. ,
  17040. t.prototype.getTagBySid = function(e) {
  17041. return this.tags[e]
  17042. }
  17043. ,
  17044. t.prototype.addChunk = function(e, t) {
  17045. this.floors.getOrMakeFloor(e).addChunk(t),
  17046. this.chunks.push(t)
  17047. }
  17048. ,
  17049. t.prototype.setMode = function(t) {
  17050. if (!this.supportedModes[t])
  17051. throw new x("Mode not supported for this model: " + t);
  17052. this.mode = t
  17053. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17054. this.chunks.forEach(function(e) {
  17055. e.setMode(t)
  17056. })
  17057. }
  17058. ,
  17059. t.prototype.build = function() {
  17060. this.heroLocations = this.images.getHeroLocations(this.panos);
  17061. var e = function() {
  17062. 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()
  17063. }
  17064. .bind(this)();
  17065. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17066. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17067. }
  17068. .bind(this)) || e,
  17069. null === this.heroImage && R.warn("No hero image defined."),
  17070. this.currentFloor = this.floors.last(),
  17071. this.floors.build(),
  17072. this.colliders = this.floors.reduce(function(e, t) {
  17073. return e.concat(t.collider.children)
  17074. }, []),
  17075. this.panos.forEach(function(e) {
  17076. e.build1(),
  17077. e.on("enter", function() {
  17078. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17079. }
  17080. .bind(this))
  17081. }
  17082. .bind(this)),
  17083. this.panos.forEach(function(e) {
  17084. e.build2()
  17085. }),
  17086. this.floors.forEach(function(e) {
  17087. this.boundingBox.union(e.boundingBox)
  17088. }
  17089. .bind(this)),
  17090. this.size = this.boundingBox.size(),
  17091. this.center = this.boundingBox.center(),
  17092. this.floors.forEach(function(e) {
  17093. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17094. }
  17095. .bind(this)),
  17096. this.panos.populate_path_graph(),
  17097. this.skybox = new n(this.boundingBox),
  17098. this.skybox.matrixWorldNeedsUpdate = !0,
  17099. this.add(this.skybox),
  17100. setTimeout(function() {
  17101. this.hotsCount && this.shineHots()
  17102. }
  17103. .bind(this), 1300),
  17104. this.tags)
  17105. this.tags[t].build();
  17106. return R.debug("Done building model"),
  17107. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17108. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17109. this.buildRooms(),
  17110. this.labels.associateWithRooms(this.rooms),
  17111. $.when(this)
  17112. }
  17113. ,
  17114. t.prototype.loadLabels = function() {
  17115. this.labels = new b(this);
  17116. var e = $.Deferred();
  17117. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17118. !this.showingLabels) */
  17119. return e.resolve();
  17120. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17121. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17122. R.warn("Getting labels failed, not displaying labels."),
  17123. e.resolve()
  17124. }),
  17125. e
  17126. }
  17127. ,
  17128. t.prototype.buildRooms = function() {
  17129. this.rooms = new _(this),
  17130. this.rooms.createFromChunks(this.chunks),
  17131. this.rooms.calcRoomBoundaries()
  17132. }
  17133. ,
  17134. t.prototype.updateProjectedPanos = function() {
  17135. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17136. }
  17137. ,
  17138. t.prototype.setProjectedPanos = function(t, i, n) {
  17139. null != n || (n = !0),
  17140. n = !!n,
  17141. this.projectedPano0 = t,
  17142. this.projectedPano1 = i,
  17143. this.skybox.material.setProjectedPanos(t, i, n),
  17144. this.chunks.forEach(function(e) {
  17145. e.materialInside.setProjectedPanos(t, i, n)
  17146. })
  17147. }
  17148. ,
  17149. t.prototype.setSide = function(t) {
  17150. this.floors.forEach(function(e) {
  17151. e.collider.material.side = t
  17152. })
  17153. }
  17154. ,
  17155. t.prototype.heroCount = function() {
  17156. return this.heroLocations ? this.heroLocations.length : 0
  17157. }
  17158. ,
  17159. t.prototype.getHeroDescriptorByIndex = function(e) {
  17160. if (e < 0)
  17161. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17162. null;
  17163. if (this.heroCount() < 1)
  17164. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17165. null;
  17166. var t = this.heroLocations[e];
  17167. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17168. null) : t
  17169. }
  17170. ,
  17171. t.prototype.findPanoramicHero = function() {
  17172. for (var e in this.heroLocations)
  17173. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17174. return this.heroLocations[e];
  17175. return null
  17176. }
  17177. ,
  17178. t.prototype.listImagePanos = function() {
  17179. var i = []
  17180. , n = this;
  17181. return this.images.forEach(function(e) {
  17182. if (e.metadata && e.metadata.scan_id) {
  17183. var t = n.panos.get(e.metadata.scan_id);
  17184. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17185. }
  17186. }),
  17187. i
  17188. }
  17189. ,
  17190. t.prototype.fadePanoMarkers = function(e, t) {
  17191. this.panos.fadeMarkerOpacity(e, t)
  17192. }
  17193. ,
  17194. t.prototype.setSweepVisibility = function(t) {
  17195. this.panos.forEach(function(e) {
  17196. e.marker && (e.marker.visible = t)
  17197. })
  17198. }
  17199. ,
  17200. t.prototype.outsideAllowed = function() {
  17201. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17202. }
  17203. ,
  17204. O.exports = t
  17205. }
  17206. ).call(this, "/js/model/Model.js")
  17207. }
  17208. , {
  17209. "../constants": 8,
  17210. "../enum/AlignmentType": 17,
  17211. "../enum/RenderOrder": 42,
  17212. "../enum/Viewmode": 51,
  17213. "../exception/BasicException": 55,
  17214. "../label/Label": 90,
  17215. "../loaders/ModelLoader": 105,
  17216. "../loaders/ModelTextureLoader": 106,
  17217. "../loaders/SweepDataLoader": 107,
  17218. "../tag/tag": 123,
  17219. "../tag/tagManager": 124,
  17220. "../objects/BoundingTextureSkybox": 143,
  17221. "../objects/Chunk": 144,
  17222. "../objects/Floor": 146,
  17223. "../objects/Panorama": 148,
  17224. "../objects/Room": 150,
  17225. "../objects/Snapshot": 153,
  17226. "../settings": 166,
  17227. "../shaders": 167,
  17228. "../util/ModelUrls": 177,
  17229. "../util/PanoramaCollection": 178,
  17230. "../util/ajax": 181,
  17231. "../util/common": 185,
  17232. "../util/easing": 186,
  17233. "../util/lerp": 188,
  17234. "../util/logger": 189,
  17235. "../util/math": 190,
  17236. "../util/texture": 194,
  17237. "../util/transitions": 195,
  17238. "./../util/browser": 182,
  17239. "./../util/showcase": 193,
  17240. "./Chunks": 135,
  17241. "./FloorCollection": 136,
  17242. "./ImageCollection": 137,
  17243. "./LabelCollection": 138,
  17244. "./RoomCollection": 141,
  17245. events: 202,
  17246. three: 217,
  17247. hot: "hot"
  17248. }],
  17249. 140: [function(e, t, i) {
  17250. "use strict";
  17251. function n() {
  17252. this.modelMap = {},
  17253. this.activeModel = null,
  17254. this.modelCount = 0,
  17255. this.tileDownloader = null,
  17256. this.panoRenderer = null
  17257. }
  17258. var r = (e("three"),
  17259. e("../util/common"))
  17260. , o = e("../exception/BasicException")
  17261. , a = e("../enum/ModelManagerEvents")
  17262. , s = e("../enum/PanoRendererEvents")
  17263. , l = e("events").EventEmitter;
  17264. n.prototype.init = function(e, t, i) {
  17265. this.tileDownloader = e,
  17266. this.panoRenderer = t,
  17267. this.qualityManager = i,
  17268. this.bindEvents()
  17269. }
  17270. ,
  17271. n.prototype.bindEvents = function() {
  17272. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17273. }
  17274. ,
  17275. n.prototype.onTileRendered = function(e, t, i, n) {}
  17276. ,
  17277. n.prototype.addModel = function(e) {
  17278. this.modelMap[e.sid] = e,
  17279. 0 === this.modelCount && this.activateModel(e.sid),
  17280. this.modelCount++,
  17281. this.emit(a.ModelAdded)
  17282. }
  17283. ,
  17284. n.prototype.getModel = function(e) {
  17285. return this.modelMap[e]
  17286. }
  17287. ,
  17288. n.prototype.activateModel = function(e) {
  17289. var t = this.modelMap[e];
  17290. if (!t)
  17291. throw new o("Tried to activate invalid model!");
  17292. var i = this.activeModel;
  17293. this.activeModel = t,
  17294. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17295. this.tileDownloader.setUrls(t.urls),
  17296. t.panos.forEach(function(e) {
  17297. e.attachToPanoRenderer(this.panoRenderer),
  17298. e.tileDownloader = this.tileDownloader,
  17299. e.qualityManager = this.qualityManager
  17300. }
  17301. .bind(this)),
  17302. this.emit(a.ActiveModelChanged, {
  17303. oldModel: i,
  17304. model: t
  17305. })
  17306. }
  17307. ,
  17308. n.prototype.getActiveModel = function() {
  17309. return this.activeModel
  17310. }
  17311. ,
  17312. r.extend(n, l),
  17313. t.exports = n
  17314. }
  17315. , {
  17316. "../enum/ModelManagerEvents": 33,
  17317. "../enum/PanoRendererEvents": 35,
  17318. "../exception/BasicException": 55,
  17319. "../util/common": 185,
  17320. events: 202,
  17321. three: 217
  17322. }],
  17323. 141: [function(r, l, e) {
  17324. (function(e) {
  17325. "use strict";
  17326. function o() {
  17327. n.call(this)
  17328. }
  17329. var a = r("../objects/Room")
  17330. , t = (r("../settings"),
  17331. r("../util/logger"))
  17332. , i = (r("../util/transitions"),
  17333. r("../util/easing"),
  17334. r("../util/common"))
  17335. , n = r("../util/IndexedCollection")
  17336. , s = r("./Chunks");
  17337. new t(e),
  17338. i.inherit(o, n),
  17339. o.prototype.getIndex = function(e) {
  17340. return e.roomId
  17341. }
  17342. ,
  17343. o.prototype.calcRoomBoundaries = function() {
  17344. this.forEach(function(e) {
  17345. e.calcBoundaries()
  17346. })
  17347. }
  17348. ,
  17349. o.prototype.createFromChunks = function(e) {
  17350. var n = {
  17351. floorId: -1,
  17352. roomId: -1
  17353. }
  17354. , r = {};
  17355. e.forEach(function(e) {
  17356. s.parseIdsFromChunkName(e.name, n);
  17357. var t = r[n.roomId];
  17358. if (!t) {
  17359. var i = o.generateRoomId(n.floorId, n.roomId);
  17360. t = new a(n.floorId,i),
  17361. this.add(t),
  17362. r[n.roomId] = t
  17363. }
  17364. t.addChunk(e)
  17365. }
  17366. .bind(this)),
  17367. this.calcRoomBoundaries()
  17368. }
  17369. ,
  17370. o.generateRoomId = function(e, t) {
  17371. return e + "_" + t
  17372. }
  17373. ,
  17374. l.exports = o
  17375. }
  17376. ).call(this, "/js/model/RoomCollection.js")
  17377. }
  17378. , {
  17379. "../objects/Room": 150,
  17380. "../settings": 166,
  17381. "../util/IndexedCollection": 175,
  17382. "../util/common": 185,
  17383. "../util/easing": 186,
  17384. "../util/logger": 189,
  17385. "../util/transitions": 195,
  17386. "./Chunks": 135
  17387. }],
  17388. 142: [function(e, t, i) {
  17389. "use strict";
  17390. function n(e, t, i) {
  17391. var n = (e = e.clone().expandByScalar(0.01)).size()
  17392. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17393. r.boundingBox = e,
  17394. o.Mesh.call(this, r, t),
  17395. this.position.copy(e.center()),
  17396. this.frustumCulled = !1,
  17397. i && this.add(new o.WireframeHelper(this))
  17398. }
  17399. var o = e("three");
  17400. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17401. t.exports = n
  17402. }
  17403. , {
  17404. three: 217
  17405. }],
  17406. 143: [function(l, c, e) {
  17407. (function(e) {
  17408. "use strict";
  17409. function t(e) {
  17410. s.time("Computing a nice bounding cubemap");
  17411. var t = new r({
  17412. side: i.BackSide,
  17413. transparent: !0
  17414. });
  17415. t.uniforms.modelAlpha.value = 0,
  17416. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17417. this.renderOrder = a.boundingSkybox,
  17418. n.call(this, e, t),
  17419. s.timeEnd("Computing a nice bounding cubemap")
  17420. }
  17421. var i = l("three")
  17422. , n = (l("../enum/Viewmode"),
  17423. l("../shaders"),
  17424. l("./BoundingMesh"))
  17425. , r = l("../materials/ModelTextureMaterial")
  17426. , o = l("../settings")
  17427. , a = l("../enum/RenderOrder")
  17428. , s = new (l("../util/logger"))(e);
  17429. (t.prototype = Object.create(n.prototype)).constructor = t,
  17430. c.exports = t
  17431. }
  17432. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17433. }
  17434. , {
  17435. "../enum/RenderOrder": 42,
  17436. "../enum/Viewmode": 51,
  17437. "../materials/ModelTextureMaterial": 118,
  17438. "../settings": 166,
  17439. "../shaders": 167,
  17440. "../util/logger": 189,
  17441. "./BoundingMesh": 142,
  17442. three: 217
  17443. }],
  17444. 144: [function(e, t, i) {
  17445. "use strict";
  17446. function n(e) {
  17447. this.materialInside = new s({
  17448. side: r.DoubleSide
  17449. });
  17450. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17451. this.materialOutside = new r.RawShaderMaterial({
  17452. fragmentShader: o.modelOutside.fragmentShader,
  17453. vertexShader: o.modelOutside.vertexShader,
  17454. uniforms: t,
  17455. side: r.FrontSide,
  17456. name: "chunkOut"
  17457. }),
  17458. r.Mesh.call(this, e.geometry, this.materialInside),
  17459. this.name = e.name || "",
  17460. this.textureName = e.textureName,
  17461. this.meshUrl = e.meshUrl
  17462. }
  17463. var r = e("three")
  17464. , o = e("../shaders")
  17465. , a = e("../enum/Viewmode")
  17466. , s = e("../materials/ModelTextureMaterial");
  17467. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17468. this.materialInside.uniforms.map.value = e,
  17469. this.materialOutside.uniforms.map.value = e
  17470. }
  17471. ,
  17472. n.prototype.setMode = function(e) {
  17473. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17474. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17475. t.transparent = this.material.transparent,
  17476. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17477. this.material = t
  17478. }
  17479. ,
  17480. t.exports = n
  17481. }
  17482. , {
  17483. "../enum/Viewmode": 51,
  17484. "../materials/ModelTextureMaterial": 118,
  17485. "../shaders": 167,
  17486. three: 217
  17487. }],
  17488. 145: [function(e, t, i) {
  17489. "use strict";
  17490. function n(e) {
  17491. this.chunksize = e || 10,
  17492. this.chunks = {},
  17493. this.boundingBoxes = {},
  17494. this.children = [],
  17495. this.offset = new m.Vector3(0,.5,0),
  17496. this.material = new m.MeshBasicMaterial({
  17497. color: 16777215 * Math.random(),
  17498. side: m.DoubleSide
  17499. })
  17500. }
  17501. var m = e("three");
  17502. e("../enum/Viewmode"),
  17503. n.prototype.add = function(e) {
  17504. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17505. u ? (t = u.position.array,
  17506. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17507. e.faces);
  17508. var d = new m.Vector3;
  17509. if (i)
  17510. for (n = 0,
  17511. r = i.length; n < r; n += 3) {
  17512. var p = 3 * i[n]
  17513. , f = 3 * i[n + 1]
  17514. , g = 3 * i[n + 2];
  17515. o = (t[p] + t[f] + t[g]) / 3,
  17516. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17517. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17518. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17519. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17520. this.boundingBoxes[l] = new m.Box3),
  17521. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17522. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17523. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17524. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17525. }
  17526. else
  17527. for (n = 0,
  17528. r = t.length; n < r; n += 9)
  17529. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17530. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17531. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17532. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17533. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17534. this.boundingBoxes[l] = new m.Box3),
  17535. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17536. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17537. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17538. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17539. }
  17540. ,
  17541. n.prototype.build = function() {
  17542. var e = new m.Object3D;
  17543. for (var t in e.material = this.material,
  17544. this.chunks) {
  17545. var i = this.chunks[t]
  17546. , n = new m.BufferGeometry;
  17547. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17548. n.boundingBox = this.boundingBoxes[t];
  17549. var r = new m.Mesh(n,this.material);
  17550. r.material.visible = !1,
  17551. e.add(r),
  17552. this.chunks[t] = []
  17553. }
  17554. return e
  17555. }
  17556. ,
  17557. t.exports = n
  17558. }
  17559. , {
  17560. "../enum/Viewmode": 51,
  17561. three: 217
  17562. }],
  17563. 146: [function(e, t, i) {
  17564. "use strict";
  17565. var n = e("three")
  17566. , r = e("../settings")
  17567. , o = e("../util/common")
  17568. , a = e("../util/lerp")
  17569. , s = e("./ChunkedCollider")
  17570. , l = e("../util/transitions")
  17571. , c = e("../util/easing")
  17572. , h = (e("../objects/Panorama"),
  17573. e("../enum/RenderOrder"));
  17574. e("../localization/localize");
  17575. function u(e, t, i) {
  17576. n.Object3D.call(this),
  17577. this.model = e,
  17578. this.floorIndex = t,
  17579. this.lang = r.languageTag,
  17580. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17581. this.panos = [],
  17582. this.chunks = [],
  17583. this.colliderBuilder = new s(3),
  17584. this.collider = null,
  17585. this.center = null,
  17586. this.boundingBox = new n.Box3,
  17587. this.size = null,
  17588. this.hidden = !1,
  17589. this.conservativeBoundingBox = new n.Box3,
  17590. this.debugColor = 16777215 * Math.random(),
  17591. this.transition = null
  17592. }
  17593. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17594. this.model.setFloor(this, e)
  17595. }
  17596. ,
  17597. u.prototype.hide = function(e) {
  17598. if (!this.hidden || this.transition) {
  17599. this.chunks.forEach(function(e) {
  17600. e.material.transparent = !0
  17601. }),
  17602. l.cancel(this.transition);
  17603. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17604. , i = e ? 0 : r.hideFloorDelay / t;
  17605. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17606. this.hidden = !0
  17607. }
  17608. .bind(this), i, c.easeInOutQuad)
  17609. }
  17610. }
  17611. ,
  17612. u.prototype.show = function(e) {
  17613. if (this.hidden || this.transition) {
  17614. this.hidden = !1,
  17615. l.cancel(this.transition);
  17616. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17617. , i = e ? 0 : r.showFloorDelay / t;
  17618. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17619. this.hidden || this.chunks.forEach(function(e) {
  17620. e.material.transparent = !1
  17621. })
  17622. }
  17623. .bind(this), i, c.easeInOutQuad)
  17624. }
  17625. }
  17626. ,
  17627. u.prototype.toggle = function(e, t) {
  17628. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17629. }
  17630. ,
  17631. u.prototype.containsPoint = function(t) {
  17632. return this.collider.children.some(function(e) {
  17633. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17634. e.geometry.boundingBox.containsPoint(t)
  17635. })
  17636. }
  17637. ,
  17638. u.prototype.distanceToPoint = function(i) {
  17639. var n = null
  17640. , r = 1 / 0;
  17641. return this.collider.children.forEach(function(e) {
  17642. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17643. var t = e.geometry.boundingBox.distanceToPoint(i);
  17644. (!n || t < r) && (r = t,
  17645. n = e)
  17646. }),
  17647. r
  17648. }
  17649. ,
  17650. u.prototype.addChunk = function(e) {
  17651. e.renderOrder = h.ghostFloor,
  17652. this.add(e),
  17653. this.chunks.push(e),
  17654. this.boundingBox.union(e.geometry.boundingBox),
  17655. this.size = this.boundingBox.size(),
  17656. this.colliderBuilder.add(e.geometry)
  17657. }
  17658. ,
  17659. u.prototype.addPano = function(e) {
  17660. this.panos.push(e),
  17661. this.add(e.skyboxMesh),
  17662. e.marker && this.add(e.marker);
  17663. var t = new n.Vector3(1,1,1)
  17664. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17665. this.boundingBox.union(i)
  17666. }
  17667. ,
  17668. u.prototype.build = function() {
  17669. this.collider = this.colliderBuilder.build(!0),
  17670. this.add(this.collider),
  17671. this.center = this.boundingBox.center(),
  17672. this.conservativeBoundingBox.copy(this.boundingBox),
  17673. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17674. return e.geometry.boundingBox.min.y
  17675. }), 5),
  17676. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17677. return e.geometry.boundingBox.max.y
  17678. }), 5),
  17679. this.colliderBuilder = null
  17680. }
  17681. ,
  17682. u.prototype.toShortString = function() {
  17683. return o.nth(this.floorIndex + 1)
  17684. }
  17685. ,
  17686. u.prototype.toString = function() {
  17687. return this.name
  17688. }
  17689. ,
  17690. t.exports = u
  17691. }
  17692. , {
  17693. "../enum/RenderOrder": 42,
  17694. "../localization/localize": 108,
  17695. "./strings-cn-CN": 109,
  17696. "../objects/Panorama": 148,
  17697. "../settings": 166,
  17698. "../util/common": 185,
  17699. "../util/easing": 186,
  17700. "../util/lerp": 188,
  17701. "../util/transitions": 195,
  17702. "./ChunkedCollider": 145,
  17703. three: 217
  17704. }],
  17705. 147: [function(e, t, i) {
  17706. "use strict";
  17707. function n(e) {
  17708. this.player = e,
  17709. this.obj3d = null,
  17710. this.UP = new u.Vector3(0,1,0)
  17711. }
  17712. var u = e("three")
  17713. , d = e("../settings");
  17714. n.prototype.prefs = {
  17715. linewidth: 3,
  17716. height: .07,
  17717. opacity: .45,
  17718. endScale: .05
  17719. },
  17720. n.prototype.discard = function() {
  17721. if (this.obj3d) {
  17722. var e = this.obj3d.parent;
  17723. e && e.remove(this.obj3d)
  17724. }
  17725. this.obj3d = null
  17726. }
  17727. ,
  17728. n.prototype.draw = function() {
  17729. if (this.discard(),
  17730. d.showNeighbors) {
  17731. var e = this.player.currentPano.floor;
  17732. this.obj3d = new u.Object3D;
  17733. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17734. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17735. i.y += this.prefs.height;
  17736. var n = .1525
  17737. , r = new u.Matrix4;
  17738. for (var o in t)
  17739. if (t[o]) {
  17740. var a = this.player.model.panos.get(o)
  17741. , s = (a.position.clone().sub(this.player.model.position),
  17742. a.position.clone().sub(a.floorPosition))
  17743. , l = a.floorPosition.clone().sub(this.player.model.position);
  17744. l.y += this.prefs.height;
  17745. var c = new u.Geometry;
  17746. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  17747. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  17748. r.identity().setPosition(s),
  17749. c.applyMatrix(r),
  17750. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17751. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17752. r.lookAt(l, i, this.UP).setPosition(l),
  17753. c.applyMatrix(r),
  17754. c.vertices.push(l, i);
  17755. var h = new u.Line(c,new u.LineBasicMaterial({
  17756. color: a.debugColor.getHex(),
  17757. transparent: !0,
  17758. opacity: this.prefs.opacity,
  17759. depthWrite: !1,
  17760. name: "sLine" + o,
  17761. linewidth: this.prefs.linewidth
  17762. }));
  17763. this.obj3d.add(h)
  17764. }
  17765. e.add(this.obj3d)
  17766. }
  17767. }
  17768. ,
  17769. n.prototype.update = function() {
  17770. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17771. }
  17772. ,
  17773. t.exports = n
  17774. }
  17775. , {
  17776. "../settings": 166,
  17777. three: 217
  17778. }],
  17779. 148: [function(S, M, e) {
  17780. (function(e) {
  17781. "use strict";
  17782. function r(e, t, i, n) {
  17783. this.model = e,
  17784. this.id = t,
  17785. this.alignmentType = i.alignmentType || c.ALIGNED,
  17786. this.neighbourUUIDs = i.neighbours || null,
  17787. this.neighbourPanos = null,
  17788. this.floor = null,
  17789. this.floorIndex = i.floor,
  17790. this.failedLoadingAt = 0,
  17791. this.maxLoadRetries = 4,
  17792. this.origin = i.position.clone(),
  17793. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17794. this.quaternion = i.quaternion.clone(),
  17795. this.skyboxMesh = new s.Mesh(E),
  17796. this.skyboxMesh.position.copy(this.position),
  17797. this.skyboxMesh.quaternion.copy(this.quaternion),
  17798. this.skyboxMesh.name = "skybox",
  17799. this.skyboxMesh.visible = !1,
  17800. this.skyboxMesh.updateMatrix(),
  17801. this.skyboxMesh.updateMatrixWorld(),
  17802. this.marker = null,
  17803. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17804. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17805. map: b,
  17806. side: s.DoubleSide,
  17807. opacity: 0,
  17808. transparent: !0,
  17809. depthWrite: !1
  17810. })),
  17811. this.marker.visible = this.showFloorMarker,
  17812. this.marker.renderOrder = l.panoMarker,
  17813. this.marker.name = "marker",
  17814. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17815. this.marker.updateMatrixWorld(),
  17816. a.colorMarkerOnLoad && this.on("load", function() {
  17817. this.marker.material.color.set(65280)
  17818. })),
  17819. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17820. this.floorPosition = i.puck ? i.puck.clone() : null,
  17821. this.tiled = n,
  17822. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17823. this.solidSkybox.flipY = !1,
  17824. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17825. this.solidSkybox.magFilter = s.LinearFilter,
  17826. this.solidSkybox.generateMipmaps = !1)),
  17827. this.zoomed = !1,
  17828. this.panoRenderer = null,
  17829. this.qualityManager = null,
  17830. this.tileDownloader = null,
  17831. this.tiledPanoRenderTarget = null,
  17832. this.minimumTiledPanoLoaded = !1,
  17833. this.highestPartialTileRenderOpCompleted = 0,
  17834. this.highestFullTileRenderOpCompleted = 0,
  17835. this.shouldRedrawOnBaseLoaded = !1,
  17836. this.lockUntilRenderingComplete = !1,
  17837. a.colorMarkerOnLoad && this.on("load", function() {
  17838. this.marker.material.color.set(65280)
  17839. }),
  17840. (e = new s.TextureLoader).setCrossOrigin(!0);
  17841. var r = e.load("images/texture.jpg");
  17842. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17843. color: 16777215,
  17844. transparent: !0,
  17845. opacity: .75,
  17846. map: r
  17847. })),
  17848. this.vrMarker.boluoType = "vr",
  17849. this.vrMarker.position.z = 1,
  17850. this.vrMarker.enabled = !0,
  17851. this.vrMarker.visible = !1,
  17852. window.vrMarkers = window.vrMarkers || [],
  17853. window.vrMarkers.push(this.vrMarker),
  17854. this.marker && this.marker.add(this.vrMarker),
  17855. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17856. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17857. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17858. this.adjustAngleEnable) {
  17859. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17860. this.skyboxMesh.quaternion.multiply(i);
  17861. var o = new s.Quaternion;
  17862. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17863. this.skyboxMesh.quaternion.multiply(o),
  17864. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17865. this.skyboxMesh.quaternion.multiply(n),
  17866. this.skyboxMesh.updateMatrix(),
  17867. this.skyboxMesh.updateMatrixWorld(),
  17868. this.model.updateProjectedPanos()
  17869. }
  17870. }
  17871. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17872. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17873. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17874. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17875. S("../enum/GLCubeFaces"),
  17876. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  17877. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17878. function() {
  17879. this.setZoomed(!1),
  17880. this.emit("enter", {
  17881. oldPano: t,
  17882. newPano: this
  17883. }),
  17884. t = this
  17885. }
  17886. ),
  17887. r.prototype.exit = function() {
  17888. this.tiled ? (this.clearWaitDeferreds(),
  17889. this.minimumTiledPanoLoaded = !1,
  17890. this.tiledPanoRenderTarget = null,
  17891. this.setZoomed(!1),
  17892. this.panoRenderer.deactivateTiledPano(this),
  17893. this.highestPartialTileRenderOpCompleted = 0,
  17894. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17895. this.solidSkybox.loaded = !1,
  17896. this.solidSkybox.version = 0),
  17897. this.emit("exit")
  17898. }
  17899. ,
  17900. r.prototype.hoverOn = function(e) {
  17901. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17902. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17903. }
  17904. ,
  17905. r.prototype.hoverOff = function(e) {
  17906. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17907. }
  17908. ,
  17909. r.prototype.build1 = function() {
  17910. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17911. this.floor.addPano(this),
  17912. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17913. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17914. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17915. }
  17916. ,
  17917. r.prototype.build2 = function() {
  17918. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17919. this.height = this.position.distanceTo(this.floorPosition),
  17920. this.placeMarker()
  17921. }
  17922. ,
  17923. r.prototype.interpolateFloorPosition = function() {
  17924. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17925. return !!e.floorPosition
  17926. }).sort(function(e, t) {
  17927. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17928. }
  17929. .bind(this))
  17930. , t = this.position.clone();
  17931. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17932. t
  17933. }
  17934. ,
  17935. r.prototype.raycastFloorPosition = function() {
  17936. I.warn("Performance warning: Raycasting to find floor position");
  17937. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17938. return e.length ? e[0].point : null
  17939. }
  17940. ,
  17941. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  17942. function() {
  17943. I.warn("Performance warning: Raycasting to find floor index");
  17944. for (var e = 0; e < i.length; e++) {
  17945. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17946. if (t.length)
  17947. return t[0].object.parent.parent
  17948. }
  17949. return null
  17950. }
  17951. ),
  17952. r.prototype.placeMarker = function() {
  17953. this.marker && (this.marker.position.copy(this.floorPosition),
  17954. this.marker.position.y += .05,
  17955. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17956. }
  17957. ,
  17958. r.prototype.translate = function(e) {
  17959. this.position.add(e),
  17960. this.floorPosition.add(e)
  17961. }
  17962. ,
  17963. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17964. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17965. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17966. }
  17967. ,
  17968. r.prototype.attachToPanoRenderer = function(e) {
  17969. this.panoRenderer = e,
  17970. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17971. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17972. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17973. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17974. }
  17975. ;
  17976. var w, T, x = {};
  17977. r.prototype.getWaitDeferred = function(e) {
  17978. var t = x[this.id];
  17979. t || (t = {},
  17980. x[this.id] = t);
  17981. var i = t[e];
  17982. return i || (i = {
  17983. deferred: $.Deferred(),
  17984. active: !1
  17985. },
  17986. t[e] = i),
  17987. i
  17988. }
  17989. ,
  17990. r.prototype.resetWaitDeferred = function(e) {
  17991. var t = this.getWaitDeferred(e);
  17992. t.active = !1,
  17993. t.deferred = $.Deferred()
  17994. }
  17995. ,
  17996. r.prototype.clearWaitDeferreds = function() {
  17997. var e = x[this.id];
  17998. for (var t in e || (e = {},
  17999. x[this.id] = e),
  18000. e)
  18001. if (e.hasOwnProperty(t)) {
  18002. var i = e[t];
  18003. i.active = !1,
  18004. i.deferred = $.Deferred()
  18005. }
  18006. }
  18007. ,
  18008. r.prototype.loadTiledPano = (new s.Vector3,
  18009. w = [],
  18010. T = [],
  18011. function(e, t, i, n, r, o) {
  18012. null != n || (n = !0),
  18013. null != r || (r = !0);
  18014. var a = this.getWaitDeferred(e)
  18015. , s = a.deferred
  18016. , l = null
  18017. , c = null;
  18018. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18019. c = i.vFov)),
  18020. !this.isLoaded(e)) {
  18021. if (!a.active) {
  18022. if (a.active = !0,
  18023. i) {
  18024. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18025. w[this.id + ":" + e] = {
  18026. tileCount: 0,
  18027. targetTileCount: h
  18028. },
  18029. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18030. }
  18031. T[this.id] || (T[this.id] = !0,
  18032. this.on(f.LoadComplete, function(e, t) {
  18033. var i = this.getWaitDeferred(e).deferred;
  18034. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18035. this.resetWaitDeferred(e))
  18036. }
  18037. .bind(this)),
  18038. this.on(f.LoadFailed, function(e) {
  18039. var t = this.getWaitDeferred(e).deferred;
  18040. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18041. this.resetWaitDeferred(e))
  18042. }
  18043. .bind(this)),
  18044. this.on(f.TileLoaded, function(e, t, i) {
  18045. var n = this.getWaitDeferred(e).deferred;
  18046. if (n && "pending" === n.state()) {
  18047. n.notify(e, t, i);
  18048. var r = w[this.id + ":" + e];
  18049. r && (r.tileCount++,
  18050. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18051. n.resolve(e, i),
  18052. this.resetWaitDeferred(e)))
  18053. }
  18054. }
  18055. .bind(this)))
  18056. }
  18057. this.tileDownloader.clearForceQueue(),
  18058. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18059. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18060. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18061. }
  18062. return s.promise()
  18063. }
  18064. ),
  18065. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18066. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18067. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18068. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18069. }
  18070. ,
  18071. r.prototype.onTileRendered = function(e, t, i, n) {
  18072. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18073. }
  18074. ,
  18075. r.prototype.onPanoRendered = function(e, t, i, n) {
  18076. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18077. this.updateSkyboxForZoomLevel(),
  18078. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18079. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18080. this.emit("load", t),
  18081. this.model.emit("load", this),
  18082. this.emit(f.LoadComplete, t, i))
  18083. }
  18084. ,
  18085. r.prototype.setZoomed = function(e) {
  18086. this.zoomed = e,
  18087. this.updateSkyboxForZoomLevel()
  18088. }
  18089. ,
  18090. r.prototype.ensureSkyboxReadyForRender = function() {
  18091. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18092. this.solidSkybox.loaded = !0)
  18093. }
  18094. ,
  18095. r.prototype.updateSkyboxForZoomLevel = function() {
  18096. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18097. }
  18098. ,
  18099. r.prototype.getSkyboxTexture = function() {
  18100. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18101. }
  18102. ,
  18103. r.prototype.onTileRenderFail = function(e, t, i) {
  18104. e === this.id && this.emit(f.LoadFailed, t)
  18105. }
  18106. ,
  18107. r.prototype.isLoaded = function(e) {
  18108. if (this.tiled) {
  18109. if (e && "string" == typeof e)
  18110. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18111. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18112. }
  18113. if (e && "number" == typeof e)
  18114. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18115. return !!this.solidSkybox.high || e in this.solidSkybox
  18116. }
  18117. ,
  18118. r.prototype.loadCube = function(a) {
  18119. if (this.isLoaded(a))
  18120. return I.info("Skipping load of pano, already loaded"),
  18121. $.when();
  18122. this.emit("loading", a),
  18123. this.model.emit("loading", this);
  18124. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18125. , e = n.filter(function(e) {
  18126. return !e
  18127. });
  18128. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18129. a = "high",
  18130. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18131. var t = 0
  18132. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18133. return u.getImage(n[t])
  18134. }
  18135. .bind(this));
  18136. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18137. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18138. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18139. this.solidSkybox.low = null),
  18140. this.solidSkybox.needsUpdate = !0,
  18141. this.emit("load", a),
  18142. this.model.emit("load", this),
  18143. this
  18144. }
  18145. .bind(this), function() {
  18146. I.error("Downloading cubemap for pano", this.id, "failed"),
  18147. this.failedLoadingAt = Date.now()
  18148. }
  18149. .bind(this), function() {
  18150. return $.when(++t, 6)
  18151. })
  18152. }
  18153. ,
  18154. r.raycastsSkipped = 0,
  18155. r.raycastsDone = 0,
  18156. r.prototype.findNeighourPanos = function() {
  18157. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18158. this.model.panos.forEach(function(e) {
  18159. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18160. var t = this.position.distanceTo(e.position);
  18161. if (t > a.panoramaNeighbourMaxDistance)
  18162. return this.model.panos.setNeighbour(this, e, !1),
  18163. void r.raycastsSkipped++;
  18164. var i = e.position.clone().sub(this.position).normalize()
  18165. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18166. r.raycastsDone++,
  18167. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18168. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  18169. }
  18170. }
  18171. .bind(this)),
  18172. this.model.panos.neighbourMap[this.id]
  18173. }
  18174. ,
  18175. r.prototype.worldPosition = function() {
  18176. return this.position
  18177. }
  18178. ,
  18179. r.prototype.addTextSprite = function(e, t) {
  18180. this.removeTextSprite();
  18181. var i = document.createElement("canvas")
  18182. , n = i.getContext("2d");
  18183. i.width = 256,
  18184. i.height = 256;
  18185. n.font = "bold 60px Arial",
  18186. n.fillStyle = "white";
  18187. var r = n.measureText(e).width;
  18188. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18189. var o = new s.Texture(i);
  18190. o.needsUpdate = !0;
  18191. var a = new s.SpriteMaterial({
  18192. map: o,
  18193. color: t || 16428055
  18194. });
  18195. this.text3d = new s.Sprite(a),
  18196. this.text3d.position.copy(this.skyboxMesh.position),
  18197. this.floor.add(this.text3d)
  18198. }
  18199. ,
  18200. r.prototype.removeTextSprite = function() {
  18201. this.text3d && (this.floor.remove(this.text3d),
  18202. this.text3d = null)
  18203. }
  18204. ,
  18205. r.prototype.isAligned = function() {
  18206. return this.alignmentType === c.ALIGNED
  18207. }
  18208. ,
  18209. r.filters = {
  18210. inDirection: function(t, i, n) {
  18211. return function(e) {
  18212. return e.position.clone().sub(t).normalize().dot(i) > n
  18213. }
  18214. },
  18215. inFloorDirection: function(t, i, n) {
  18216. return function(e) {
  18217. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18218. }
  18219. },
  18220. inPanoDirection: function(n, r, o) {
  18221. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18222. function(e) {
  18223. var t = e.floorPosition.clone().sub(n).normalize()
  18224. , i = e.position.clone().sub(n).normalize();
  18225. return t.dot(r) > o || i.dot(r) > o
  18226. }
  18227. },
  18228. atFloor: function(t) {
  18229. return function(e) {
  18230. return !t || e.floor === t
  18231. }
  18232. },
  18233. not: function(t) {
  18234. return function(e) {
  18235. return e !== t
  18236. }
  18237. },
  18238. notIn: function(t) {
  18239. return function(e) {
  18240. return -1 === t.indexOf(e)
  18241. }
  18242. },
  18243. isLoaded: function() {
  18244. return function(e) {
  18245. return e.isLoaded()
  18246. }
  18247. },
  18248. isNotLoaded: function() {
  18249. return function(e) {
  18250. return !e.isLoaded()
  18251. }
  18252. },
  18253. isCloseEnoughTo: function(t, i) {
  18254. return function(e) {
  18255. return t.distanceTo(e.floorPosition) < i
  18256. }
  18257. },
  18258. hasMinimumHeightDifferenceTo: function(t, i) {
  18259. return function(e) {
  18260. return Math.abs(e.position.y - t.y) > i
  18261. }
  18262. },
  18263. isNotBehindNormal: function(t, i) {
  18264. var n = new s.Vector3;
  18265. return i = i.clone(),
  18266. function(e) {
  18267. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18268. }
  18269. },
  18270. isNeighbourPanoTo: function(t) {
  18271. return function(e) {
  18272. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18273. }
  18274. },
  18275. isNeighbourOfNeighbourTo: function(n) {
  18276. return function(i) {
  18277. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18278. var t = n.model.panos.get(e);
  18279. return !!t && t.neighbourPanos[i.id]
  18280. })
  18281. }
  18282. },
  18283. isNotRecentlyFailed: function(t) {
  18284. return function(e) {
  18285. return Date.now() - e.failedLoadingAt > t
  18286. }
  18287. },
  18288. isOnVisibleFloor: function() {
  18289. return function(e) {
  18290. return !e.floor.hidden
  18291. }
  18292. },
  18293. isPanoAligned: function() {
  18294. return function(e) {
  18295. return e.isAligned()
  18296. }
  18297. }
  18298. },
  18299. r.sortFunctions = {
  18300. distanceToPoint: function(i) {
  18301. return function(e, t) {
  18302. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18303. }
  18304. },
  18305. floorDistanceToPoint: function(i) {
  18306. return function(e, t) {
  18307. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18308. }
  18309. },
  18310. choose: function(i) {
  18311. return function(e, t) {
  18312. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18313. }
  18314. }
  18315. },
  18316. r.scoreFunctions = {
  18317. distance: function(t, i) {
  18318. return i = i || a.navigation.distanceFactor,
  18319. function(e) {
  18320. return t ? t.position.distanceTo(e.position) * i : 0
  18321. }
  18322. },
  18323. distanceSquared: function(t, i) {
  18324. return i = i || a.navigation.distanceFactor,
  18325. function(e) {
  18326. return t ? t.position.distanceToSquared(e.position) * i : 0
  18327. }
  18328. },
  18329. direction: function(t, i) {
  18330. return function(e) {
  18331. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18332. }
  18333. },
  18334. angle: function(t, i) {
  18335. return function(e) {
  18336. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18337. }
  18338. },
  18339. inFieldOfView: function(t, i) {
  18340. return function(e) {
  18341. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18342. }
  18343. },
  18344. optionality: function(t) {
  18345. return function(e) {
  18346. return e.neighbourUUIDs.filter(function(e) {
  18347. return !(e in t.neighbourUUIDs) && e !== t.id
  18348. }).length * a.navigation.optionalityFactor
  18349. }
  18350. },
  18351. penalizeHeightDifferenceUnder: function(t, i) {
  18352. return function(e) {
  18353. return t.y - e.position.y < i ? -20 : 0
  18354. }
  18355. }
  18356. },
  18357. M.exports = r
  18358. }
  18359. ).call(this, "/js/objects/Panorama.js")
  18360. }
  18361. , {
  18362. "../enum/AlignmentType": 17,
  18363. "../enum/GLCubeFaces": 25,
  18364. "../enum/PanoRendererEvents": 35,
  18365. "../enum/PanoSizeClass": 36,
  18366. "../enum/PanoramaEvents": 37,
  18367. "../enum/RenderLayers": 41,
  18368. "../enum/RenderOrder": 42,
  18369. "../enum/TileDownloaderEvents": 45,
  18370. "../enum/Viewmode": 51,
  18371. "../exception/BasicException": 55,
  18372. "../scene/SceneRenderer": 158,
  18373. "../settings": 166,
  18374. "../tile/TileUtils": 174,
  18375. "../util/ajax": 181,
  18376. "../util/common": 185,
  18377. "../util/lerp": 188,
  18378. "../util/logger": 189,
  18379. "../util/panorama": 191,
  18380. "../util/texture": 194,
  18381. "../util/transitions": 195,
  18382. events: 202,
  18383. three: 217
  18384. }],
  18385. 149: [function(e, t, i) {
  18386. "use strict";
  18387. function n(e) {
  18388. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18389. t.map.value = d,
  18390. t.opacity.value = 0,
  18391. t.color.value.set(o.reticuleColor),
  18392. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18393. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18394. side: r.DoubleSide,
  18395. depthWrite: !1,
  18396. depthTest: !1,
  18397. transparent: !0,
  18398. vertexShader: c.waypoint.vertexShader,
  18399. fragmentShader: c.waypoint.fragmentShader,
  18400. uniforms: t,
  18401. name: "waypoint",
  18402. opacity: 0,
  18403. visible: t.showMouseMarker
  18404. })),
  18405. this.layers.set(h.RETICULE),
  18406. this.renderOrder = u.reticule,
  18407. this.player = e,
  18408. this.direction = new r.Vector3,
  18409. this.hidden = !0,
  18410. this.mouseLastMoveTime = Date.now()
  18411. }
  18412. var r = e("three")
  18413. , o = e("../settings")
  18414. , a = e("../util/transitions")
  18415. , s = e("../util/texture")
  18416. , l = e("../util/lerp")
  18417. , c = e("../shaders")
  18418. , h = e("../enum/RenderLayers")
  18419. , u = e("../enum/RenderOrder")
  18420. , d = s.load("images/reticule-256x256.png");
  18421. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18422. this.hidden = i,
  18423. this.mouseLastMoveTime = Date.now()
  18424. }
  18425. ,
  18426. n.prototype.hide = function() {
  18427. this.hidden || (this.hidden = !0,
  18428. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18429. }
  18430. ,
  18431. n.prototype.show = function() {
  18432. this.hidden = !1,
  18433. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18434. }
  18435. ,
  18436. n.prototype.update = function() {
  18437. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18438. }
  18439. ,
  18440. n.prototype.updatePosition = function(e, t) {
  18441. if (!this.hidden) {
  18442. if (!t)
  18443. return this.hide();
  18444. var i = t.point
  18445. , n = e.distanceTo(i)
  18446. , r = 1 + .01 * n;
  18447. n < 1 && (r -= 1 - n),
  18448. this.show(),
  18449. this.scale.set(r, r, r),
  18450. this.direction = this.direction.multiplyScalar(.8),
  18451. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18452. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18453. this.lookAt(this.position.clone().add(this.direction))
  18454. }
  18455. }
  18456. ,
  18457. n.prototype.writeAstag = function() {
  18458. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18459. , t = new Date;
  18460. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18461. var i = {
  18462. enabled: !0,
  18463. version: "0",
  18464. created: t.toISOString(),
  18465. created_by: "APITest",
  18466. position: this.position.clone(),
  18467. stem: {
  18468. enabled: o.tags.pole.enabled,
  18469. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18470. },
  18471. label: "tag " + this.tagCount,
  18472. description: "Description " + e,
  18473. floor: function(e) {
  18474. if (e.currentFloor) {
  18475. var t = e.floors.indexOf(e.currentFloor);
  18476. return -1 < t ? t : void 0
  18477. }
  18478. }(this.player.model),
  18479. type: "info",
  18480. metadata: {
  18481. preferred_camera: {
  18482. mode: this.player.mode
  18483. }
  18484. }
  18485. };
  18486. console.log("--------------------------"),
  18487. console.log(JSON.stringify(i));
  18488. var n = this.player.model.addtag(e, i).build();
  18489. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18490. n.visible || n.show(o.tags.startup.fadeInDuration))
  18491. }
  18492. ,
  18493. t.exports = n
  18494. }
  18495. , {
  18496. "../enum/RenderLayers": 41,
  18497. "../enum/RenderOrder": 42,
  18498. "../settings": 166,
  18499. "../shaders": 167,
  18500. "../util/lerp": 188,
  18501. "../util/texture": 194,
  18502. "../util/transitions": 195,
  18503. three: 217
  18504. }],
  18505. 150: [function(e, t, i) {
  18506. "use strict";
  18507. function n(e, t) {
  18508. this.chunks = [],
  18509. this.floorId = e,
  18510. this.roomId = t,
  18511. this.position = new l.Vector3
  18512. }
  18513. var l = e("three");
  18514. n.prototype.addChunk = function(e) {
  18515. this.chunks.push(e)
  18516. }
  18517. ,
  18518. n.prototype.calcBoundaries = function() {
  18519. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18520. var a = this.chunks[o].geometry.attributes.position;
  18521. if (a)
  18522. for (var s = 0; s < a.array.length; s += 3)
  18523. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18524. t.add(e),
  18525. 0 === s ? (i.copy(e),
  18526. n.copy(e)) : (i.max(e),
  18527. n.min(e)),
  18528. r++
  18529. }
  18530. 0 < r ? (t.multiplyScalar(1 / r),
  18531. this.average = t) : this.average = null,
  18532. this.boundsMax = i,
  18533. this.boundsMin = n,
  18534. this.center = new l.Vector3,
  18535. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18536. }
  18537. ,
  18538. t.exports = n
  18539. }
  18540. , {
  18541. three: 217
  18542. }],
  18543. 151: [function(o, v, e) {
  18544. (function(e) {
  18545. "use strict";
  18546. function t(e, t, i) {
  18547. this.obj3d = null,
  18548. this.nodes = [],
  18549. this.colorHull = [],
  18550. this.shortPaths = {},
  18551. this.floorHull = null,
  18552. this.cameraHull = null,
  18553. this.floorPathDistance = 0,
  18554. this.floorCurvePoints = null,
  18555. this.floorCurveColors = null,
  18556. this.camCurvePoints = null,
  18557. this.warpDestHeroLoc = null,
  18558. this.warpDestPano = null,
  18559. this.warpPathPoints = null,
  18560. this.warpPathLengths = [0],
  18561. this.warpLength = 0,
  18562. this.closeWarpDistance = 4,
  18563. this.UP = U.UP.clone(),
  18564. this.longestStep = 0,
  18565. this.upcomingTransType = null,
  18566. this.burnsDir = 1,
  18567. this.prevNextDist = 0,
  18568. this.nextI = 0,
  18569. this.activeTransType = null,
  18570. this.lastTransType = null,
  18571. this.bunnyObj = null,
  18572. this.director = e,
  18573. this.player = t,
  18574. this.playerControls = i,
  18575. this.modelManager = t.modelManager,
  18576. this.updateModel(),
  18577. this.updateDefaultsFromModelData(),
  18578. this.bindEvents(),
  18579. this.warping = !1,
  18580. this.waitingToWarp = !1,
  18581. this.warpInterrupted = !1,
  18582. this.warpInterruptionBlackoutStyle = null,
  18583. this.warpInterruptionTravelTime = null
  18584. }
  18585. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18586. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18587. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18588. path: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18589. pathEnd: n.load("images/End.png"),
  18590. pathStart: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18591. };
  18592. t.prototype.setScene = function(e) {
  18593. this.createCpm(e),
  18594. this.createBunnyObj(e)
  18595. }
  18596. ,
  18597. t.prototype.updateModel = function() {
  18598. this.model = this.modelManager.getActiveModel()
  18599. }
  18600. ,
  18601. t.prototype.bindEvents = function() {
  18602. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18603. }
  18604. ,
  18605. t.prototype.updateDefaultsFromModelData = function() {
  18606. this.model.data
  18607. }
  18608. ,
  18609. t.prototype.pointPathDistance = function(e) {
  18610. for (var t = 0, i = 1; i < e.length; i += 1)
  18611. t += e[i - 1].distanceTo(e[i]);
  18612. return t
  18613. }
  18614. ,
  18615. t.prototype.pointPathLengths = function(e) {
  18616. for (var t = [0], i = 1; i < e.length; i += 1)
  18617. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18618. return t
  18619. }
  18620. ,
  18621. t.prototype.interpAlongPath = function(e, t, i) {
  18622. var n, r = new P.Vector3, o = t[t.length - 1];
  18623. if (i < 1) {
  18624. n = i * o;
  18625. for (var a = 1; a < t.length; a += 1)
  18626. if (t[a] > n) {
  18627. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18628. return r.copy(e[a]),
  18629. r.sub(e[a - 1]),
  18630. r.multiplyScalar(s),
  18631. r.add(e[a - 1]),
  18632. r
  18633. }
  18634. } else
  18635. r.copy(e[e.length - 1]);
  18636. return r
  18637. }
  18638. ,
  18639. t.prototype.pathHeight = function() {
  18640. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18641. }
  18642. ,
  18643. t.prototype.createBunnyObj = function(e) {
  18644. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18645. this.bunnyObj.visible = D.warp.showBunny),
  18646. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18647. e.add(this.bunnyObj)
  18648. }
  18649. ,
  18650. t.prototype.createCpm = function(e) {
  18651. if (!this.currentPanoMarker) {
  18652. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18653. t.material.uniforms.opacity.value = 0,
  18654. this.currentPanoMarker = {
  18655. mesh: t,
  18656. placed: !1
  18657. }
  18658. }
  18659. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18660. this.placeCpm(),
  18661. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18662. }
  18663. ,
  18664. t.prototype.placeCpm = function() {
  18665. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18666. var e = this.player.currentPano.floor;
  18667. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18668. e.add(this.currentPanoMarker.mesh)),
  18669. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18670. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18671. this.currentPanoMarker.placed = !0
  18672. } else
  18673. this.popOutCpm()
  18674. }
  18675. ,
  18676. t.prototype.fadeInCpm = function(e) {
  18677. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18678. }
  18679. ,
  18680. t.prototype.fadeOutCpm = function(e) {
  18681. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18682. }
  18683. ,
  18684. t.prototype.popInCpm = function() {
  18685. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18686. }
  18687. ,
  18688. t.prototype.popOutCpm = function() {
  18689. this.fadeOutCpm(2)
  18690. }
  18691. ,
  18692. t.prototype.brushPrefs = {
  18693. linewidth: 7,
  18694. strokeWidth: 15,
  18695. cvSegments: 48,
  18696. paveStep: .1,
  18697. paveWidth: .2,
  18698. lookBlendDist: 3,
  18699. maxTurn: P.Math.degToRad(2)
  18700. },
  18701. t.prototype.panoPathDistance = function(e) {
  18702. var t = this.model.panos;
  18703. if (!e || e.length < 2)
  18704. return 0;
  18705. for (var i = [], n = 0; n < e.length; n += 1)
  18706. i.push(t.get(e[n]).floorPosition);
  18707. return this.pointPathDistance(i)
  18708. }
  18709. ,
  18710. t.prototype.loadTileTexture = function(t) {
  18711. var e = n.load(t, function(e) {
  18712. e.wrapS = P.RepeatWrapping,
  18713. e.wrapT = P.RepeatWrapping,
  18714. e.needsUpdate = !0,
  18715. H.debug('path texture "' + t + '" is ready')
  18716. }, function() {
  18717. H.error('path texture "' + t + '" failed')
  18718. });
  18719. return e.mapping = P.UVMapping,
  18720. e
  18721. }
  18722. ,
  18723. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18724. return new l({
  18725. cameraMode: n,
  18726. position: e,
  18727. quaternion: t,
  18728. panoId: i,
  18729. orthoZoom: o,
  18730. floorVisibility: r,
  18731. thumbUrl: null,
  18732. name: null
  18733. })
  18734. }
  18735. ,
  18736. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18737. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18738. }
  18739. ,
  18740. t.prototype.setWarpDestination = function(e) {
  18741. this.warpDestHeroLoc = e
  18742. }
  18743. ,
  18744. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18745. var t = this.getHeroDescriptorByHeroIndex(e);
  18746. return null !== t && (this.setWarpDestination(t),
  18747. !0)
  18748. }
  18749. ,
  18750. t.prototype.setWarpDestinationByPano = function(e, t) {
  18751. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18752. }
  18753. ,
  18754. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18755. var i = this.model.panos.get(e);
  18756. if (i) {
  18757. t = t || new P.Quaternion;
  18758. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18759. return this.setWarpDestination(n),
  18760. !0
  18761. }
  18762. return !1
  18763. }
  18764. ,
  18765. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18766. var t = this.model.heroCount();
  18767. if (null !== this.warpDestHeroLoc && t < 2)
  18768. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18769. this.model.getHeroDescriptorByIndex(0);
  18770. var i = this.model.getHeroDescriptorByIndex(e);
  18771. if (i) {
  18772. var n = i.isPano() ? i.panoId : i.cameraMode;
  18773. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18774. }
  18775. return i
  18776. }
  18777. ,
  18778. t.prototype.getHeroDescriptorByPano = function(e) {
  18779. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18780. }
  18781. ,
  18782. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18783. var t = this.getHeroIndexFromPanoId(e);
  18784. return this.getHeroDescriptorByHeroIndex(t)
  18785. }
  18786. ,
  18787. t.prototype.getHeroIndexFromPanoId = function(e) {
  18788. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18789. var i = this.model.heroLocations[t]
  18790. , n = this.getHeroId(i);
  18791. if (n && n === e)
  18792. return t
  18793. }
  18794. return -1
  18795. }
  18796. ,
  18797. t.prototype.getHeroPano = function(e) {
  18798. if (null === e)
  18799. return H.warn("getHeroPano(): no destination"),
  18800. null;
  18801. var t = this.getHeroId(e)
  18802. , i = this.model.panos.get(t);
  18803. return void 0 === i && (i = null,
  18804. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18805. i
  18806. }
  18807. ,
  18808. t.prototype.getHeroId = function(e) {
  18809. return e.panoId
  18810. }
  18811. ,
  18812. t.prototype.setWarpDestPano = function() {
  18813. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18814. this.warpDestPano
  18815. }
  18816. ,
  18817. t.prototype.brushToWarpPano = function(e, t) {
  18818. if (this.discardPathObject(),
  18819. !this.setWarpDestPano())
  18820. return !1;
  18821. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18822. !this.warpDestPano)
  18823. return H.info("No brush"),
  18824. !1;
  18825. if (!this.player.currentPano)
  18826. return H.debug("No current pano, visibility undefined"),
  18827. !1;
  18828. if (!this.warpDestPano)
  18829. return H.info("No wPano, visibility undefined"),
  18830. !1;
  18831. if (!this.warpDestPano.isAligned())
  18832. return H.debug("Cannot brush to unaligned pano"),
  18833. !1;
  18834. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18835. , n = !0;
  18836. if (this.player.currentPano.id === this.warpDestPano.id)
  18837. H.debug("Already at destination pano");
  18838. else {
  18839. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18840. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18841. this.obj3d = new P.Object3D,
  18842. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18843. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18844. e = t) : (this.setPathHulls(this.nodes),
  18845. this.setFloorCurves(),
  18846. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  18847. this.player.currentPano.floor.add(this.obj3d);
  18848. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18849. , o = e === L.STD;
  18850. if (!n && (i || o)) {
  18851. if (r) {
  18852. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18853. this.obj3d.add(a)
  18854. }
  18855. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18856. this.obj3d.add(s)
  18857. }
  18858. this.appearSlow()
  18859. }
  18860. return this.upcomingTransType = e,
  18861. !n
  18862. }
  18863. ,
  18864. t.prototype.findShortestPath = function(e, t) {
  18865. if (!e || !t)
  18866. return null;
  18867. var i = D.warp.walkExtraPanosDistance
  18868. , n = e.id + ":" + t.id + ":" + i;
  18869. if (this.shortPaths.hasOwnProperty(n))
  18870. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18871. var r = t.id + ":" + e.id + ":" + i;
  18872. if (this.shortPaths.hasOwnProperty(r))
  18873. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18874. var o = this.model.panos.aStarSearch(e, t);
  18875. return this.model.panos.includeNodesNearPath(o, i),
  18876. this.shortPaths[n] = o ? o.slice() : null,
  18877. o
  18878. }
  18879. ,
  18880. t.prototype.makePathHulls = function(e) {
  18881. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18882. r = (t = h.get(e[0])).floor.floorIndex;
  18883. for (var u = 0; u < e.length; u += 1)
  18884. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18885. s.push(i),
  18886. l.push(t.position.clone()),
  18887. n = t.floor.floorIndex,
  18888. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18889. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18890. return a > this.longestStep && (this.longestStep = a,
  18891. H.debug("path contains " + a + " meter segment")),
  18892. {
  18893. floor: s,
  18894. camera: l,
  18895. color: c
  18896. }
  18897. }
  18898. ,
  18899. t.prototype.makeFloorCurves = function(e, t, i) {
  18900. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18901. , r = this.pointPathDistance(e) - 2 * n
  18902. , o = e.slice(0)
  18903. , a = o[1].clone().sub(o[0]);
  18904. a.y = 0,
  18905. a.normalize().multiplyScalar(n),
  18906. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18907. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18908. a.normalize().multiplyScalar(n),
  18909. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18910. var s = new P.CatmullRomCurve3(o)
  18911. , l = Math.floor(r / i);
  18912. l = 4 * Math.floor(l / 4),
  18913. l = Math.max(4, l);
  18914. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18915. h = 0,
  18916. c = u[f].distanceTo(e[0]);
  18917. for (var g = 1; g < e.length; g += 1)
  18918. p.copy(u[f]).sub(e[g]),
  18919. p.y *= 4,
  18920. p.length() < c && (h = g);
  18921. d.push(t[h])
  18922. }
  18923. return {
  18924. distance: r,
  18925. points: u,
  18926. colors: d
  18927. }
  18928. }
  18929. ,
  18930. t.prototype.makeCameraCurvePoints = function(e, t) {
  18931. var i = this.pointPathDistance(e);
  18932. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18933. }
  18934. ,
  18935. t.prototype.makeCameraCurveTangents = function(e, t) {
  18936. var i = this.pointPathDistance(e)
  18937. , n = new P.CatmullRomCurve3(e)
  18938. , r = Math.max(2, Math.floor(i / t));
  18939. r = r || 5;
  18940. for (var o = [], a = 0; a <= r; a++)
  18941. o.push(n.getTangentAt(a / r));
  18942. return o
  18943. }
  18944. ,
  18945. t.prototype.setPathHulls = function(e) {
  18946. var t = this.makePathHulls(e);
  18947. this.floorHull = t.floor,
  18948. this.cameraHull = t.camera,
  18949. this.colorHull = t.color
  18950. }
  18951. ,
  18952. t.prototype.setFloorCurves = function() {
  18953. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18954. this.floorPathDistance = e.distance,
  18955. this.floorCurvePoints = e.points,
  18956. this.floorCurveColors = e.colors
  18957. }
  18958. ,
  18959. t.prototype.setCameraCurvePoints = function() {
  18960. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18961. }
  18962. ,
  18963. t.prototype.chooseWarpPath = function(e) {
  18964. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18965. if (this.player.currentPano === this.warpDestPano || !e)
  18966. return this.warpPathPoints = null,
  18967. this.warpLength = 0,
  18968. !1;
  18969. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18970. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18971. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18972. t.multiplyScalar(.15).add(r.position),
  18973. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18974. t.y = r.position.y,
  18975. i.y = this.warpDestPano.position.y,
  18976. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18977. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18978. this.setCameraCurvePoints(),
  18979. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18980. this.warpLength = 0,
  18981. this.warpPathLengths = [0];
  18982. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  18983. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18984. var h = o.length();
  18985. o.y *= D.warp.climbEffort;
  18986. var u = o.length() / h;
  18987. if (1 < c) {
  18988. o.setY(0).normalize(),
  18989. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18990. var d = Math.min(1, o.dot(a))
  18991. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18992. u = Math.max(p, u)
  18993. }
  18994. this.warpLength += h * u,
  18995. this.warpPathLengths[c] = this.warpLength
  18996. }
  18997. return !0
  18998. }
  18999. ,
  19000. t.prototype.drawPathRibbon = function(e, t) {
  19001. this.bunnyObj.visible = D.warp.showBunny;
  19002. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  19003. a.copy(e[s]),
  19004. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19005. a.normalize(),
  19006. n.crossVectors(a, U.UP),
  19007. n.multiplyScalar(i);
  19008. var l = (new P.Vector3).copy(e[s]).add(r);
  19009. l.sub(n),
  19010. o.vertices.push(l),
  19011. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19012. o.vertices.push(l)
  19013. }
  19014. var c, h, u, d = 0;
  19015. for (s = 0; s < e.length - 1; s += 1) {
  19016. var p = 2 * s
  19017. , f = d
  19018. , g = d += e[s + 1].distanceTo(e[s])
  19019. , m = t[s]
  19020. , v = t[s + 1];
  19021. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19022. o.faces.push(c),
  19023. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19024. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19025. o.faces.push(c),
  19026. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19027. }
  19028. o.computeFaceNormals(),
  19029. o.computeVertexNormals(),
  19030. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19031. u.opacity.value = 0,
  19032. u.color.value.set(D.path.color),
  19033. new P.RawShaderMaterial({
  19034. side: P.DoubleSide,
  19035. depthWrite: !1,
  19036. transparent: !0,
  19037. vertexShader: C.ribbon.vertexShader,
  19038. fragmentShader: C.ribbon.fragmentShader,
  19039. uniforms: u,
  19040. name: "ribbonT",
  19041. opacity: 0
  19042. })) : new P.MeshBasicMaterial({
  19043. color: 16777215,
  19044. side: P.DoubleSide,
  19045. name: "ribbonOut",
  19046. vertexColors: P.VertexColors
  19047. });
  19048. var y = new P.Mesh(o,h);
  19049. return y.name = "ribbon",
  19050. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19051. y
  19052. }
  19053. ,
  19054. t.prototype.drawPathPavement = function(e) {
  19055. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19056. r.copy(e[o]),
  19057. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19058. r.normalize(),
  19059. i.crossVectors(r, U.UP),
  19060. i.multiplyScalar(this.brushPrefs.paveWidth),
  19061. (t = (new P.Vector3).copy(e[o])).sub(i),
  19062. n.vertices.push(t),
  19063. n.vertices.push((new P.Vector3).copy(e[o])),
  19064. (t = (new P.Vector3).copy(e[o])).add(i),
  19065. n.vertices.push(t);
  19066. var a, s, l;
  19067. for (o = 0; o < e.length - 1; o += 1)
  19068. a = 3 * o + 1,
  19069. l = .25 + (s = .25 * o),
  19070. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19071. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19072. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19073. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19074. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19075. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19076. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19077. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19078. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19079. color: D.path.color,
  19080. side: P.DoubleSide,
  19081. transparent: !0,
  19082. depthWrite: !1,
  19083. opacity: 0,
  19084. name: "paveT",
  19085. map: I.path
  19086. }) : new P.MeshBasicMaterial({
  19087. color: D.path.color,
  19088. side: P.DoubleSide,
  19089. transparent: !0,
  19090. depthWrite: !1,
  19091. opacity: 1,
  19092. name: "paveO",
  19093. map: I.path
  19094. });
  19095. return new P.Mesh(n,c)
  19096. }
  19097. ,
  19098. t.prototype.hintPrefs = {
  19099. rad: .18,
  19100. width: .0125,
  19101. depth: .0625,
  19102. setBack: -.04,
  19103. markRad: .25,
  19104. markInnerRad: .16
  19105. },
  19106. t.prototype.makeWaypointObj = function(e, t) {
  19107. var i = new P.Geometry
  19108. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19109. , r = this.pathHeight();
  19110. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  19111. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19112. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19113. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19114. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19115. o.map.value = e,
  19116. o.opacity.value = 0,
  19117. o.color.value.set(D.path.color);
  19118. var a = {
  19119. side: P.DoubleSide,
  19120. depthWrite: !1,
  19121. transparent: !0,
  19122. vertexShader: C.waypoint.vertexShader,
  19123. fragmentShader: C.waypoint.fragmentShader,
  19124. uniforms: o,
  19125. name: "waypoint",
  19126. opacity: 0
  19127. };
  19128. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19129. a.name = "wayPtOut");
  19130. var s = new P.RawShaderMaterial(a)
  19131. , l = new P.Mesh(i,s);
  19132. return l.name = t,
  19133. l
  19134. }
  19135. ,
  19136. t.prototype.makeStartMarker = function(e, t) {
  19137. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19138. i.y = 0,
  19139. i.normalize();
  19140. var n = Math.acos(i.x)
  19141. , r = this.makeWaypointObj(I.pathStart, "Start");
  19142. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19143. r.position.copy(e),
  19144. r
  19145. }
  19146. ,
  19147. t.prototype.makeEndMarker = function(e) {
  19148. var t = this.makeWaypointObj(I.pathEnd, "End")
  19149. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19150. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19151. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19152. t.position.copy(e),
  19153. t
  19154. }
  19155. ,
  19156. t.prototype.pathClean = function(e) {
  19157. if (e) {
  19158. for (var t in e.children)
  19159. this.pathClean(e.children[t]);
  19160. e.geometry && e.geometry.dispose(),
  19161. e.material && e.material.dispose()
  19162. }
  19163. }
  19164. ,
  19165. t.prototype.discardPathObject = function() {
  19166. if (this.obj3d) {
  19167. var e = this.obj3d.parent;
  19168. e && e.remove(this.obj3d),
  19169. this.pathClean(this.obj3d)
  19170. }
  19171. this.obj3d = null,
  19172. this.popInCpm()
  19173. }
  19174. ,
  19175. t.prototype.discardSlow = function() {
  19176. if (this.obj3d) {
  19177. if (this.player.mode !== O.PANORAMA)
  19178. return void this.discardPathObject();
  19179. for (var e, t = 0, i = function() {
  19180. this.discardPathObject()
  19181. }
  19182. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19183. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19184. t += 1,
  19185. i = null);
  19186. 0 === t && this.discardPathObject(),
  19187. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19188. }
  19189. }
  19190. ,
  19191. t.prototype.appearSlow = function() {
  19192. var e;
  19193. this.fadeOutCpm(D.path.fadeInTime);
  19194. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19195. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19196. }
  19197. ,
  19198. t.prototype.update = function() {
  19199. this.obj3d && this.obj3d.updateMatrixWorld()
  19200. }
  19201. ,
  19202. t.prototype.calcBurnsAmount = function(e) {
  19203. var n = P.Math.degToRad(D.warp.burnsAngle);
  19204. if (this.player.mode !== O.PANORAMA)
  19205. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19206. var t = this.burnsDir * n;
  19207. if (this.upcomingTransType === L.BLACK)
  19208. return t;
  19209. var i = e;
  19210. if (null === i)
  19211. return H.warn("Transition request for non-highlight"),
  19212. t;
  19213. var r = this.getHeroDescriptorByHeroIndex(i);
  19214. if (null === r)
  19215. return t;
  19216. if (!r.isPano())
  19217. return t;
  19218. function o(e) {
  19219. var t = Math.acos(Math.min(1, e.dot(l)))
  19220. , i = (new P.Vector3).crossVectors(l, e);
  19221. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19222. }
  19223. var a = this.getHeroPano(r)
  19224. , s = this.playerControls.cameras[O.PANORAMA]
  19225. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19226. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19227. if (a === this.player.currentPano)
  19228. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19229. var h = this.findShortestPath(this.player.currentPano, a);
  19230. if (null == h || h.length < 1)
  19231. return H.debug("Empty path ahead..."),
  19232. t;
  19233. var u = this.makePathHulls(h)
  19234. , d = new P.CatmullRomCurve3(u.camera)
  19235. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19236. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19237. }
  19238. ,
  19239. t.prototype.waitNextStep = function(e, t, i) {
  19240. var o = null == i ? D.warp.tourStepDelay : i;
  19241. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19242. var a = new P.Euler
  19243. , s = new P.Vector3;
  19244. H.debug("Starting wait: " + (void 0 !== t));
  19245. var l = this.calcBurnsAmount(e)
  19246. , c = function() {
  19247. this.endWarpState(),
  19248. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19249. t && t()
  19250. }
  19251. .bind(this)
  19252. , n = function(e, t) {
  19253. if (this.warpInterrupted)
  19254. return c(),
  19255. !0;
  19256. var i = t || 1e3 / 60;
  19257. if (D.warp.doBurns)
  19258. if (this.player.mode === O.PANORAMA) {
  19259. var n = this.playerControls.cameras[O.PANORAMA];
  19260. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19261. var r = i * l / o;
  19262. a.y += r,
  19263. s.set(0, 0, -1),
  19264. s.applyEuler(a),
  19265. s.add(n.position),
  19266. n.controls.lookAt(s),
  19267. n.controls.lookVector.copy(s),
  19268. n.lookAt(s)
  19269. } else
  19270. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19271. }
  19272. .bind(this);
  19273. this.startWarpState(),
  19274. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19275. /* var r = player.model.heroLocations[app.director.currentItem];
  19276. this.player.zoomEnabled = !0;
  19277. var h = function(e, t) {
  19278. //console.log(e),
  19279. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19280. }
  19281. .bind(this);
  19282. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19283. }
  19284. ,
  19285. t.prototype.warpToNonPano = function(e) {
  19286. if (this.discardPathObject(),
  19287. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19288. var t = function() {
  19289. e && e()
  19290. }
  19291. .bind(this);
  19292. this.player.flyToNewMode({
  19293. mode: this.warpDestHeroLoc.cameraMode,
  19294. duration: D.warp.outsideTime,
  19295. warpDest: this.warpDestHeroLoc,
  19296. callback: t,
  19297. force: !0
  19298. })
  19299. } else
  19300. H.warn("no warp destination!!!"),
  19301. e && e()
  19302. }
  19303. ,
  19304. t.prototype._resetWarpShaderParams = function(e) {
  19305. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19306. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19307. }
  19308. ,
  19309. t.prototype._clearWarpShading = function() {
  19310. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19311. this._resetWarpShaderParams(e[t]),
  19312. e[t].visible = !0;
  19313. this._resetWarpShaderParams(this.model.skybox)
  19314. }
  19315. ,
  19316. t.prototype._warpStopFlying = function() {
  19317. this.activeTransType = null,
  19318. this.placeCpm()
  19319. }
  19320. ,
  19321. t.prototype._wrapupTravelOnlyBits = function() {
  19322. this._warpStopFlying(),
  19323. this.warpPathPoints && (this.player.currentPano.exit(),
  19324. this.warpDestPano.enter(),
  19325. this.player.currentPano = this.warpDestPano),
  19326. this.player.spider.draw(),
  19327. this.placeCpm()
  19328. }
  19329. ,
  19330. t.prototype._wrapupTravel = function(e) {
  19331. this._wrapupTravelOnlyBits(),
  19332. this.warpCameraAim(e)
  19333. }
  19334. ,
  19335. t.prototype._wrapupWarpShading = function(e) {
  19336. this._clearWarpShading(),
  19337. this._wrapupTravel(e)
  19338. }
  19339. ,
  19340. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19341. t !== z.END && this._clearWarpShading(),
  19342. this._wrapupTravelOnlyBits(),
  19343. this.upcomingTransType = null,
  19344. e && e()
  19345. }
  19346. ,
  19347. t.prototype._warpCameraAim = function(e, t) {
  19348. var i = this.warpDestHeroLoc.quaternion
  19349. , n = this.playerControls.cameras[O.PANORAMA]
  19350. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19351. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19352. , a = P.Math.radToDeg(Math.acos(o))
  19353. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19354. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19355. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19356. c.y = N.constrainedTurn(c.y),
  19357. this.burnsDir = Math.sign(c.y);
  19358. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19359. , u = new P.Vector3
  19360. , d = function(e, t) {
  19361. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19362. h.y = l.y + e * c.y,
  19363. h.z = l.z + e * c.z,
  19364. u.set(0, 0, -1),
  19365. u.applyEuler(h),
  19366. u.add(n.position),
  19367. n.controls.lookAt(u),
  19368. n.controls.lookVector.copy(u),
  19369. void n.lookAt(u))
  19370. }
  19371. .bind(this);
  19372. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19373. void (t && t()))
  19374. }
  19375. ,
  19376. t.prototype._warpBendAim = function(e, t, i, n) {
  19377. var r = n || 0
  19378. , o = this.playerControls.cameras[O.PANORAMA]
  19379. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19380. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19381. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19382. l.y = N.constrainedTurn(l.y);
  19383. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19384. l.x = c * Math.sign(l.x),
  19385. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19386. this.burnsDir = Math.sign(l.y),
  19387. c *= Math.sign(l.y),
  19388. l.y = c;
  19389. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19390. , u = new P.Vector3
  19391. , d = function(e, t) {
  19392. if (e < .5)
  19393. h.x = s.x + e * l.x,
  19394. h.y = s.y + e * l.y,
  19395. h.z = s.z + e * l.z;
  19396. else {
  19397. var i = (1 - e) * D.warp.softBendEnd;
  19398. h.x = a.x - i * l.x,
  19399. h.y = a.y - i * l.y,
  19400. h.z = a.z - i * l.z
  19401. }
  19402. u.set(0, 0, -1),
  19403. u.applyEuler(h),
  19404. u.add(o.position),
  19405. o.controls.lookAt(u),
  19406. o.controls.lookVector.copy(u),
  19407. o.lookAt(u)
  19408. }
  19409. .bind(this);
  19410. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19411. }
  19412. ,
  19413. t.prototype._warpStepCameraAim = function(e, t, i) {
  19414. var n = this.playerControls.cameras[O.PANORAMA]
  19415. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19416. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19417. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19418. a.y = N.constrainedTurn(a.y),
  19419. this.burnsDir = Math.sign(a.y);
  19420. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19421. , l = new P.Vector3
  19422. , c = function(e, t) {
  19423. e < .5 ? s.copy(o) : s.copy(r),
  19424. l.set(0, 0, -1),
  19425. l.applyEuler(s),
  19426. l.add(n.position),
  19427. n.controls.lookAt(l),
  19428. n.controls.lookVector.copy(l),
  19429. n.lookAt(l)
  19430. }
  19431. .bind(this);
  19432. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19433. }
  19434. ,
  19435. t.prototype.setBurnsDir = function() {
  19436. var e = this.playerControls.cameras[O.PANORAMA]
  19437. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19438. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19439. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19440. n.y = N.constrainedTurn(n.y),
  19441. this.burnsDir = Math.sign(n.y)
  19442. }
  19443. ,
  19444. t.prototype.stepWarpPath = function(e, t) {
  19445. var i = this.playerControls.cameras[O.PANORAMA];
  19446. if (!this.warpPathPoints)
  19447. return i.position.copy(this.warpDestPano.position),
  19448. !0;
  19449. var n = this.warpPathPoints[0]
  19450. , r = this.warpDestPano.position;
  19451. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19452. var o = new P.Vector3;
  19453. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19454. i.position.copy(o)
  19455. } else
  19456. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19457. }
  19458. ,
  19459. t.prototype.interruptAndFastForward = function(e, t) {
  19460. this.warping && (this.warpInterrupted = !0,
  19461. this.warpInterruptionBlackoutStyle = e,
  19462. this.warpInterruptionTravelTime = t,
  19463. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19464. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19465. }
  19466. ,
  19467. t.prototype.warpCameraAim = function(e) {
  19468. var t = D.warp.minWarpTime;
  19469. if (this.upcomingTransType === L.BLACK)
  19470. t = D.warp.teleportTime;
  19471. else {
  19472. var i = this.playerControls.cameras[O.PANORAMA]
  19473. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19474. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19475. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19476. o.y = N.constrainedTurn(o.y);
  19477. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19478. t = Math.max(t, a)
  19479. }
  19480. var s = function() {
  19481. this._warpStopFlying(),
  19482. this.discardSlow(),
  19483. e && e()
  19484. }
  19485. .bind(this);
  19486. this._warpCameraAim(t, s)
  19487. }
  19488. ,
  19489. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19490. this.model.skybox.material.uniforms.blackout.value = n;
  19491. var r = F.uniform(this.model.skybox, "progress", 1)
  19492. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19493. , a = !1
  19494. , s = function() {
  19495. if (this.warpInterrupted)
  19496. return a = !0
  19497. }
  19498. .bind(this)
  19499. , l = function(e, t) {
  19500. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19501. }
  19502. .bind(this)
  19503. , c = function(e, t) {
  19504. return i && a ? (o(0),
  19505. !0) : void o(e, t)
  19506. }
  19507. .bind(this);
  19508. V.start(s, e, null, t, null, "safeHaltWatch"),
  19509. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19510. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19511. }
  19512. ,
  19513. t.prototype.warpTravel_STD = function(e) {
  19514. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19515. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19516. t += this.warpLength * D.warp.timePerMeter,
  19517. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19518. function n(e) {
  19519. var t = i;
  19520. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19521. }
  19522. var y = !1
  19523. , r = this.warpDestHeroLoc.quaternion
  19524. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19525. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19526. , a = A.dot(o)
  19527. , C = P.Math.radToDeg(Math.acos(a))
  19528. , s = function() {
  19529. return m.lookAt(g, l, U.UP),
  19530. u.setFromRotationMatrix(m, D.warp.eOrder),
  19531. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19532. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19533. N.constrainedTurn(v.y)
  19534. }
  19535. .bind(this)
  19536. , I = function(e, t) {
  19537. if (this.warpInterrupted)
  19538. return y = !0
  19539. }
  19540. .bind(this)
  19541. , E = function(e, t) {
  19542. return y || !this.warpPathPoints ? (k.blur(0),
  19543. !0) : void k.blur(e)
  19544. }
  19545. .bind(this)
  19546. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19547. , b = function(e, t) {
  19548. return y || !this.warpPathPoints ? (_(0),
  19549. !0) : void _(e, t)
  19550. }
  19551. .bind(this)
  19552. , w = function(e, t) {
  19553. if (!this.warpPathPoints)
  19554. return h.position.copy(this.warpDestPano.position),
  19555. !0;
  19556. if (y)
  19557. return !0;
  19558. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19559. h.position.copy(i),
  19560. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19561. }
  19562. .bind(this)
  19563. , T = function(e, t) {
  19564. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19565. !0)
  19566. }
  19567. .bind(this)
  19568. , x = function(e, t) {
  19569. if (y)
  19570. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19571. !0;
  19572. if (!this.warpPathPoints)
  19573. return !0;
  19574. var i = this.warpLength * e
  19575. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19576. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19577. D.warp.matchCam && (n *= 1 - r),
  19578. m.lookAt(g, l, U.UP),
  19579. u.setFromRotationMatrix(m, D.warp.eOrder),
  19580. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19581. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19582. v.y = N.constrainedTurn(v.y),
  19583. u.x = p.x + n * v.x,
  19584. u.y = p.y + n * v.y,
  19585. u.z = p.z + n * v.z,
  19586. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19587. v.y = N.constrainedTurn(v.y);
  19588. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19589. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19590. f.x = f.x + v.x * D.warp.turnFriction,
  19591. f.y = f.y + v.y * D.warp.turnFriction,
  19592. f.z = f.z + v.z * D.warp.turnFriction,
  19593. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19594. var a = l.clone().sub(g).normalize();
  19595. if (C < D.warp.maxAimRotation && 0 < r) {
  19596. var s = 1 - r;
  19597. a.x = a.x * s + r * A.x,
  19598. a.y = a.y * s + r * A.y,
  19599. a.z = a.z * s + r * A.z,
  19600. a.normalize()
  19601. }
  19602. this.bunnyObj.position.copy(h.position).add(a),
  19603. d.set(0, 0, -1).applyEuler(f).normalize(),
  19604. d.multiplyScalar(8),
  19605. d.add(h.position),
  19606. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19607. h.controls.lookVector.copy(d),
  19608. h.lookAt(d))
  19609. }
  19610. .bind(this)
  19611. , S = function() {
  19612. y ? (this.discardSlow(),
  19613. this.upcomingTransType = L.BLACK,
  19614. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19615. }
  19616. .bind(this);
  19617. T(0);
  19618. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19619. , R = M / (t += M);
  19620. this.warpCommonParameters(t, R, !0, z.NONE),
  19621. V.start(I, t, null, 0, null, "_haltWatcher"),
  19622. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19623. V.start(E, t, null, R, n, "blurring")),
  19624. V.start(b, t, null, R, n, "modelAlpha"),
  19625. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19626. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19627. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19628. }
  19629. ,
  19630. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19631. var r = e || 0;
  19632. null != t || (t = D.warp.teleportTime),
  19633. this.warpCommonParameters(t, r, !1, i),
  19634. this.model.chunks.forEach(function(e) {
  19635. e.material.uniforms.blackout.value = i
  19636. }),
  19637. this._warpBendAim(null, t, null, r);
  19638. var o = function() {
  19639. this.wrapupWarpShadingOnly(n, i)
  19640. }
  19641. .bind(this);
  19642. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19643. }
  19644. ,
  19645. t.prototype.flightStepWalk = (a = new P.Vector3,
  19646. s = new P.Vector3,
  19647. function(e, t, i) {
  19648. if (this.warpInterrupted)
  19649. i && i();
  19650. else if (this.activeTransType !== L.WALK)
  19651. this._clearWarpShading(),
  19652. this._warpStopFlying(),
  19653. this.player.spider.draw(),
  19654. this.placeCpm(),
  19655. i && i();
  19656. else if (this.player.currentPano !== e) {
  19657. var n = {
  19658. pano: e,
  19659. lookAtPoint: t,
  19660. duration: null,
  19661. maxDistanceOverride: D.warp.walkMaxDist,
  19662. skipWarpingCheck: !1,
  19663. constantMoveSpeed: !0
  19664. };
  19665. n.duration = function(e, t) {
  19666. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19667. s.copy(U.FORWARD),
  19668. this.player.getDirection(s),
  19669. a.copy(t).sub(e.position).normalize();
  19670. var n = a.dot(s)
  19671. , r = Math.acos(n)
  19672. , o = r / i;
  19673. return .001 < o && (i *= o / .001,
  19674. r < 1 && (i *= 1.2)),
  19675. i
  19676. }
  19677. .call(this, e, t),
  19678. this.player.nonInterruptingFlyToPano(n, i)
  19679. } else
  19680. i && i()
  19681. }
  19682. ),
  19683. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19684. return this.flightStepWalk.bind(this, e, t, i)
  19685. }
  19686. ,
  19687. t.prototype.warpTravel_WALK = (f = [],
  19688. function(e) {
  19689. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19690. var o = this.nodes[r]
  19691. , a = t.get(o);
  19692. this.nodes.length,
  19693. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19694. i && n || (f.push(o),
  19695. i = a)
  19696. }
  19697. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19698. var s = f.length
  19699. , l = t.get(f[s - 1])
  19700. , c = new Array(s + 1);
  19701. c[c.length - 1] = function() {
  19702. e && e()
  19703. }
  19704. .bind(this);
  19705. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19706. var d = f[h];
  19707. l = t.get(d);
  19708. var p = new P.Vector3;
  19709. this.getLookAtForWalkingTourNode(f, h, p),
  19710. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19711. h--
  19712. }
  19713. c[0]()
  19714. }
  19715. ),
  19716. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19717. h = new P.Vector3,
  19718. u = new P.Vector3,
  19719. d = new P.Vector3,
  19720. p = new P.Vector3,
  19721. function(e, t, i) {
  19722. var n = e.length;
  19723. if (n <= t)
  19724. return !1;
  19725. var r = 1
  19726. , o = 1;
  19727. h.set(0, 0, 0),
  19728. p.set(0, 0, 0);
  19729. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19730. if (a = this.player.model.panos.get(e[s]),
  19731. this.getOrientationForWalkingTourNode(e, s, u),
  19732. s === t && c.copy(u),
  19733. d.copy(u),
  19734. t < s) {
  19735. var l = d.dot(c) < .65;
  19736. r *= l ? .2 : .75,
  19737. o *= l ? .2 : .4
  19738. }
  19739. u.multiplyScalar(r),
  19740. h.add(u),
  19741. p.lerp(a.position, o)
  19742. }
  19743. return h.normalize(),
  19744. i.copy(p),
  19745. i.add(h),
  19746. !0
  19747. }
  19748. ),
  19749. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19750. var n = e.length;
  19751. if (n <= t)
  19752. return !1;
  19753. if (t === n - 1)
  19754. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19755. else {
  19756. var r = this.player.model.panos.get(e[t])
  19757. , o = this.player.model.panos.get(e[t + 1]);
  19758. i.copy(o.position).sub(r.position)
  19759. }
  19760. return i.normalize(),
  19761. !0
  19762. }
  19763. ,
  19764. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19765. if (this.activeTransType = this.upcomingTransType,
  19766. this.lastTransType = this.activeTransType,
  19767. this.upcomingTransType = null,
  19768. e)
  19769. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19770. this._clearWarpShading(),
  19771. this._warpStopFlying(),
  19772. this.player.spider.draw(),
  19773. this.placeCpm(),
  19774. n && n()
  19775. }
  19776. .bind(this)) : this.warpTravel_STD(n);
  19777. else {
  19778. var r = function() {
  19779. this._wrapupTravel(n)
  19780. }
  19781. .bind(this)
  19782. , o = {
  19783. pano: this.warpDestPano,
  19784. lookAtPoint: null,
  19785. duration: null,
  19786. maxDistanceOverride: null,
  19787. skipWarpingCheck: !1
  19788. };
  19789. this.player.flyToPano(o, r)
  19790. }
  19791. }
  19792. ,
  19793. t.prototype.startWarpState = function() {
  19794. this.warping = !0,
  19795. this.warpInterrupted = !1,
  19796. this.warpInterruptionBlackoutStyle = null,
  19797. this.warpInterruptionTravelTime = null
  19798. }
  19799. ,
  19800. t.prototype.endWarpState = function() {
  19801. this.warping = !1
  19802. }
  19803. ,
  19804. t.prototype.warpToPano = function(e, t, i, n) {
  19805. if (this.warping)
  19806. H.warn("Cannot warp when already warping");
  19807. else {
  19808. if (this.upcomingTransType = e,
  19809. this.activeTransType = null,
  19810. !this.setWarpDestPano())
  19811. return this.upcomingTransType = null,
  19812. void this.warpToNonPano(n);
  19813. if (this.player.mode !== O.PANORAMA)
  19814. return this.upcomingTransType = null,
  19815. this.discardSlow(),
  19816. void this.player.flyToNewMode({
  19817. mode: O.PANORAMA,
  19818. pano: this.warpDestPano,
  19819. duration: D.warp.outsideTime,
  19820. warpDest: this.warpDestHeroLoc,
  19821. callback: n,
  19822. force: !0
  19823. });
  19824. if (!this.warpDestPano)
  19825. return H.warn("no warp destination, callback dropped"),
  19826. void (this.upcomingTransType = null);
  19827. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  19828. , o = this.chooseWarpPath(r);
  19829. if (o && this.upcomingTransType !== L.WALK) {
  19830. var a = function() {
  19831. this.waitingToWarp = !1,
  19832. this.warpToPano(e, t, i, n)
  19833. }
  19834. .bind(this);
  19835. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19836. return void (this.waitingToWarp = !0)
  19837. }
  19838. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19839. this.player.currentPano = this.warpDestPano,
  19840. this.placeCpm(),
  19841. this.fadeOutCpm(D.path.fadeOutTime),
  19842. this.player.spider.draw()),
  19843. H.debug("Warping to pano ", this.warpDestPano.position),
  19844. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19845. this.startWarpState();
  19846. var s = function() {
  19847. this.endWarpState(),
  19848. n && n()
  19849. }
  19850. .bind(this);
  19851. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19852. }
  19853. }
  19854. ,
  19855. v.exports = t
  19856. }
  19857. ).call(this, "/js/objects/ShowPath.js")
  19858. }
  19859. , {
  19860. "../constants": 8,
  19861. "../effects": 16,
  19862. "../enum/BlackoutStyle": 18,
  19863. "../enum/ModelManagerEvents": 33,
  19864. "../enum/PlayerEvents": 40,
  19865. "../enum/RenderOrder": 42,
  19866. "../enum/Vectors": 50,
  19867. "../enum/Viewmode": 51,
  19868. "../enum/WarpStyle": 52,
  19869. "../gui/gui": 65,
  19870. "../model/ModelManager": 140,
  19871. "../objects/Snapshot": 153,
  19872. "../settings": 166,
  19873. "../shaders": 167,
  19874. "../util/easing": 186,
  19875. "../util/lerp": 188,
  19876. "../util/logger": 189,
  19877. "../util/math": 190,
  19878. "../util/texture": 194,
  19879. "../util/transitions": 195,
  19880. three: 217
  19881. }],
  19882. 152: [function(e, t, i) {
  19883. "use strict";
  19884. function n() {
  19885. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19886. , t = new r.RawShaderMaterial({
  19887. fragmentShader: o.skysphere.fragmentShader,
  19888. vertexShader: o.skysphere.vertexShader,
  19889. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19890. side: r.BackSide,
  19891. name: "skysphere"
  19892. });
  19893. t.uniforms.radius.value = e.parameters.radius,
  19894. r.Mesh.call(this, e, t)
  19895. }
  19896. var r = e("three")
  19897. , o = e("../shaders")
  19898. , a = e("../settings");
  19899. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19900. t.exports = n
  19901. }
  19902. , {
  19903. "../settings": 166,
  19904. "../shaders": 167,
  19905. three: 217
  19906. }],
  19907. 153: [function(r, o, e) {
  19908. (function(e) {
  19909. "use strict";
  19910. function t(e) {
  19911. n.call(this, e),
  19912. this.sid = e.sid,
  19913. this.panoId = e.panoId,
  19914. this.orthoZoom = e.orthoZoom,
  19915. this.floorVisibility = e.floorVisibility,
  19916. this.thumbUrl = e.thumbUrl,
  19917. this.name = e.name,
  19918. this.zoom = e.zoom
  19919. }
  19920. var i = (r("three"),
  19921. r("../util/logger"))
  19922. , n = (r("../settings"),
  19923. r("../enum/Viewmode"),
  19924. r("../util/common"),
  19925. r("../util/transitions"),
  19926. r("../util/lerp"),
  19927. r("../util/ajax"),
  19928. r("../util/texture"),
  19929. r("./View"));
  19930. r("events").EventEmitter,
  19931. new i(e),
  19932. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19933. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19934. }
  19935. ,
  19936. o.exports = t
  19937. }
  19938. ).call(this, "/js/objects/Snapshot.js")
  19939. }
  19940. , {
  19941. "../enum/Viewmode": 51,
  19942. "../settings": 166,
  19943. "../util/ajax": 181,
  19944. "../util/common": 185,
  19945. "../util/lerp": 188,
  19946. "../util/logger": 189,
  19947. "../util/texture": 194,
  19948. "../util/transitions": 195,
  19949. "./View": 154,
  19950. events: 202,
  19951. three: 217
  19952. }],
  19953. 154: [function(o, a, e) {
  19954. (function(e) {
  19955. "use strict";
  19956. function t(e) {
  19957. e = e || {},
  19958. this.position = new i.Vector3,
  19959. this.quaternion = new i.Quaternion,
  19960. this.update(e)
  19961. }
  19962. var i = o("three")
  19963. , n = o("../util/logger")
  19964. , r = (o("../settings"),
  19965. o("../enum/Viewmode"),
  19966. o("../util/common"),
  19967. o("../util/transitions"),
  19968. o("../util/lerp"),
  19969. o("../util/ajax"),
  19970. o("../util/texture"),
  19971. o("events").EventEmitter);
  19972. new n(e),
  19973. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19974. return !!this.cameraMode
  19975. }
  19976. ,
  19977. t.prototype.update = function(e) {
  19978. return this.cameraMode = e.cameraMode || this.cameraMode,
  19979. this.pano = e.pano || this.pano,
  19980. e.position && this.position.copy(e.position),
  19981. e.quaternion && this.quaternion.copy(e.quaternion),
  19982. this
  19983. }
  19984. ,
  19985. a.exports = t
  19986. }
  19987. ).call(this, "/js/objects/View.js")
  19988. }
  19989. , {
  19990. "../enum/Viewmode": 51,
  19991. "../settings": 166,
  19992. "../util/ajax": 181,
  19993. "../util/common": 185,
  19994. "../util/lerp": 188,
  19995. "../util/logger": 189,
  19996. "../util/texture": 194,
  19997. "../util/transitions": 195,
  19998. events: 202,
  19999. three: 217
  20000. }],
  20001. 155: [function(J, ee, e) {
  20002. (function(e) {
  20003. "use strict";
  20004. function t(e) {
  20005. this.currentPano = null,
  20006. this.nextPano = null,
  20007. this.camera = null,
  20008. this.paused = !1,
  20009. this.flying = !1,
  20010. this.sceneIntersectionPlane = null,
  20011. this.target = new B.Vector3,
  20012. this.mouse = new B.Vector3(1.1,1.1,.5),
  20013. this.mouseAtMouseDown = new B.Vector2,
  20014. this.mouseCouldBeClickToMove = !1,
  20015. this.mouseLastMoveTime = Date.now(),
  20016. this.mouseDown = !1,
  20017. this.mouseDownTimer = null,
  20018. this.couldBeLongTap = !1,
  20019. this.containsMouse = !0,
  20020. this.isTouchEvent = !1,
  20021. this.isPanoHover = !1,
  20022. this.reticule = new n(this),
  20023. this.panoMarkers = [],
  20024. this.spider = new s(this),
  20025. this.quaternion = new B.Quaternion,
  20026. this.position = new B.Vector3(15,10,15),
  20027. this.previousState = null,
  20028. this.lastInsideView = new o,
  20029. this.last360View = new o,
  20030. this.raycaster = new B.Raycaster,
  20031. this.intersect = null,
  20032. this.lastChangeTime = Date.now(),
  20033. this.history = new h,
  20034. this.cameraControls = null,
  20035. this.path = null,
  20036. this.model = null,
  20037. this.domElement = null,
  20038. this.cachedPanoCandidates = null,
  20039. this.basePanoSize = 0,
  20040. this.standardPanoSize = 0,
  20041. this.highPanoSize = 0,
  20042. this.ultraHighPanoSize = 0,
  20043. this.zoomLevel = 1,
  20044. this.zooming = 0,
  20045. this.zoomSpeed = .5,
  20046. this.scrollZoomSpeed = .06,
  20047. this.zoomSpeedAdjust = .05,
  20048. this.defaultZoomIncrement = .2,
  20049. this.baseFov = k.insideFOV,
  20050. this.zoomFov = this.baseFov,
  20051. this.zoomEnabled = !0,
  20052. this.preRenderingEnabled = !1,
  20053. this.setupCustomProperties(e),
  20054. this.zoomStats = new v,
  20055. this.modeTran = ''
  20056. this.currentCursor = '';
  20057. }
  20058. var B = J("three")
  20059. , i = J("./util/logger")
  20060. , n = J("./objects/Reticule")
  20061. , a = J("./objects/Panorama")
  20062. , r = J("./objects/ShowPath")
  20063. , o = J("./objects/View")
  20064. , s = (J("./objects/Snapshot"),
  20065. J("./objects/NSpider"))
  20066. , V = J("./enum/Viewmode")
  20067. , T = (J("./enum/TagStates"),
  20068. J("./enum/Vectors"))
  20069. , l = J("./enum/Keys")
  20070. , k = (J("./enum/AlignmentType"),
  20071. J("./settings"))
  20072. , x = J("./util/common")
  20073. , U = (J("./util/browser"),
  20074. J("./util/math"))
  20075. , H = J("./util/lerp")
  20076. , z = J("./util/easing")
  20077. , G = J("./util/transitions")
  20078. , c = J("events").EventEmitter
  20079. , h = (J("./shaders"),
  20080. J("./util/history"))
  20081. , S = (J("./util/camera"),
  20082. J("./model/ModelManager"),
  20083. J("./enum/PathDiscardMode"))
  20084. , M = J("./enum/PathDisplayMode")
  20085. , W = J("./enum/PlayerEvents")
  20086. , u = J("./enum/ControlEvents")
  20087. , d = J("./enum/ModelManagerEvents")
  20088. , R = J("./enum/WarpStyle")
  20089. , P = J("./enum/BlackoutStyle")
  20090. , p = J("./exception/BasicException")
  20091. , f = J("./enum/PanoSizeClass")
  20092. , g = (J("./tile/TileDownloader"),
  20093. J("./tile/TilePrioritizer"))
  20094. , m = (J("./enum/PanoramaEvents"),
  20095. J("./enum/ZoomEvents"))
  20096. , v = J("./util/ZoomStats")
  20097. , y = J("./constants")
  20098. , j = J("./util/common")
  20099. , A = J("./util/cameraLight")
  20100. , C = J("hot")
  20101. , Y = new i(e)
  20102. , q = Object.freeze({
  20103. FlyToPano: G.getUniqueId(),
  20104. FlyToNewMode: G.getUniqueId(),
  20105. FlyToSameMode: G.getUniqueId(),
  20106. FlyToViewFloor: G.getUniqueId(),
  20107. LookTransition: G.getUniqueId(),
  20108. ZoomTransition: G.getUniqueId()
  20109. });
  20110. function I(e) {
  20111. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20112. o[r] = n.charCodeAt(r);
  20113. return new Blob([o],{
  20114. type: i
  20115. })
  20116. }
  20117. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20118. (window.player = this).modelManager = e.modelManager,
  20119. this.tileDownloader = e.tileDownloader,
  20120. this.panoRenderer = e.panoRenderer,
  20121. this.qualityManager = e.qualityManager,
  20122. this.domElement = e.container,
  20123. this.camera = e.camera,
  20124. this.tagManager = e.tagManager,
  20125. this.cameraControls = e.controls,
  20126. this.path = new r(e.director,this,e.controls),
  20127. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20128. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20129. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20130. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20131. this.tileDownloader.processPriorityQueue = !1,
  20132. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20133. this.bindEvents(e.container),
  20134. this.updateModel()
  20135. }
  20136. ,
  20137. t.prototype.screenShot = function(i) {
  20138. if (!this.flying && !this.flyingToTag) {
  20139. var n = this.sceneRenderer;
  20140. for (var e in n.updateScreenSize(i),
  20141. this.model.panos.index)
  20142. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20143. this.model.panos.index[e].marker.visible = !1);
  20144. for (var e in this.model.hots)
  20145. this.model.hots[e].mesh.visible = !1;
  20146. this.reticule.visible = !1,
  20147. this.reticule.forceUnvisible = !0,
  20148. this.path.currentPanoMarker.mesh.visible = !1,
  20149. setTimeout(function() {
  20150. n.renderer.clear(!0, !0, !0),
  20151. n.renderer.render(n.scene, n.camera);
  20152. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20153. for (var t in i.f && i.f(e),
  20154. n.updateScreenSize({
  20155. resize: !0
  20156. }),
  20157. this.reticule.visible = !0,
  20158. this.model.hots)
  20159. this.model.hots[t].mesh.visible = !0;
  20160. for (var t in this.model.panos.index)
  20161. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20162. this.path.currentPanoMarker.mesh.visible = !0,
  20163. n.renderer.render(n.scene, n.camera)
  20164. }
  20165. .bind(this), 30)
  20166. }
  20167. }
  20168. ;
  20169. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20170. t.prototype.getWrapShot = function() {
  20171. var i = this.getSnapAngleInfo()
  20172. , n = ",{\r\t" + i
  20173. , r = arguments[0];
  20174. this.screenShot({
  20175. width: g_snapShotWidth,
  20176. height: g_snapShotHeight,
  20177. type: "image/jpeg",
  20178. f: function(e) {
  20179. if (r && r.__callback)
  20180. return r.__callback(e, i);
  20181. var t = new Image;
  20182. t.src = e,
  20183. t.onload = function() {
  20184. var e = function(r, i) {
  20185. function n(e, t) {
  20186. var i = o || r
  20187. , n = document.createElement("canvas");
  20188. n.width = i.width,
  20189. n.height = i.height,
  20190. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20191. o = Q(e, n, t)
  20192. }
  20193. function e() {
  20194. var e = o || r
  20195. , t = I(e.src);
  20196. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20197. t = I(e.src)),
  20198. (o = o || new Image).base64Src = e.src,
  20199. o.src = window.URL.createObjectURL(t)
  20200. }
  20201. var o, t = Math.max(r.width, r.height);
  20202. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20203. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20204. e())),
  20205. o || r
  20206. }(this, {
  20207. maxSize: g_snapShotWidth,
  20208. oldType: "jpeg"
  20209. });
  20210. e.src.replace(function(e) {
  20211. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20212. }("image/jpeg"), "image/octet-stream");
  20213. var t = "snap" + (new Date).getTime();
  20214. !function(e, t) {
  20215. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20216. i.href = e,
  20217. i.download = t;
  20218. var n = document.createEvent("MouseEvents");
  20219. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20220. i.dispatchEvent(n)
  20221. }(e.src, t + ".jpg"),
  20222. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20223. n += '\r\t"sid":"' + t + '",',
  20224. n += '\r\t"name":"' + t + '"\r}',
  20225. logData(n)
  20226. }
  20227. }
  20228. })
  20229. }
  20230. /* ,
  20231. t.prototype.getSnapAngleInfo = function() {
  20232. var e = {}
  20233. , t = '"metadata":{'
  20234. , i = this.camera.quaternion.clone();
  20235. switch (this.mode) {
  20236. case "panorama":
  20237. e.scan_id = this.currentPano.id,
  20238. t += '"scan_id":"' + this.currentPano.id + '",';
  20239. break;
  20240. case "floorplan":
  20241. e.camera_mode = 1,
  20242. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20243. t += '"camera_mode":1,',
  20244. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20245. break;
  20246. case "dollhouse":
  20247. e.camera_mode = 2,
  20248. t += '"camera_mode":2,'
  20249. }
  20250. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20251. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20252. n.x *= -1,
  20253. n.w *= -1,
  20254. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20255. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20256. e.zoom = this.zoomLevel,
  20257. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20258. }
  20259. , */
  20260. t.prototype.getSnapAngleInfo = function(){
  20261. var info = {};
  20262. var str = '"metadata":{';
  20263. var q = this.camera.quaternion.clone();
  20264. switch (this.mode) {
  20265. case "panorama":
  20266. info.scan_id = this.currentPano.id;
  20267. str += ('"scan_id":"'+this.currentPano.id+'",');
  20268. break;
  20269. case "floorplan":
  20270. info.camera_mode = 1;
  20271. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20272. q.multiply(this.camera.quaternion);
  20273. str += ('"camera_mode":1,');
  20274. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20275. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20276. break;
  20277. case "dollhouse":
  20278. info.camera_mode = 2;
  20279. str += ('"camera_mode":2,');
  20280. break;
  20281. }
  20282. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20283. //console.log(info.camera_position)
  20284. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20285. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20286. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20287. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20288. out.x *= -1;
  20289. out.w *= -1;
  20290. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20291. }else{
  20292. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20293. } */
  20294. info.zoom = this.zoomLevel;
  20295. //console.log(info.camera_quaternion)
  20296. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20297. // fyz 扩展编辑页面, 加上导览点缩放值
  20298. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20299. console.log(str)
  20300. return str;
  20301. }
  20302. //------end
  20303. t.prototype.closePopup = function() {
  20304. if (g_currentHot) {
  20305. g_currentHot = null,
  20306. document.getElementById("popup").style.display = "none",
  20307. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20308. $("#popup iframe:last").remove();
  20309. document.getElementById("bgaudio");
  20310. if(g_bgAudio && g_bgAudio.pauseByHot){
  20311. manage.switchBgmState(true)
  20312. }
  20313. return false
  20314. }
  20315. }
  20316. ,
  20317. t.prototype.setupCustomProperties = function(e) {
  20318. var i = e || V.PANORAMA;
  20319. Object.defineProperty(this, "mode", {
  20320. get: function() {
  20321. return i
  20322. },
  20323. set: function(e) {
  20324. var t = i;
  20325. i = e,
  20326. this.onModeUpdated(t, i)
  20327. }
  20328. })
  20329. }
  20330. ,
  20331. t.prototype.isInMode = function() {
  20332. for (var e = 0; e < arguments.length; e++)
  20333. if (this.mode === arguments[e])
  20334. return !0;
  20335. return !1
  20336. }
  20337. ,
  20338. t.prototype.isOutsideMode = function(e) {
  20339. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20340. }
  20341. ,
  20342. t.prototype.is360View = function(e, t) {
  20343. return e === V.PANORAMA && t && !t.isAligned()
  20344. }
  20345. ,
  20346. t.prototype.setScene = function(e) {
  20347. this.sceneIntersectionPlane = e.plane,
  20348. this.path.setScene(e),
  20349. this.moveReticuleToScene(e)
  20350. }
  20351. ,
  20352. t.prototype.moveReticuleToScene = function(e) {
  20353. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20354. e.add(this.reticule)
  20355. }
  20356. ,
  20357. t.prototype.updateModel = function() {
  20358. function n(e) {
  20359. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20360. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20361. , n = t.position.y + (e - i.target.y)
  20362. , r = k.showFloorDuration + k.showFloorDelay;
  20363. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20364. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20365. }
  20366. this.model = this.modelManager.getActiveModel(),
  20367. this.model.on("floor.changed", function(e, t, i) {
  20368. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20369. }
  20370. .bind(this)),
  20371. this.model.on("allfloors.toggled", function(e, t) {
  20372. if (this.mode === V.DOLLHOUSE) {
  20373. var i = e ? this.model.center.y : i = t.center.y;
  20374. n.call(this, i)
  20375. }
  20376. }
  20377. .bind(this)),
  20378. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20379. var t = this;
  20380. this.model.panos.list.forEach(function(e) {
  20381. e.vrMarker.addEventListener("click", function() {
  20382. t.flyToPano({
  20383. pano: e
  20384. })
  20385. })
  20386. })
  20387. }
  20388. ,
  20389. t.prototype.updateModelDependentData = function() {
  20390. this.cameraControls.setModelForControls(this.model),
  20391. this.getPanoMarkersFromModel(this.model)
  20392. }
  20393. ,
  20394. t.prototype.onModelChanged = function() {
  20395. this.updateModel(),
  20396. this.updateModelDependentData()
  20397. }
  20398. ,
  20399. t.prototype.getPanoMarkersFromModel = function(e) {
  20400. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20401. return t.marker ? e.concat(t.marker) : e
  20402. }, [])
  20403. }
  20404. ,
  20405. t.prototype.handleControlMove = function(e) {
  20406. this.emit(W.Move, e)
  20407. }
  20408. ,
  20409. t.prototype.handleControlInputStart = function(e) {
  20410. this.emit(W.InputStart, e)
  20411. }
  20412. ,
  20413. t.prototype.onModeUpdated = function(e, t) {
  20414. this.cameraControls.activateControls(t),
  20415. this.emit(W.ModeChanged, e, t)
  20416. }
  20417. ,
  20418. t.prototype.isWarping = function() {
  20419. return this.path.warping
  20420. }
  20421. ,
  20422. t.prototype.isWaitingToWarp = function() {
  20423. return this.path.waitingToWarp
  20424. }
  20425. ,
  20426. t.prototype.getLabelScaleFactor = function() {
  20427. if (this.isOutsideMode()) {
  20428. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20429. }
  20430. return .5
  20431. }
  20432. ,
  20433. t.prototype.changeMusic = function() {
  20434. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20435. }
  20436. ,
  20437. t.prototype.bindEvents = function(e) {
  20438. e !== document && e.setAttribute("tabindex", -1),
  20439. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20440. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20441. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20442. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20443. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20444. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20445. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20446. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20447. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20448. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20449. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20450. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20451. document.addEventListener("pointerup", ()=>{//add
  20452. window.transformControls && transformControls.onPointerUp()
  20453. }),
  20454. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20455. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20456. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20457. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20458. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20459. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20460. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20461. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20462. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20463. window.getSeft && getSeft(this),
  20464. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20465. }
  20466. ,
  20467. t.prototype.onMouseDown = function(e) {
  20468. e.currentTarget !== document && e.currentTarget.focus(),
  20469. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20470. this.updateIntersect())
  20471. }
  20472. ,
  20473. t.prototype.onMouseMove = function(e) {
  20474. this.isTouchEvent = !1,
  20475. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20476. }
  20477. ,
  20478. t.prototype.onMouseOver = function(e) {
  20479. this.containsMouse = !0,
  20480. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20481. }
  20482. ,
  20483. t.prototype.onMouseOut = function(e) {
  20484. this.containsMouse = !1
  20485. }
  20486. ,
  20487. t.prototype.onMouseUp = function(e) {
  20488. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20489. }
  20490. ,
  20491. t.prototype.onTouchStart = function(e) {
  20492. if (e.currentTarget !== document && e.currentTarget.focus(),
  20493. !this.mouseDown) {
  20494. this.couldBeLongTap = !0;
  20495. var t = x.average(e.changedTouches, "clientX")
  20496. , i = x.average(e.changedTouches, "clientY");
  20497. this.handleInputStart.call(this, t, i, !0),
  20498. this.mouseDownTimer = setTimeout(function() {
  20499. this.updateIntersect(),
  20500. this.handleInputEnd.call(this, t, i, !0)
  20501. }
  20502. .bind(this), k.input.longTapThreshold)
  20503. }
  20504. }
  20505. ,
  20506. t.prototype.onTouchMove = function(e) {
  20507. var t = x.average(e.changedTouches, "clientX")
  20508. , i = x.average(e.changedTouches, "clientY");
  20509. this.handleInputMove.call(this, t, i, !0)
  20510. }
  20511. ,
  20512. t.prototype.onTouchEnd = function(e) {
  20513. if (clearTimeout(this.mouseDownTimer),
  20514. this.mouseDown) {
  20515. this.couldBeLongTap = !1,
  20516. this.updateIntersect();
  20517. var t = x.average(e.changedTouches, "clientX")
  20518. , i = x.average(e.changedTouches, "clientY");
  20519. this.handleInputEnd.call(this, t, i, !0)
  20520. }
  20521. }
  20522. ,
  20523. t.prototype.onPointerDown = function(e) {
  20524. return e.currentTarget !== document && e.currentTarget.focus(),
  20525. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20526. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20527. void (this.mouseDownTimer = setTimeout(function() {
  20528. this.updateIntersect(),
  20529. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20530. }
  20531. .bind(this), k.input.longTapThreshold)))
  20532. }
  20533. ,
  20534. t.prototype.onPointerMove = function(e) {
  20535. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20536. }
  20537. ,
  20538. t.prototype.onPointerUp = function(e) {
  20539. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20540. this.couldBeLongTap = !1,
  20541. this.updateIntersect(),
  20542. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20543. }
  20544. ,
  20545. t.prototype.onPointerOut = function(e) {
  20546. this.mouseDown = !1
  20547. }
  20548. ,
  20549. t.prototype.onPointerCancel = function(e) {
  20550. this.mouseDown = !1
  20551. }
  20552. ,
  20553. t.prototype.onKeyDown = function(e) {
  20554. var t = function() {
  20555. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20556. }
  20557. .bind(this)
  20558. , i = e.which;
  20559. switch (i) {
  20560. case l.F:
  20561. t(),
  20562. this.changeFloor(-1);
  20563. break;
  20564. case l.R:
  20565. t(),
  20566. this.changeFloor(1)
  20567. }
  20568. if (this.mode === V.PANORAMA)
  20569. switch (i) {
  20570. case l.UPARROW:
  20571. case l.W:
  20572. this.flyLocalDirection(T.FORWARD.clone());
  20573. break;
  20574. case l.DOWNARROW:
  20575. case l.S:
  20576. this.flyLocalDirection(T.BACK.clone());
  20577. break;
  20578. case l.A:
  20579. this.flyLocalDirection(T.LEFT.clone());
  20580. break;
  20581. case l.D:
  20582. this.flyLocalDirection(T.RIGHT.clone())
  20583. }
  20584. }
  20585. ,
  20586. t.prototype.handleScrollPinchZoom = function(e) {
  20587. var t = e
  20588. , i = this.zoomLevel;
  20589. this.zoomBy(t),
  20590. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20591. }
  20592. ,
  20593. t.prototype.handleControlPinch = function(e) {
  20594. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20595. }
  20596. ,
  20597. t.prototype.handleControlScroll = function(e) {
  20598. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20599. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20600. }
  20601. ,
  20602. t.prototype.handleInputStart = function(e, t, i) {
  20603. var n = this.handelPadding(e, t);
  20604. e = n.x,
  20605. t = n.y,
  20606. this.isTouchEvent = i,
  20607. U.convertScreenPositionToNDC(e, t, this.mouse),
  20608. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20609. this.mouseCouldBeClickToMove = !0,
  20610. this.mouseDown = !0,
  20611. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20612. window.transformControls && transformControls.onPointerDown()
  20613. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20614. try{
  20615. this.overlayGroup.children.forEach((overlay)=>{
  20616. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20617. })
  20618. }catch(e){}
  20619. this.overlayInitedPlay = true
  20620. }
  20621. }
  20622. ,
  20623. t.prototype.handelPadding = function(e, t) {
  20624. return this.pad || (this.pad = {
  20625. x: dom.getOffset("left", $("#player")[0]),
  20626. y: dom.getOffset("top", $("#player")[0])
  20627. }),
  20628. {
  20629. x: e - this.pad.x,
  20630. y: t - this.pad.y
  20631. }
  20632. }
  20633. ,
  20634. t.prototype.handleInputMove = function(e, t, i) {
  20635. var n = this.handelPadding(e, t);
  20636. e = n.x,
  20637. t = n.y,
  20638. this.isTouchEvent = i,
  20639. U.convertScreenPositionToNDC(e, t, this.mouse);
  20640. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20641. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20642. this.couldBeLongTap = !1,
  20643. clearTimeout(this.mouseDownTimer)),
  20644. this.mouseLastMoveTime = Date.now(),
  20645. this.reticule.move(e, t, i)
  20646. window.transformControls && transformControls.onPointerMove()
  20647. }
  20648. ,
  20649. t.prototype.handleInputEnd = function(e, t, i) {
  20650. if (this.isTouchEvent = i,
  20651. this.mouseDown = !1,
  20652. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20653. !i && this.couldBeLongTap)
  20654. return !0;
  20655. if (this.handleLongTap())
  20656. return !0;
  20657. window.transformControls && transformControls.onPointerUp()
  20658. if (this.mouseCouldBeClickToMove) {
  20659. if (this.flying)
  20660. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20661. !0;
  20662. //add----
  20663. if (this.checkHotClick())
  20664. return !0;
  20665. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20666. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20667. return;
  20668. }
  20669. if (window.VisiSet && VisiSet.setTagVisible ) {
  20670. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20671. return;
  20672. }
  20673. if(this.hoveringPlane){
  20674. this.clickOverlay(this.hoveringPlane)
  20675. return;
  20676. }
  20677. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20678. return EditOverlay.addPlane({intersect:this.intersect});
  20679. }
  20680. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20681. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20682. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20683. } */
  20684. //----------
  20685. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20686. this.history.invalidate(),
  20687. this.intersect)
  20688. return this.flyToPanoClosestToMouse();
  20689. if (this.mode === V.PANORAMA) {
  20690. var n = this.closestPanoInDirection(this.getMouseDirection());
  20691. return n ? this.flyToPano({
  20692. pano: n
  20693. }) : this.bump(this.getMouseDirection())
  20694. }
  20695. }
  20696. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20697. }
  20698. ,
  20699. t.prototype.handleLongTap = function() {
  20700. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20701. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20702. !0
  20703. }
  20704. ,
  20705. t.prototype.checktagClick = function() {
  20706. if (this.tagManager.intersectTag) {
  20707. var e = this.isTouchEvent
  20708. , t = this.tagManager.clickedOnTag(e, this);
  20709. return e || t || G.cancelById(q.LookTransition),
  20710. !0
  20711. }
  20712. if (this.tagManager.activeTag)
  20713. return this.tagManager.dismissActiveTag(),
  20714. !1
  20715. }
  20716. ,
  20717. t.prototype.rankedtagInDirection = function(e, t) {
  20718. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20719. }
  20720. ,
  20721. t.prototype.start = function(e) {
  20722. $(".toolLeft").removeClass("unable");
  20723. $(".toolTop").removeClass("unable");
  20724. //-------------------
  20725. window.initTransformCtl(B)
  20726. window.initOverlay(B)
  20727. this.model.loadOverlays()
  20728. window.EditOverlay && window.EditOverlay.init(B);
  20729. window.VisiSet && VisiSet.init()
  20730. //-------------------
  20731. var t = e.mode
  20732. , i = e.pano
  20733. , n = e.position
  20734. , r = e.quaternion
  20735. , o = e.tag
  20736. , a = e.quickstart
  20737. , s = $.Deferred();
  20738. this.updateModelDependentData(),
  20739. this.updateFromControls(),
  20740. this.findDefaultViews();
  20741. var l = this.is360View(t, i);
  20742. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20743. s.done(function(e) {
  20744. this.emit(W.Ready, l, e, o)
  20745. }
  20746. .bind(this)),
  20747. s.promise()
  20748. }
  20749. ,
  20750. t.prototype.startOutside = function(e, t) {
  20751. var i = e.mode
  20752. , n = e.pano
  20753. , r = e.position
  20754. , o = e.quaternion
  20755. , a = e.zoom
  20756. , s = e.floorVisibility
  20757. , l = e.tag;
  20758. this.emit(W.StartOutside, k[i].transitionTime),
  20759. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20760. G.cancelById(q.FlyToViewFloor),
  20761. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20762. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20763. }
  20764. ,
  20765. t.prototype.startInside = function(e, t, i, n, r) {
  20766. r = r || $.Deferred();
  20767. var o = (this.currentPano = e) && !e.isAligned();
  20768. if (t = o ? e.position : t || e.position,
  20769. i = i || e.quaternion,
  20770. e) {
  20771. var a = this.startInside.bind(this, e, t, i, n, r);
  20772. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20773. return
  20774. }
  20775. //add
  20776. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20777. return this.mode = V.PANORAMA,
  20778. e.floor.enter(this.mode),
  20779. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20780. this.switchCameraMode(this.mode, i),
  20781. this.emit(W.StartInside, o),
  20782. r.resolve(!0),
  20783. r
  20784. }
  20785. ,
  20786. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20787. if (r = r || $.Deferred(),
  20788. this.dollhouseMode(),
  20789. !i)
  20790. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20791. r.resolve(!1),
  20792. r;
  20793. e = e || i.position;
  20794. var o = n || this.cameraControls.activeControl.camera.quaternion
  20795. , a = i.position;
  20796. return this.fitDollhouse(a, e, o),
  20797. setTimeout(function(e) {
  20798. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20799. var t = {
  20800. mode: V.PANORAMA,
  20801. pano: i,
  20802. quaternion: n,
  20803. callback: function() {
  20804. this.emit(W.FlyinFinished),
  20805. r.resolve(!0)
  20806. }
  20807. .bind(this)
  20808. };
  20809. this.flyToNewMode(t)
  20810. }
  20811. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20812. r
  20813. }
  20814. ,
  20815. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20816. K = {},
  20817. function(t, e, i, n, r, o, a, s, l, c) {
  20818. if (function() {
  20819. for (var e in Z)
  20820. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20821. return !0;
  20822. return !1
  20823. }())
  20824. return !0;
  20825. var h = function(e, t, i) {
  20826. j.delayOneFrame(function() {
  20827. Z[e] = !1,
  20828. r && r(t, i)
  20829. }
  20830. .bind(this))
  20831. }
  20832. .bind(this, t.id)
  20833. , u = function(e, t) {
  20834. j.delayOneFrame(function() {
  20835. Z[e] = !1,
  20836. o && o(t)
  20837. }
  20838. .bind(this))
  20839. }
  20840. .bind(this, t.id);
  20841. try {
  20842. return null != s || (s = !0),
  20843. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  20844. Z[t.id] && (K[t.id] = performance.now()),
  20845. Z[t.id]
  20846. } catch (e) {
  20847. throw Z[t.id] = !1,
  20848. K[t.id] = performance.now() - 5e3,
  20849. e
  20850. }
  20851. }
  20852. ),
  20853. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20854. if (!e)
  20855. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20856. return r && this.model.waitForLoad(e, function() {
  20857. return e.isLoaded(i)
  20858. }),
  20859. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20860. !0)
  20861. }
  20862. ,
  20863. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20864. function(e, t, i, n, r, o, a, s) {
  20865. if (!e)
  20866. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20867. return X.copy(T.FORWARD),
  20868. this.getDirection(X),
  20869. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20870. return e.isLoaded(t)
  20871. }),
  20872. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20873. i && i(e, t)
  20874. }
  20875. .bind(this)).fail(function(e) {
  20876. n && n(e)
  20877. }
  20878. .bind(this)).progress(function(e, t, i) {
  20879. r && r(e, t, i)
  20880. }
  20881. .bind(this)),
  20882. !0)
  20883. }
  20884. ),
  20885. t.prototype.switchCameraMode = function(e, t) {
  20886. var i = this.cameraControls.controls[e]
  20887. , n = i.camera;
  20888. switch (e) {
  20889. case V.PANORAMA:
  20890. n.position.copy(this.currentPano.position);
  20891. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20892. i.lookAt(r.add(n.position));
  20893. break;
  20894. case V.DOLLHOUSE:
  20895. /* var o = this.position.clone();
  20896. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20897. n.position.copy(o),
  20898. i.target.copy(this.target.clone().setY(this.model.center.y));
  20899. break; */
  20900. //for多楼层 且 让模型刚好适应屏幕
  20901. var box = this.model.boundingBox.clone();
  20902. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20903. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20904. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20905. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20906. console.log(boxSize.x,distance, boxSize.length() / 2)
  20907. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20908. if(this.mode === V.PANORAMA){
  20909. i.target.copy(this.model.center);
  20910. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20911. }else{
  20912. i.target.copy(this.target.clone().setY(this.model.center.y))
  20913. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20914. }
  20915. vec.multiplyScalar(distance )
  20916. n.position.copy(i.target.clone().add(vec))
  20917. break
  20918. case V.FLOORPLAN:
  20919. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20920. i.target.copy(this.model.center).setY(0),
  20921. i.zoomToContain(this.model.size),
  20922. i.rotateToView(this.model.size, this.getDirection())
  20923. }
  20924. i.update(0)
  20925. }
  20926. ,
  20927. t.prototype.update = (new B.Vector3,
  20928. N = {},
  20929. F = [],
  20930. function(e) {
  20931. this.updatePersistentZooming(e),
  20932. this.updateFromControls(e),
  20933. this.getCurrentNodePanos(F)
  20934. if(this.hasChanged(N)){
  20935. this.lastChangeTime = Date.now(),
  20936. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20937. this.emit(W.ViewChanged)
  20938. //add:
  20939. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  20940. this.intersectHot && this.intersectHot.showTitle()
  20941. for(var i in this.model.hots){
  20942. this.model.hots[i].update(this.camera)
  20943. }
  20944. }
  20945. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20946. this.model.supportsTiles && (this.updateTileDownloader(F),
  20947. this.updatePanoRenderer(F)),
  20948. this.updatePreRendering(F),
  20949. this.reticule.update(),
  20950. this.path.update(),
  20951. this.spider.update(),
  20952. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20953. this.updateControlLocks(),
  20954. this.model.supportsTiles && this.updateZoomPano()
  20955. }
  20956. ),
  20957. t.prototype.updatePersistentZooming = function(e) {
  20958. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20959. }
  20960. ,
  20961. t.prototype.updateControlLocks = function() {
  20962. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20963. }
  20964. ,
  20965. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20966. function(e) {
  20967. var t = this.nextPano || this.currentPano;
  20968. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20969. this.getDirection(D),
  20970. this.panoRenderer.updateDirection(D))
  20971. }
  20972. ),
  20973. t.prototype.cleanupInactivePanos = (O = [],
  20974. L = [],
  20975. function() {
  20976. O.length = 0,
  20977. O.push(this.currentPano),
  20978. this.nextPano && O.push(this.nextPano);
  20979. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20980. L.push(this.panoRenderer.activePanos[e]);
  20981. for (var t = 0; t < L.length; t++) {
  20982. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20983. i.id === O[r].id && (n = !1);
  20984. n && i.exit()
  20985. }
  20986. }
  20987. ),
  20988. t.prototype.updatePreRendering = (w = {},
  20989. function(e) {
  20990. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20991. var t = this.nextPano || this.currentPano;
  20992. if (t && e && 1 < e.length) {
  20993. var i = e.findIndex(function(e) {
  20994. if (e.id === t.id)
  20995. return !0
  20996. });
  20997. if (0 <= i && i + 1 < e.length) {
  20998. var n = e[i + 1];
  20999. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21000. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21001. window.setTimeout(function(e) {
  21002. w[e.id] = !1
  21003. }
  21004. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21005. }
  21006. .bind(this, n), k.tiling.panoPreRenderDelay),
  21007. w[n.id] = !0)
  21008. }
  21009. }
  21010. }
  21011. }
  21012. ),
  21013. t.prototype.enablePreRendering = function() {
  21014. this.preRenderingEnabled = !0
  21015. }
  21016. ,
  21017. t.prototype.disablePreRendering = function() {
  21018. this.preRenderingEnabled = !1,
  21019. this.cleanupInactivePanos()
  21020. }
  21021. ,
  21022. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21023. function(e) {
  21024. var t = this.nextPano || this.currentPano;
  21025. t && (b.copy(T.FORWARD),
  21026. this.getDirection(b),
  21027. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21028. this.tileDownloader.processPriorityQueue = !0)
  21029. }
  21030. ),
  21031. t.prototype.updateFromControls = function(e) {
  21032. null != e || (e = 0),
  21033. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21034. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21035. this.position.copy(this.cameraControls.activeControl.camera.position),
  21036. this.target.copy(this.cameraControls.activeControl.target),
  21037. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21038. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21039. this.camera.position.copy(this.position),
  21040. this.camera.quaternion.copy(this.quaternion),
  21041. this.camera.updateMatrix(),
  21042. this.camera.updateMatrixWorld()
  21043. }
  21044. ,
  21045. t.prototype.hasChanged = function(e) {
  21046. if (!this.previousState)
  21047. return this.previousState = {
  21048. allFloorsVisible: this.model.allFloorsVisible,
  21049. position: this.position.clone(),
  21050. quaternion: this.quaternion.clone(),
  21051. mouse: this.mouse.clone(),
  21052. labelScaleFactor: this.getLabelScaleFactor(),
  21053. currentFloor: this.model.currentFloor,
  21054. projectionMatrix: this.camera.projectionMatrix.clone(),
  21055. worldMatrix: this.camera.matrixWorld.clone(),
  21056. mode: this.mode,
  21057. modelPosition: this.model.position.clone(),
  21058. modelCenter: this.model.center.clone(),
  21059. zoomLevel: this.zoomLevel
  21060. },
  21061. !0;
  21062. 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;
  21063. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21064. e.moved = !this.position.equals(this.previousState.position),
  21065. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21066. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21067. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21068. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21069. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21070. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21071. e.modeChanged = this.mode !== this.previousState.mode,
  21072. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21073. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21074. e.nextPanoActive = null !== this.nextPano,
  21075. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21076. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21077. this.previousState.position.copy(this.position),
  21078. this.previousState.quaternion.copy(this.quaternion),
  21079. this.previousState.mouse.copy(this.mouse),
  21080. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21081. this.previousState.currentFloor = this.model.currentFloor,
  21082. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21083. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21084. this.previousState.mode = this.mode,
  21085. this.previousState.modelPosition.copy(this.model.position),
  21086. this.previousState.modelCenter.copy(this.model.center),
  21087. this.previousState.zoomLevel = this.zoomLevel,
  21088. !t
  21089. }
  21090. ,
  21091. t.prototype.updateIntersect = function() {
  21092. var e = this.flying || this.isWarping()
  21093. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21094. , i = G.getById(q.LookTransition);
  21095. e || t || this.isTouchEvent || i.length && i[0].running;
  21096. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21097. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21098. if (this.intersect && this.intersect.object.visible )
  21099. $("#player").css("cursor", "pointer");
  21100. else
  21101. $("#player").css("cursor", "")
  21102. return;
  21103. }
  21104. this.intersect = this.getMouseIntersect(),
  21105. this.intersect && this.updateClosestPano(this.intersect),
  21106. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21107. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21108. }
  21109. ,
  21110. t.prototype.checkHotClick = function() {
  21111. if (this.intersectHot){
  21112. if (window.VisiSet && VisiSet.setTagVisible ) {
  21113. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21114. return;
  21115. }
  21116. this.intersectHot.noAction || this.intersectHot.examine(this)
  21117. return !0
  21118. }
  21119. }
  21120. ,
  21121. t.prototype.getMouseDirection = function(e) {
  21122. e = e || this.mouse;
  21123. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21124. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21125. }
  21126. ,
  21127. t.prototype.hoverOverlay = function(mesh){
  21128. if(!mesh){
  21129. this.hoveringPlane = null;
  21130. $("#player").css("cursor",this.currentCursor || "" );
  21131. }else{
  21132. var overlay = mesh.parent;
  21133. $("#player").css("cursor","pointer");
  21134. this.hoveringPlane = overlay;
  21135. return true;
  21136. }
  21137. },
  21138. t.prototype.clickOverlay = function(overlay){
  21139. if(this.openOverlay && !overlay)return;
  21140. var plane = overlay.plane;
  21141. if(overlay.overlayType == "video"){
  21142. if(plane.material.map.image.paused)plane.material.map.image.play()
  21143. else plane.material.map.image.pause();
  21144. }
  21145. if(window.EditOverlay &&EditOverlay.editing){
  21146. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21147. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21148. EditOverlay.endAddPlane();
  21149. EditOverlay.updateOverlayPanel(overlay)
  21150. transformControls.attach(overlay)
  21151. return;
  21152. }
  21153. },
  21154. t.prototype.getMouseIntersect = function(e, t) {
  21155. e = e || this.mouse.clone(),
  21156. t = t || this.model.floors.reduce(function(e, t) {
  21157. return t.hidden ? e : e.concat(t.collider.children)
  21158. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21159. t = t.slice(0)
  21160. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21161. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21162. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21163. this.raycaster.set(i, this.getMouseDirection(e));
  21164. var n = this.raycaster.intersectObjects(t, true);//add true
  21165. if ("add" == g_HotStatus) {
  21166. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21167. //console.log(r[0]),
  21168. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21169. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21170. window.hotIntersect = !1)
  21171. return;
  21172. }
  21173. this.intersectHot && this.intersectHot.hideTitle()
  21174. if (0 === n.length)
  21175. return this.intersectHot = null,
  21176. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21177. null;
  21178. var o = n[0];
  21179. if ("hotSprite" == o.object.type){
  21180. this.intersectHot = o.object.belongHot
  21181. this.intersectHot.showTitle()
  21182. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21183. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21184. return;
  21185. }
  21186. $(".toolRight .spotList ul li").removeClass("active")
  21187. this.intersectHot = null;
  21188. /* if(window.EditOverlay && n && n.length){
  21189. if(n[0].object.parent.parent == this.overlayGroup){
  21190. this.hoverOverlay(n[0].object);
  21191. }else()
  21192. } */
  21193. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21194. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21195. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21196. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21197. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21198. o.horizontal = .8 < o.normal.y);
  21199. return o
  21200. }
  21201. ,
  21202. t.prototype.updateClosestPano = function(e) {
  21203. var t = [a.filters.isPanoAligned()];
  21204. if (this.mode === V.PANORAMA) {
  21205. if (!this.currentPano)
  21206. return;
  21207. t.push(a.filters.not(this.currentPano)),
  21208. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21209. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21210. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21211. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21212. } else{
  21213. t.push((pano)=>{ // add
  21214. return this.checkHasNeighbor(pano)
  21215. })
  21216. t.push(a.filters.isOnVisibleFloor()),
  21217. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21218. }
  21219. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21220. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21221. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21222. this.closestPano = i) : this.isPanoHover = !1
  21223. }
  21224. ,
  21225. t.prototype.dollhouseMode = function(e, t) {
  21226. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21227. this.mode = V.DOLLHOUSE,
  21228. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21229. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21230. , n = new B.Vector3(15,10,15);
  21231. if (e && t) {
  21232. var r = T.FORWARD.clone().applyQuaternion(t)
  21233. , o = this.model.center.clone().sub(e).dot(r);
  21234. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21235. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21236. }
  21237. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21238. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21239. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21240. this.updateFromControls(),
  21241. this.model.alpha = 1,
  21242. this.model.skybox.material.uniforms.opacity.value = 0
  21243. }
  21244. ,
  21245. t.prototype.insideMode = function(e, t) {
  21246. var i = $.Deferred()
  21247. , n = t || null;
  21248. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21249. var r = [a.filters.isPanoAligned()];
  21250. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21251. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21252. this.flyToNewMode({
  21253. mode: V.PANORAMA,
  21254. pano: e,
  21255. callback: n
  21256. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21257. } else {
  21258. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21259. i.reject(o)
  21260. }
  21261. return i.promise()
  21262. }
  21263. ,
  21264. t.prototype.fitDollhouse = function(e, t, i) {
  21265. var maxY = this.model.boundingBox.max.y;//add
  21266. var n = T.FORWARD.clone().applyQuaternion(i);
  21267. i = n.clone().add(e);
  21268. this.cameraControls.activeControl.target.copy(i),
  21269. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21270. }
  21271. ,
  21272. t.prototype.floorplanMode = function(e, t, i) {
  21273. this.mode = V.FLOORPLAN;
  21274. var n = this.cameraControls.controls[V.FLOORPLAN];
  21275. n.reset();
  21276. var r = e || this.model.center;
  21277. if (n.target.copy(r).setY(0),
  21278. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21279. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21280. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21281. t) {
  21282. var o = T.LEFT.clone().applyQuaternion(t);
  21283. n.rotateLeft(-Math.atan2(o.x, o.z))
  21284. } else
  21285. n.rotateToView(this.model.size, this.getDirection());
  21286. n.update(0)
  21287. }
  21288. ,
  21289. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21290. return e.skipWarpingCheck = !0,
  21291. this.flyToPano(e, t)
  21292. }
  21293. ,
  21294. t.prototype.updateMarkerVisi = function() {//加
  21295. if(this.mode != "panorama")return;
  21296. this.model.panos.list.forEach((pano)=>{
  21297. if(!pano.marker)return;
  21298. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21299. })
  21300. }
  21301. ,
  21302. t.prototype.updateHotVisible = function(pano){
  21303. var hots = this.model.hots;
  21304. pano = pano || this.currentPano;
  21305. for (var index in hots){
  21306. var visible;
  21307. if(this.mode != "panorama"){
  21308. visible = true;
  21309. }else{
  21310. //hots[index].mesh.material.depthTest = false;
  21311. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21312. }
  21313. hots[index].mesh.visible = visible;
  21314. }
  21315. },
  21316. t.prototype.flyToPano = function(e, t) {
  21317. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  21318. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21319. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21320. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21321. t && t(),
  21322. !1;
  21323. if (this.updateLastView(),
  21324. this.mode !== V.PANORAMA)
  21325. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21326. void this.flyToNewMode({
  21327. mode: V.PANORAMA,
  21328. pano: n,
  21329. duration: o,
  21330. quaternion: i,
  21331. callback: t
  21332. });
  21333. if (!n || (h = x.deepExtend(e),
  21334. u = function() {
  21335. j.delayOneFrame(function() {
  21336. this.flyToPano(h, t)
  21337. }
  21338. .bind(this))
  21339. }
  21340. .bind(this),
  21341. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21342. var d = function(e) {
  21343. t && t(e)
  21344. }
  21345. .bind(this);
  21346. this.currentPano || (this.currentPano = n,
  21347. this.path.placeCpm(),
  21348. this.path.fadeOutCpm(k.path.fadeOutTime),
  21349. this.spider.draw());
  21350. var p = o;
  21351. if ("number" != typeof o) {
  21352. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21353. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21354. }
  21355. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21356. 1 !== this.zoomLevel)
  21357. switch (k.zoom.transitionStyle) {
  21358. case 1:
  21359. this.smoothZoomToDefault(p / 2);
  21360. break;
  21361. case 2:
  21362. return h = x.deepExtend(e),
  21363. u = this.flyToPano.bind(this, h, t),
  21364. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21365. }
  21366. if (r) {
  21367. G.cancelById(q.LookTransition),
  21368. p *= k.transition.aimSlowFactor;
  21369. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21370. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21371. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21372. , y = g.clone()
  21373. , A = new B.Vector3;
  21374. if (n === this.currentPano) {
  21375. var C = T.FORWARD.clone().applyQuaternion(g)
  21376. , I = T.FORWARD.clone().applyQuaternion(v)
  21377. , E = C.angleTo(I);
  21378. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21379. void G.start(function(e) {
  21380. y.copy(g),
  21381. H.quaternion(y, v)(e),
  21382. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21383. this.cameraControls.activeControl.lookAt(A)
  21384. }
  21385. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21386. }
  21387. }
  21388. if (n === this.currentPano || this.flying)
  21389. return void d();
  21390. this.flying = !0;
  21391. var _ = this.position.clone()
  21392. , b = this.currentPano;
  21393. Y.debug("Flying to pano ", n.position);
  21394. this.emit(W.PanoChosen, this.currentPano, n);
  21395. this.emit(W.FlyingStarted, n.position, _, n, b);
  21396. this.updateHotVisible(n); //更新热点显示
  21397. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21398. r && G.start(function(e) {
  21399. y.copy(g),
  21400. H.quaternion(y, v)(e),
  21401. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21402. this.cameraControls.activeControl.lookAt(A)
  21403. }
  21404. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21405. var w = c ? null : z[k.transition.movementEasing];
  21406. this.nextPano = n;
  21407. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21408. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21409. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21410. this.flying = !1,
  21411. this.currentPano !== n && this.currentPano.exit(),
  21412. n.enter(),
  21413. this.currentPano = n,
  21414. this.nextPano = null,
  21415. this.path.placeCpm(),
  21416. this.path.fadeOutCpm(k.path.fadeOutTime),
  21417. this.spider.draw(),
  21418. this.emit(W.FlyingEnded, n.position, _, n, b),
  21419. this.updateMarkerVisi();//add
  21420. d(e)
  21421. if(this.mode == "panorama" && EditOverlay.editing){
  21422. EditOverlay.updatePano(this.currentPano)
  21423. }
  21424. }
  21425. .bind(this), 0, w, "camFly", q.FlyToPano)
  21426. }
  21427. }
  21428. ,
  21429. window._transitionPosId = 9999
  21430. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21431. G.cancelById(_transitionPosId)
  21432. var begin = function(object, pos, qua, scale){
  21433. if(pos){
  21434. if(!same(object.position, pos, 0.01)){
  21435. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21436. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21437. }
  21438. if(!same(object.quaternion, qua, 1e-6)){
  21439. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21440. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21441. }
  21442. if(!same(object.scale, scale, 0.001)){
  21443. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21444. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21445. }
  21446. }
  21447. }
  21448. var same = function(vec1, vec2, diff){
  21449. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21450. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21451. return s
  21452. }
  21453. this.overlayGroup.children.forEach(overlay=>{
  21454. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21455. var useCustom = o.type == "beforeFlyOut" || !panoData
  21456. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21457. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21458. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21459. overlay.getScaleBySize(panoData.width , panoData.height)
  21460. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21461. begin(overlay, pos, qua, scale )
  21462. })
  21463. }
  21464. t.prototype.fastForwardActivePanoFlight = function(e) {
  21465. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21466. G.adjustSpeed(q.FlyToPano, e),
  21467. G.adjustSpeed(q.LookTransition, e)
  21468. }
  21469. ,
  21470. t.prototype.flyToPanoClosestToMouse = function() {
  21471. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21472. this.intersect && this.updateClosestPano(this.intersect)),
  21473. this.closestPano)
  21474. return this.flyToPano({
  21475. pano: this.closestPano
  21476. });
  21477. var e = this.getMouseDirection();
  21478. this.flyDirection(e) || this.flyToPano({
  21479. pano: this.currentPano
  21480. })
  21481. }
  21482. ,
  21483. t.prototype.flyLocalDirection = function(e) {
  21484. var t = this.getDirection(e)
  21485. , i = 1 === e.z ? .4 : .75
  21486. , n = 1 === Math.abs(e.x);
  21487. return this.flyDirection(t, i, n)
  21488. }
  21489. ,
  21490. t.prototype.flyDirection = function(e, t, i) {
  21491. this.closePopup();
  21492. var n = $.Deferred();
  21493. this.history.invalidate();
  21494. var r = this.closestPanoInDirection(e, t, i);
  21495. return r ? this.flyToPano({
  21496. pano: r
  21497. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21498. n.resolve(!1)),
  21499. n.promise()
  21500. }
  21501. ,
  21502. t.prototype.closestPanoInDirection = function(e, t, i) {
  21503. return this.rankedPanoInDirection(0, e, t, i)
  21504. }
  21505. ,
  21506. t.prototype.rankedPanoInDirection = (_ = {
  21507. pano: null,
  21508. candidates: []
  21509. },
  21510. function(e, t, i, n) {
  21511. e = e || 0,
  21512. i = void 0 !== i ? i : .75;
  21513. var r = n ? "angle" : "direction";
  21514. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21515. this.cachedPanoCandidates = _.candidates,
  21516. _.pano
  21517. }
  21518. ),
  21519. t.prototype.bump = function(e) {
  21520. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21521. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21522. if (.5 < Math.abs(a))
  21523. t = function() {
  21524. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21525. }
  21526. .bind(this),
  21527. i = function() {
  21528. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21529. }
  21530. .bind(this);
  21531. else {
  21532. var s = this.camera.position.clone()
  21533. , l = e.clone();
  21534. this.raycaster.set(s, l);
  21535. var c = this.model.floors.reduce(function(e, t) {
  21536. return e.concat(t.collider.children)
  21537. }, [])
  21538. , h = this.raycaster.intersectObjects(c)
  21539. , u = 0 < h.length ? h[0].distance / 25 : .04
  21540. , d = s.clone().add(l.multiplyScalar(u));
  21541. t = function() {
  21542. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21543. }
  21544. .bind(this),
  21545. i = function() {
  21546. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21547. }
  21548. .bind(this)
  21549. }
  21550. n = function() {
  21551. this.flying = !1
  21552. }
  21553. .bind(this),
  21554. this.flying = !0,
  21555. t()
  21556. }
  21557. }
  21558. ,
  21559. t.prototype.changeFloor = function(e) {
  21560. if (!this.is360View(this.mode, this.currentPano))
  21561. if (this.mode === V.PANORAMA) {
  21562. var t = this.history.reversePano(e);
  21563. t && t.isAligned() ? this.flyToPano({
  21564. pano: t
  21565. }) : this.changeFloorByScore(e)
  21566. } else
  21567. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21568. }
  21569. ,
  21570. t.prototype.changeFloorByScore = (E = {
  21571. pano: null,
  21572. candidates: []
  21573. },
  21574. function(e) {
  21575. var t = this.model.nextFloor(e);
  21576. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  21577. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21578. this.history.push(e, this.currentPano),
  21579. this.flyToPano({
  21580. pano: E.pano
  21581. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21582. }
  21583. ),
  21584. t.prototype.gotoFloor = function(e) {
  21585. var t = e - this.model.currentFloor.floorIndex;
  21586. this.changeFloor(t)
  21587. }
  21588. ,
  21589. t.prototype.getDirection = function(e) {
  21590. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21591. }
  21592. ,
  21593. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21594. if (r = r || $.Deferred(),
  21595. this.mode === V.TRANSITIONING)
  21596. return Y.warn("should not be transitioning here"),
  21597. n && n(!1),
  21598. r.reject().promise();
  21599. var o = i || !1
  21600. , a = i ? i.position : this.position
  21601. , s = this.position.clone()
  21602. , l = this.currentPano;
  21603. if (Y.debug("New pose in mode " + this.mode),
  21604. !e || (retryCallback = function() {
  21605. j.delayOneFrame(function() {
  21606. this.flyToSameMode(e, t, i, n, r)
  21607. }
  21608. .bind(this))
  21609. }
  21610. .bind(this),
  21611. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21612. var c = function() {
  21613. this.emit(W.FlyingEnded, a, s, e, l),
  21614. n && n(!0)
  21615. }
  21616. .bind(this)
  21617. , h = k[this.mode]
  21618. , u = void 0 !== t ? t : h.transitionTime
  21619. , d = new B.Vector3
  21620. , p = new B.Vector3;
  21621. if (this.emit(W.FlyingStarted, a, s, e, l),
  21622. this.mode === V.PANORAMA)
  21623. Y.warn("we should not be here for panorama views");
  21624. else if (this.mode === V.DOLLHOUSE)
  21625. if (o) {
  21626. var f = new B.Vector3(0,1,0);
  21627. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21628. this.model.warpDestFloors(i.floorVisibility),
  21629. p.copy(i.position);
  21630. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21631. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21632. , v = 3;
  21633. m.length ? (d.copy(m[0].point),
  21634. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21635. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21636. var y = (new B.Matrix4).lookAt(p, d, f)
  21637. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21638. , C = d.distanceTo(p)
  21639. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21640. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21641. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21642. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21643. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21644. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21645. this.path.burnsDir = Math.sign(b.y);
  21646. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21647. , T = new B.Vector3;
  21648. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21649. G.start(function(e, t) {
  21650. w.x = E.x + e * b.x,
  21651. w.y = E.y + e * b.y,
  21652. w.z = E.z + e * b.z;
  21653. var i = _ + e * (C - _);
  21654. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21655. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21656. }
  21657. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21658. G.start(function(e, t) {
  21659. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21660. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21661. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21662. }
  21663. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21664. } else
  21665. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21666. else if (this.path.placeCpm(),
  21667. this.path.fadeInCpm(k.path.fadeInTime),
  21668. i) {
  21669. this.model.warpDestFloors(i.floorVisibility);
  21670. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21671. , S = this.cameraControls.controls[V.FLOORPLAN]
  21672. , M = S.target.clone()
  21673. , R = i.position.clone().sub(M)
  21674. , P = x.position.clone().sub(S.target).length()
  21675. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21676. , L = Math.atan2(S.offset.x, S.offset.z)
  21677. , D = Math.atan2(O.x, O.z)
  21678. , N = S.absoluteScale
  21679. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21680. G.start(function(e, t) {
  21681. S.target.copy(R).multiplyScalar(e).add(M);
  21682. var i = L + (D - L) * e;
  21683. S.offset.x = P * Math.sin(i),
  21684. S.offset.z = P * Math.cos(i),
  21685. x.position.copy(S.target).add(S.offset),
  21686. S.absoluteScale = N + e * (F - N),
  21687. S.update(),
  21688. this.quaternion.copy(x.quaternion),
  21689. this.position.copy(x.position),
  21690. this.target.copy(S.target),
  21691. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21692. }
  21693. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21694. } else
  21695. Y.info("flyToSameMode() funny floorplan view? skipping");
  21696. return G.setTimeout(function(e) {
  21697. this.mode = e,
  21698. c(),
  21699. r.resolve(!0)
  21700. }
  21701. .bind(this, this.mode), u, q.FlyToSameMode),
  21702. this.mode = V.TRANSITIONING,
  21703. r.promise()
  21704. }
  21705. }
  21706. ,
  21707. t.prototype.flyToNewMode = function(e, t) {
  21708. var i = (e = e || {}).mode
  21709. , n = e.pano
  21710. , r = e.duration
  21711. , o = e.warpDest
  21712. , a = e.callback
  21713. , s = e.force
  21714. , l = e.quaternion;
  21715. if (t = t || $.Deferred(),
  21716. this.isWarping())
  21717. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21718. a && a(!1),
  21719. t.reject("Cannot change mode during tour transition").promise();
  21720. if (this.mode === V.TRANSITIONING)
  21721. return a && a(!1),
  21722. t.reject("Cannot change mode during mode transition").promise();
  21723. if (i === this.mode)
  21724. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21725. t.promise()) : (a && a(!1),
  21726. t.reject("Already in " + i + " mode").promise());
  21727. var c = o || !1;
  21728. Y.debug("Switching mode to " + i);
  21729. var h = function() {
  21730. j.delayOneFrame(function() {
  21731. this.flyToNewMode(e, t)
  21732. }
  21733. .bind(this))
  21734. }
  21735. .bind(this);
  21736. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21737. return t.promise();
  21738. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21739. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21740. this.model.waitForLoad(this.model, function() {
  21741. return this.model.meshTexturesLoaded
  21742. }
  21743. .bind(this)),
  21744. this.model.loadMeshTextures().done(h),
  21745. t.promise();
  21746. this.history.invalidate(),
  21747. this.updateLastView();
  21748. var u = this.mode
  21749. , d = this.cameraControls.cameras[i];
  21750. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21751. var p = void 0 !== r ? r : e.transitionTime;
  21752. this.emit(W.ModeChanging, u, i, n),
  21753. n && (this.currentPano = n),
  21754. this.switchCameraMode(i, l),
  21755. G.cancelById(q.LookTransition);
  21756. var f = (new B.Vector3).copy(this.position);
  21757. this.modeTran = this.mode + "-" + i;
  21758. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21759. VisiSet.finishSetPanoVisible()
  21760. VisiSet.finishSetTagVisible()
  21761. }
  21762. if(editTool.atPanel == "screen"){
  21763. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21764. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21765. }
  21766. if(i == "panorama"){
  21767. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21768. }else{
  21769. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21770. }
  21771. if (i === V.PANORAMA)
  21772. this.emit(W.PanoChosen, n, n),
  21773. setTimeout(function() {
  21774. n.floor.enter(i)
  21775. }
  21776. .bind(this), p / 2),
  21777. this.path.fadeOutCpm(k.path.fadeOutTime);
  21778. else if (i === V.DOLLHOUSE) {
  21779. if (c && (this.model.stayPut = !0),
  21780. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21781. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21782. this.path.placeCpm(),
  21783. this.path.fadeInCpm(k.path.fadeInTime),
  21784. c) {
  21785. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21786. f.set(15, 10, 15);
  21787. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21788. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21789. v.length ? (g.copy(v[0].point),
  21790. f.copy(o.position),
  21791. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  21792. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21793. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21794. f.add(this.model.position),
  21795. d.position.copy(f),
  21796. this.cameraControls.controls[V.DOLLHOUSE].update()
  21797. }
  21798. } else if (this.path.placeCpm(),
  21799. this.path.fadeInCpm(k.path.fadeInTime),
  21800. o) {
  21801. this.model.warpDestFloors(o.floorVisibility);
  21802. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21803. , A = this.cameraControls.controls[V.FLOORPLAN]
  21804. , C = y.position.clone().sub(A.target)
  21805. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21806. , E = Math.atan2(I.x, I.z);
  21807. A.target.copy(o.position);
  21808. var _ = C.length();
  21809. A.offset.x = _ * Math.sin(E),
  21810. A.offset.y = 0,
  21811. A.offset.z = _ * Math.cos(E),
  21812. y.position.copy(A.target).add(A.offset),
  21813. A.target.clone().sub(d.position),
  21814. d.quaternion.copy(o.quaternion),
  21815. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21816. A.absoluteScale = A.currentScale,
  21817. A.update()
  21818. } else
  21819. this.model.currentFloor.enter(i);
  21820. var b = this.currentPano
  21821. , w = this.position.clone();
  21822. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21823. this.flying = !0,
  21824. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21825. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21826. d.controls.update()),
  21827. e.blackoutStyle = P.FADEIN,
  21828. p = k.show360Views.transitionTime,
  21829. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21830. this.mode = i,
  21831. this.path && this.path.popOutCpm(),
  21832. e.blackoutStyle = P.END,
  21833. p = k.show360Views.transitionTime,
  21834. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21835. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21836. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21837. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21838. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21839. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21840. G.setTimeout(function() {
  21841. this.flying = !1,
  21842. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21843. this.currentPano.enter(),
  21844. this.path.placeCpm(),
  21845. this.path.fadeOutCpm(k.path.fadeOutTime),
  21846. this.spider.draw()),
  21847. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21848. this.mode = i,
  21849. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21850. if (this.afterCModeFuc) {
  21851. //手动加的函数
  21852. var cf = this.afterCModeFuc;
  21853. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21854. cf();
  21855. }
  21856. this.updateMarkerVisi();//add
  21857. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  21858. if(this.mode == "panorama" && EditOverlay.editing){
  21859. EditOverlay.updatePano(this.currentPano)
  21860. }
  21861. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21862. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21863. t.resolve())
  21864. }
  21865. .bind(this), p, q.FlyToNewMode),
  21866. this.mode = V.TRANSITIONING,
  21867. t.promise()
  21868. }
  21869. ,
  21870. t.prototype.fade360View = function(e, t, i) {
  21871. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21872. $(this.domElement).fadeOut(.5 * e, function() {
  21873. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21874. this.model.alpha = i.modelAlpha,
  21875. this.position.copy(t.position),
  21876. this.quaternion.copy(t.quaternion),
  21877. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21878. $(this.domElement).fadeIn(.5 * e)
  21879. }
  21880. .bind(this))
  21881. }
  21882. ,
  21883. t.prototype.findDefaultViews = function() {
  21884. this.findDefaultView(this.lastInsideView, !0),
  21885. this.findDefaultView(this.last360View, !1)
  21886. }
  21887. ,
  21888. t.prototype.findDefaultView = function(e, i) {
  21889. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21890. if (e.cameraMode !== V.PANORAMA)
  21891. return !1;
  21892. var t = r.get(e.panoId);
  21893. return t && t.isAligned() === i
  21894. });
  21895. 0 <= o ? (t = r.get(n[o].panoId),
  21896. e.update({
  21897. cameraMode: V.PANORAMA,
  21898. pano: t,
  21899. position: n[o].position,
  21900. quaternion: n[o].quaternion
  21901. })) : 0 <= (o = r.list.findIndex(function(e) {
  21902. return e.isAligned() === i
  21903. })) ? (t = r.list[o],
  21904. e.update({
  21905. cameraMode: V.PANORAMA,
  21906. pano: t,
  21907. position: t.position
  21908. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21909. }
  21910. ,
  21911. t.prototype.updateLastView = function() {
  21912. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21913. pano: this.currentPano,
  21914. position: this.position,
  21915. quaternion: this.quaternion
  21916. })
  21917. }
  21918. ,
  21919. t.prototype.goToLastView = function(e, t) {
  21920. var i = $.Deferred()
  21921. , n = i.resolve.bind(i)
  21922. , r = i.reject.bind(i)
  21923. , o = e ? this.lastInsideView : this.last360View;
  21924. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21925. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21926. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21927. mode: o.cameraMode,
  21928. pano: o.pano,
  21929. quaternion: o.quaternion,
  21930. callback: t
  21931. }).done(n).fail(r),
  21932. i.promise()
  21933. }
  21934. ,
  21935. t.prototype.fadeToView = function(e, t, i, n) {
  21936. var r = $.Deferred()
  21937. , o = r.resolve.bind(r)
  21938. , a = r.reject.bind(r);
  21939. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21940. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21941. a("Cannot go to illegal view"),
  21942. r.promise();
  21943. var s = (k[t.cameraMode],
  21944. function() {
  21945. $(this.domElement).fadeIn(.5 * i),
  21946. n && n(),
  21947. o()
  21948. }
  21949. .bind(this))
  21950. , l = e ? P.FADEIN : P.END;
  21951. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21952. $(this.domElement).fadeOut(.5 * i, function() {
  21953. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21954. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21955. pano: t.pano,
  21956. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21957. duration: 0
  21958. }, s) : this.flyToNewMode({
  21959. mode: t.cameraMode,
  21960. quaternion: t.quaternion,
  21961. duration: 0,
  21962. callback: s
  21963. })
  21964. }
  21965. .bind(this)),
  21966. r.promise()
  21967. }
  21968. ,
  21969. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21970. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21971. this.flying)
  21972. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21973. o && o(),
  21974. !1;
  21975. null != e || (e = M.Show),
  21976. this.history.invalidate(),
  21977. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21978. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21979. return this.emit(W.WarpStarted, a, i, n, r),
  21980. n = n || P.MIDDLE,
  21981. this.path.warpToPano(i, n, r, function() {
  21982. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21983. this.emit(W.WarpEnded, i),
  21984. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21985. o && o()
  21986. }
  21987. .bind(this)),
  21988. e === M.Hide && this.path.discardPathObject(),
  21989. !0
  21990. }
  21991. ,
  21992. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21993. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21994. s && s(),
  21995. !1)
  21996. }
  21997. ,
  21998. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21999. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22000. a && a(),
  22001. !1)
  22002. }
  22003. ,
  22004. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22005. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22006. }
  22007. ,
  22008. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22009. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22010. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22011. t && t(),
  22012. !1)
  22013. }
  22014. ,
  22015. t.prototype.aimTourCamera = function(e, t, i, n) {
  22016. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22017. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22018. }
  22019. ,
  22020. t.prototype.showPathToHeroLocation = function(e) {
  22021. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22022. }
  22023. ,
  22024. t.prototype.tourInterlude = function(e, t) {
  22025. this.history.invalidate(),
  22026. this.path.discardSlow();
  22027. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  22028. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22029. , r = i && i.music ? i.time - n : 2e3;
  22030. this.path.waitNextStep(e, function() {
  22031. t && t()
  22032. }
  22033. .bind(this), r)
  22034. }
  22035. ,
  22036. t.prototype.stopInterlude = function() {
  22037. this.interruptAndFastForward(null, 0)
  22038. }
  22039. ,
  22040. t.prototype.interruptAndFastForward = function(e, t) {
  22041. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22042. this.flying && this.emit(W.FlyingInterrupted),
  22043. this.path.interruptAndFastForward(e, t)
  22044. }
  22045. ,
  22046. t.prototype.setSize = function(e, t) {
  22047. var i = e / t;
  22048. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22049. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22050. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22051. this.cameraControls.cameras) {
  22052. var o = this.cameraControls.cameras[r];
  22053. o.fov = this.baseFov * (1 / this.zoomLevel),
  22054. o.updateAspect(i)
  22055. }
  22056. }
  22057. ,
  22058. t.prototype.toJSON = function() {
  22059. var e = {};
  22060. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22061. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22062. return e.hidden ? 0 : 1
  22063. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22064. e
  22065. }
  22066. ,
  22067. t.prototype.getCurrentNodePanos = function(e) {
  22068. if (this.model.panos.map,
  22069. e.length = 0,
  22070. this.path.nodes)
  22071. for (var t = 0; t < this.path.nodes.length; t++) {
  22072. var i = this.path.nodes[t];
  22073. e.push(this.model.panos.get(i))
  22074. }
  22075. }
  22076. ,
  22077. t.prototype.zoomIncrementally = function(e) {
  22078. var t = this.zoomLevel;
  22079. this.zoomTo(this.zoomLevel + e),
  22080. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22081. }
  22082. ,
  22083. t.prototype.zoomInIncrementally = function(e) {
  22084. e = e || this.defaultZoomIncrement,
  22085. this.zoomIncrementally(e)
  22086. }
  22087. ,
  22088. t.prototype.zoomOutIncrementally = function(e) {
  22089. e = e || -this.defaultZoomIncrement,
  22090. this.zoomIncrementally(e)
  22091. }
  22092. ,
  22093. t.prototype.zoomBy = function(e) {
  22094. this.zoomTo(this.zoomLevel * e)
  22095. }
  22096. ,
  22097. t.prototype.zoomIn = function() {
  22098. this.zoomBy(1 + this.zoomSpeed)
  22099. }
  22100. ,
  22101. t.prototype.zoomOut = function() {
  22102. this.zoomBy(1 - this.zoomSpeed)
  22103. }
  22104. ,
  22105. t.prototype.zoomTo = function(e, t) {
  22106. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22107. e > k.zoom.max && (e = k.zoom.max),
  22108. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22109. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22110. e === k.zoom.min && this.emit(m.ZoomMin)),
  22111. this.cameraControls.activeControl)) {
  22112. var i = this.cameraControls.activeControl.camera;
  22113. this.zoomLevel = e,
  22114. i.fov = this.baseFov * (1 / this.zoomLevel),
  22115. i.updateProjectionMatrix(),
  22116. this.zoomFov = i.fov
  22117. }
  22118. }
  22119. ,
  22120. t.prototype.increaseZoomSpeed = function() {
  22121. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22122. }
  22123. ,
  22124. t.prototype.decreaseZoomSpeed = function() {
  22125. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22126. }
  22127. ,
  22128. t.prototype.clampZoomSpeed = function(e) {
  22129. return e < 0 ? 0 : e
  22130. }
  22131. ,
  22132. t.prototype.activatePersistentZooming = function(e) {
  22133. this.zooming = e ? 1 : -1
  22134. }
  22135. ,
  22136. t.prototype.deactivatePersistentZooming = function() {
  22137. this.zooming = 0
  22138. }
  22139. ,
  22140. t.prototype.zoomDefault = function() {
  22141. this.zoomTo(1, !0)
  22142. }
  22143. ,
  22144. t.prototype.smoothZoomToDefault = function(e, t) {
  22145. var i, n = this.zoomLevel, r = function(e) {
  22146. 1 < e && (e = 1),
  22147. i = n * (1 - e) + e,
  22148. this.zoomTo(i, !0)
  22149. }
  22150. .bind(this), o = function() {
  22151. this.zoomDefault(),
  22152. t && window.setTimeout(t, 50)
  22153. }
  22154. .bind(this);
  22155. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22156. }
  22157. ,
  22158. t.prototype.updateZoomPano = function() {
  22159. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22160. var e = this.currentPano;
  22161. if (e) {
  22162. var t = this.zoomLevel > k.zoom.activationThreshold
  22163. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22164. t);
  22165. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22166. this.panoRenderer.setZoomingActive(i, e, !0);
  22167. var n = function(e, t) {
  22168. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22169. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22170. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22171. e.setZoomed(t)
  22172. }
  22173. .bind(this);
  22174. i && !e.zoomed ? (n(e, !0),
  22175. this.panoRenderer.enableUltraHighQualityMode(function() {
  22176. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22177. i && n(e, !0)
  22178. }
  22179. .bind(this))) : !t && e.zoomed && n(e, !1)
  22180. }
  22181. }
  22182. },
  22183. //--------
  22184. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22185. var f2;
  22186. if (this.mode == mode) {
  22187. f1 && f1()
  22188. } else {
  22189. f2 = f1;
  22190. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22191. this.afterCModeFuc = function() {
  22192. this.afterCModeFuc = f2
  22193. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22194. }.bind(this)
  22195. } else {
  22196. this.afterCModeFuc = f2;//飞入后执行
  22197. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22198. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22199. }catch(e){}
  22200. }
  22201. }
  22202. }
  22203. ,
  22204. t.prototype.checkHasNeighbor = function(pano){//add
  22205. for(var i in pano.neighbourPanos ){
  22206. if(i == pano.id)continue;
  22207. if(pano.neighbourPanos[i]){
  22208. return true;
  22209. }
  22210. }
  22211. }
  22212. ,
  22213. ee.exports = t
  22214. }
  22215. ).call(this, "/js/player.js")
  22216. }
  22217. , {
  22218. "./constants": 8,
  22219. "./enum/AlignmentType": 17,
  22220. "./enum/BlackoutStyle": 18,
  22221. "./enum/ControlEvents": 21,
  22222. "./enum/Keys": 30,
  22223. "./enum/ModelManagerEvents": 33,
  22224. "./enum/PanoSizeClass": 36,
  22225. "./enum/PanoramaEvents": 37,
  22226. "./enum/PathDiscardMode": 38,
  22227. "./enum/PathDisplayMode": 39,
  22228. "./enum/PlayerEvents": 40,
  22229. "./enum/TagStates": 44,
  22230. "./enum/Vectors": 50,
  22231. "./enum/Viewmode": 51,
  22232. "./enum/WarpStyle": 52,
  22233. "./enum/ZoomEvents": 53,
  22234. "./exception/BasicException": 55,
  22235. "./model/ModelManager": 140,
  22236. "./objects/NSpider": 147,
  22237. "./objects/Panorama": 148,
  22238. "./objects/Reticule": 149,
  22239. "./objects/ShowPath": 151,
  22240. "./objects/Snapshot": 153,
  22241. "./objects/View": 154,
  22242. "./settings": 166,
  22243. "./shaders": 167,
  22244. "./tile/TileDownloader": 171,
  22245. "./tile/TilePrioritizer": 172,
  22246. "./util/ZoomStats": 179,
  22247. "./util/browser": 182,
  22248. "./util/camera": 183,
  22249. "./util/cameraLight": 184,
  22250. "./util/common": 185,
  22251. "./util/easing": 186,
  22252. "./util/history": 187,
  22253. "./util/lerp": 188,
  22254. "./util/logger": 189,
  22255. "./util/math": 190,
  22256. "./util/transitions": 195,
  22257. hot: "hot",
  22258. scaleImg: "scaleImg",
  22259. events: 202,
  22260. three: 217
  22261. }],
  22262. scaleImg: [function(e, t) {
  22263. var i = t;
  22264. (function() {
  22265. function e(e, t, i, n) {
  22266. function r() {
  22267. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22268. U.height = p,
  22269. H = U.getContext("2d")
  22270. }
  22271. function o(e) {
  22272. if (e) {
  22273. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22274. for (t = 0; t < ie; t += 4)
  22275. n[t] = e[t] * ne | 0,
  22276. n[t + 1] = e[t + 1] * ne | 0,
  22277. n[t + 2] = e[t + 2] * ne | 0,
  22278. n[t + 3] = e[t + 3] * ne | 0;
  22279. return delete e,
  22280. i
  22281. }
  22282. return H.getImageData(0, 0, d, p)
  22283. }
  22284. function a(e, t, i, n, r) {
  22285. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22286. }
  22287. var s, l;
  22288. if (t || (t = e.input,
  22289. i = e.output,
  22290. n = e.inputRemovable,
  22291. e.scale && (e = e.scale)),
  22292. t.src)
  22293. if (s = document.createElement("canvas"),
  22294. null != t.naturalWidth)
  22295. s.width = t.naturalWidth,
  22296. s.height = t.naturalHeight;
  22297. else if (null != t.runtimeStyle) {
  22298. var c = t.runtimeStyle
  22299. , h = c.width
  22300. , u = c.height;
  22301. c.width = "auto",
  22302. c.height = "auto",
  22303. s.width = t.width,
  22304. s.height = t.height,
  22305. c.width = h,
  22306. c.height = u
  22307. } else {
  22308. h = t.width,
  22309. u = t.height;
  22310. t.removeAttribute && (t.removeAttribute("width"),
  22311. t.removeAttribute("height")),
  22312. s.width = t.width,
  22313. s.height = t.height,
  22314. t.width = h,
  22315. t.height = u
  22316. }
  22317. else
  22318. s = t;
  22319. l = s.getContext("2d"),
  22320. t.src && l.drawImage(t, 0, 0);
  22321. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22322. if (!f || !g)
  22323. return !1;
  22324. (t.src || n) && s.clearRect(0, 0, f, g),
  22325. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22326. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22327. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22328. e * g + .5 | 0);
  22329. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22330. if (1 < re || 1 < oe)
  22331. for (r(),
  22332. G = (z = o()).data,
  22333. C = 0; C < p; C++)
  22334. for (V = (y = C / oe) - (w = 0 | y),
  22335. j = w * $,
  22336. W = w < 1 ? j : j - $,
  22337. w < g - 2 ? (Y = j + $,
  22338. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22339. A = 0; A < d; A++,
  22340. te += 4)
  22341. Z = (b = 0 | (v = A / re)) << 2,
  22342. b < f - 2 ? (K = Z + 4,
  22343. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22344. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22345. ++Z,
  22346. ++K,
  22347. ++Q,
  22348. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22349. ++Z,
  22350. ++K,
  22351. ++Q,
  22352. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22353. ++Z,
  22354. ++K,
  22355. ++Q,
  22356. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22357. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22358. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22359. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22360. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22361. else {
  22362. if (le.Float32Array)
  22363. L = new Float32Array(ie);
  22364. else
  22365. for (L = [],
  22366. te = 0; te < ie; ++te)
  22367. L[te] = 0;
  22368. for (y = 0; y < g; y++)
  22369. for (I = (_ = 0 | (C = y * oe)) * J,
  22370. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22371. R = C + oe - _ - 1),
  22372. v = 0; v < f; v++,
  22373. ee += 4)
  22374. switch (A = v * re,
  22375. E = 0 | A,
  22376. te = I + (E << 2),
  22377. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22378. P && (x = 1 + E - A,
  22379. S = A + re - E - 1),
  22380. D = m[ee],
  22381. F = m[ee + 1],
  22382. B = m[ee + 2],
  22383. N = m[ee + 3],
  22384. P + O) {
  22385. case 0:
  22386. L[te] += D * ae,
  22387. L[te + 1] += F * ae,
  22388. L[te + 2] += B * ae,
  22389. L[te + 3] += N * ae;
  22390. break;
  22391. case 1:
  22392. T = x * oe,
  22393. L[te] += D * T,
  22394. L[te + 1] += F * T,
  22395. L[te + 2] += B * T,
  22396. L[te + 3] += N * T,
  22397. T = S * oe,
  22398. L[te + 4] += D * T,
  22399. L[te + 5] += F * T,
  22400. L[te + 6] += B * T,
  22401. L[te + 7] += N * T;
  22402. break;
  22403. case 2:
  22404. T = re * M,
  22405. L[te] += D * T,
  22406. L[te + 1] += F * T,
  22407. L[te + 2] += B * T,
  22408. L[te + 3] += N * T,
  22409. T = re * R,
  22410. L[te += J] += D * T,
  22411. L[te + 1] += F * T,
  22412. L[te + 2] += B * T,
  22413. L[te + 3] += N * T;
  22414. break;
  22415. default:
  22416. T = x * M,
  22417. L[te] += D * T,
  22418. L[te + 1] += F * T,
  22419. L[te + 2] += B * T,
  22420. L[te + 3] += N * T,
  22421. T = S * M,
  22422. L[te + 4] += D * T,
  22423. L[te + 5] += F * T,
  22424. L[te + 6] += B * T,
  22425. L[te + 7] += N * T,
  22426. T = x * R,
  22427. L[te += J] += D * T,
  22428. L[te + 1] += F * T,
  22429. L[te + 2] += B * T,
  22430. L[te + 3] += N * T,
  22431. T = S * R,
  22432. L[te + 4] += D * T,
  22433. L[te + 5] += F * T,
  22434. L[te + 6] += B * T,
  22435. L[te + 7] += N * T
  22436. }
  22437. delete m,
  22438. r(),
  22439. z = o(L)
  22440. }
  22441. if (H.putImageData(z, 0, 0),
  22442. "string" == typeof i) {
  22443. var se;
  22444. if ("png" === i || "jpeg" === i)
  22445. return (se = n && t.src ? t : new Image).width = d,
  22446. se.height = p,
  22447. se.src = U.toDataURL("image/" + i, .85),
  22448. se;
  22449. if ("png-src" === i || "jpeg-src" === i)
  22450. return U.toDataURL("image/" + i.split("-")[0], .85)
  22451. }
  22452. return U
  22453. }
  22454. var le = this;
  22455. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22456. exports.scale = e) : c = e
  22457. }
  22458. ).call(this),
  22459. i.exports = c
  22460. }
  22461. , {}],
  22462. 156: [function(i, n, e) {
  22463. (function(e) {
  22464. "use strict";
  22465. function t(e, t) {
  22466. this.model = e,
  22467. this.panos = e.panos,
  22468. this.player = t,
  22469. this.imagePanos = this.listImagePanos(),
  22470. this.retryMinimumTime = 1e4
  22471. }
  22472. var r = (i("three"),
  22473. i("./enum/Viewmode"))
  22474. , o = (i("./settings"),
  22475. i("./objects/Panorama"))
  22476. , a = new (i("./util/logger"))(e);
  22477. t.prototype.start = function() {
  22478. this.loadNextPano(function(e) {
  22479. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22480. setTimeout(function() {
  22481. this.start()
  22482. }
  22483. .bind(this), 1e3))
  22484. }
  22485. .bind(this))
  22486. }
  22487. ,
  22488. t.prototype.validLoadTarget = function(e) {
  22489. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22490. }
  22491. ,
  22492. t.prototype.listImagePanos = function() {
  22493. var i = []
  22494. , n = this;
  22495. return this.model.images.forEach(function(e) {
  22496. if (e.metadata && e.metadata.scan_id) {
  22497. var t = n.model.panos.get(e.metadata.scan_id);
  22498. t && !t.isLoaded("high") && i.push(t)
  22499. }
  22500. }),
  22501. i
  22502. }
  22503. ,
  22504. t.prototype.nextNotLoadedImage = function() {
  22505. for (; 0 < this.imagePanos.length; ) {
  22506. var e = this.imagePanos[0];
  22507. if (!e.isLoaded("high"))
  22508. return e;
  22509. this.imagePanos.shift()
  22510. }
  22511. return null
  22512. }
  22513. ,
  22514. t.prototype.loadNextPano = function(e) {
  22515. var t, i, n = this.model.waitQueue.filter(function(e) {
  22516. return e.object instanceof o
  22517. });
  22518. 0 < n.length ? (t = n[0].object,
  22519. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22520. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22521. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22522. t = this.imagePanos[0],
  22523. a.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode !== r.PANORAMA || (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + t.id),
  22524. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22525. a.debug("Preloading " + i + "-res pano " + t.id),
  22526. t.loadCube(i).done(e).fail(function() {
  22527. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22528. e()
  22529. })) : e && e(null)
  22530. }
  22531. ,
  22532. n.exports = t
  22533. }
  22534. ).call(this, "/js/preloaders.js")
  22535. }
  22536. , {
  22537. "./enum/Viewmode": 51,
  22538. "./objects/Panorama": 148,
  22539. "./settings": 166,
  22540. "./util/logger": 189,
  22541. three: 217
  22542. }],
  22543. 157: [function(a, s, e) {
  22544. (function(e) {
  22545. "use strict";
  22546. function t(e, t, i, n, r) {
  22547. this.qualityManager = e,
  22548. this.scene = t,
  22549. this.camera = i,
  22550. this.container = r,
  22551. this.controls = n,
  22552. this.controls.enabled = !0,
  22553. this.controls.locked = !0,
  22554. this.quickstartCamera = n.camera,
  22555. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22556. this.skybox = null
  22557. }
  22558. var i = a("three")
  22559. , n = a("../util/logger")
  22560. , o = a("../constants")
  22561. , h = (a("../util/transitions"),
  22562. a("../util/lerp"),
  22563. a("../util/easing"),
  22564. a("../enum/Vectors"))
  22565. , u = a("../enum/PanoSizeClass")
  22566. , r = (a("../materials/ModelTextureMaterial"),
  22567. a("../materials/CubemapMaterial"))
  22568. , d = (a("../cameras/PanoramaCamera"),
  22569. a("../controls/PanoramaControls"),
  22570. a("../tile/TileUtils"),
  22571. a("../util/camera"),
  22572. a("../util/cameraLight"))
  22573. , p = (a("../util/browser"),
  22574. a("../settings"),
  22575. a("../gui/helpManager"),
  22576. new n(e));
  22577. t.prototype.load = function(e) {
  22578. e.pano.shouldRedrawOnBaseLoaded = !0;
  22579. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22580. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22581. var a = this.qualityManager.getPanoSize(u.BASE)
  22582. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22583. if (e.pano.tiled) {
  22584. p.warn("Loading startPano, TILED", e.pano.id);
  22585. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22586. , c = this.quickstartCamera.fov;
  22587. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22588. t = e.pano.loadTiledPano(s, r, {
  22589. hFov: l,
  22590. vFov: c
  22591. }, !1, !1, !0),
  22592. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22593. } else
  22594. p.warn("Loading startPano", e.pano.id),
  22595. t = e.pano.loadCube("high");
  22596. return $.when(t).then(function() {
  22597. n.init(e.pano, e.quaternion),
  22598. e.pano.tiled ? i.done(function() {
  22599. e.pano.lockUntilRenderingComplete = !1,
  22600. this.controls.locked = !1
  22601. }
  22602. .bind(this)) : this.controls.locked = !1
  22603. }
  22604. .bind(this))
  22605. }
  22606. ,
  22607. t.prototype.init = function(e, t) {
  22608. p.info("Quickstart done loading, adding scene objects"),
  22609. e.lockUntilRenderingComplete = !0,
  22610. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22611. side: i.BackSide
  22612. })),
  22613. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22614. this.skybox.quaternion.copy(e.quaternion),
  22615. this.scene.add(this.skybox),
  22616. $(this.container).show()
  22617. }
  22618. ,
  22619. t.prototype.update = function(e) {
  22620. this.controls.update(e),
  22621. this.camera.copy(this.quickstartCamera)
  22622. }
  22623. ,
  22624. t.prototype.setSize = function(e, t) {
  22625. this.quickstartCamera.updateAspect(e / t)
  22626. }
  22627. ,
  22628. t.prototype.destroy = function() {
  22629. this.scene.remove(this.skybox)
  22630. }
  22631. ,
  22632. s.exports = t
  22633. }
  22634. ).call(this, "/js/scene/QuickstartManager.js")
  22635. }
  22636. , {
  22637. "../cameras/PanoramaCamera": 7,
  22638. "../constants": 8,
  22639. "../controls/PanoramaControls": 13,
  22640. "../enum/PanoSizeClass": 36,
  22641. "../enum/Vectors": 50,
  22642. "../gui/helpManager": 68,
  22643. "../materials/CubemapMaterial": 117,
  22644. "../materials/ModelTextureMaterial": 118,
  22645. "../settings": 166,
  22646. "../tile/TileUtils": 174,
  22647. "../util/browser": 182,
  22648. "../util/camera": 183,
  22649. "../util/cameraLight": 184,
  22650. "../util/easing": 186,
  22651. "../util/lerp": 188,
  22652. "../util/logger": 189,
  22653. "../util/transitions": 195,
  22654. three: 217
  22655. }],
  22656. 158: [function(e, t, i) {
  22657. "use strict";
  22658. function h(e, t, i) {
  22659. this.scene = e,
  22660. this.camera = t,
  22661. this.renderer = null,
  22662. this.effects = i,
  22663. this.animateCallback = null,
  22664. this.composer = null,
  22665. this.qualityManager = null,
  22666. e.renderWidth = 0,
  22667. e.renderHeight = 0,
  22668. this.updateClock = new M.Clock,
  22669. this.components = [],
  22670. this.updateListeners = [],
  22671. this.resizeListeners = [],
  22672. this.forceUpdateSize = !1,
  22673. this.started = !1,
  22674. this.textures = {},
  22675. this.suspendedObjects = []
  22676. }
  22677. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  22678. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22679. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22680. this.components.push(e),
  22681. e.update && this.updateListeners.push(e),
  22682. e.setSize && (this.resizeListeners.push(e),
  22683. this.forceUpdateSize = !0)
  22684. }
  22685. ,
  22686. h.prototype.removeComponent = function(t) {
  22687. function e(e) {
  22688. return e !== t
  22689. }
  22690. this.components = this.components.filter(e),
  22691. this.updateListeners = this.updateListeners.filter(e),
  22692. this.resizeListeners = this.resizeListeners.filter(e)
  22693. }
  22694. ,
  22695. h.prototype.start = function(e) {
  22696. if (this.started)
  22697. throw new l("Can't start SceneRenderer, already started");
  22698. this.createContext(e),
  22699. //u.isMobile() && this.boluoVrInit(),
  22700. this.initComposer(),
  22701. this.started = !0,
  22702. (b = b.bind(this))()
  22703. }
  22704. ,
  22705. h.prototype.createContext = function(e) {
  22706. try {
  22707. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22708. this.renderer.autoClear = !0,
  22709. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22710. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22711. this.emit(r.ContextCreated)
  22712. } catch (e) {
  22713. throw new c("Unable to create a WebGL rendering context")
  22714. }
  22715. d.profiling.enabled && this.overrideTextures(),
  22716. e.appendChild(this.renderer.domElement)
  22717. }
  22718. ,
  22719. h.prototype.overrideTextures = function() {
  22720. var d = this.renderer.context
  22721. , t = 0
  22722. , i = d.createTexture;
  22723. d.createTexture = function() {
  22724. var e = i.call(d);
  22725. return e.id = t++,
  22726. this.textures[e.id] = e
  22727. }
  22728. .bind(this);
  22729. var p = d.texImage2D;
  22730. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22731. var c, h = this.getTextureTypeFromTarget(d, e);
  22732. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22733. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22734. s = r,
  22735. n = (l = o).naturalWidth,
  22736. r = l.naturalHeight,
  22737. p.call(d, e, t, i, a, s, l));
  22738. var u = this.textures[c.id];
  22739. u.width = h === f.TextureCube ? 6 * n : n,
  22740. u.height = r
  22741. }
  22742. .bind(this);
  22743. var n = d.deleteTexture;
  22744. d.deleteTexture = function(e) {
  22745. delete this.textures[e.id],
  22746. n.call(d, e)
  22747. }
  22748. .bind(this)
  22749. }
  22750. ,
  22751. h.prototype.updateTextureMemory = (n = null,
  22752. function() {
  22753. var e = 0;
  22754. for (var t in this.textures) {
  22755. var i = this.textures[t];
  22756. i.width && i.height && (e += i.width * i.height * 4)
  22757. }
  22758. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22759. n = e
  22760. }
  22761. ),
  22762. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22763. switch (t) {
  22764. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22765. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22766. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22767. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22768. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22769. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22770. return f.TextureCube;
  22771. case e.TEXTURE_2D:
  22772. return f.Texture2D;
  22773. default:
  22774. return null
  22775. }
  22776. }
  22777. ,
  22778. h.prototype.initComposer = function() {
  22779. this.composer = new M.EffectComposer(this.renderer),
  22780. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22781. this.composer.addPass(this.effects.hblurPass),
  22782. this.composer.addPass(this.effects.vblurPass)
  22783. }
  22784. ,
  22785. h.prototype.setSize = function(e, t, i) {
  22786. this.renderWidth = e,
  22787. this.renderHeight = t,
  22788. this.effects.aspect = e / t,
  22789. this.renderer.setSize(e, t, !1, i),
  22790. this.composer.setSize(e, t);
  22791. for (var n = 0; n < this.resizeListeners.length; n++)
  22792. this.resizeListeners[n].setSize(e, t)
  22793. }
  22794. ,
  22795. h.prototype.render = function() {
  22796. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22797. }
  22798. ,
  22799. h.prototype.boluoVrInit = function() {
  22800. console.log("boluoVrInit"),
  22801. this.isHuawei5X = u.detectHUAWEI5X(),
  22802. this.oldRenderer = this.renderer,
  22803. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22804. window.panoCamera = this.camera;
  22805. var i = this;
  22806. window._vrEnabled = !1,
  22807. Object.defineProperty(window, "vrEnabled", {
  22808. get: function() {
  22809. return window._vrEnabled
  22810. },
  22811. set: function(e) {
  22812. (e = !!e) ? (i.renderer = i.newRenderer,
  22813. window.vrMarkers.forEach(function(e) {
  22814. e.visible = !0
  22815. })) : (i.renderer = i.oldRenderer,
  22816. window.vrMarkers.forEach(function(e) {
  22817. e.visible = !1
  22818. })),
  22819. i.cursor.visible = e,
  22820. i.setSize(window.innerWidth, window.innerHeight),
  22821. window._vrEnabled = e,
  22822. setTimeout(function() {
  22823. console.log(player.cameraControls.activeControl.camera.fov)
  22824. }, 500)
  22825. }
  22826. }),
  22827. this.createCursor(.5, !1, 1, 16777215, 0);
  22828. var e = {
  22829. setSize: function(e, t) {
  22830. i.camera.aspect = e / t
  22831. }
  22832. };
  22833. this.resizeListeners.push(e),
  22834. this.vrLoadingInit()
  22835. }
  22836. ,
  22837. h.prototype.vrLoadingInit = function() {
  22838. var e = new (e = function(camera) {
  22839. var t = this
  22840. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22841. , i = new M.MeshBasicMaterial({
  22842. color: 4967932,
  22843. side: M.DoubleSide
  22844. })
  22845. , n = new M.Mesh(e,i);
  22846. (this.mesh = n).position.z = -2,
  22847. n.scale.set(.08, .08, .08),
  22848. n.visible = !1,
  22849. //window.player.camera.add(n),
  22850. camera.add(n),
  22851. t.enabled = !1,
  22852. this.update = function(e) {
  22853. 1 == t.enabled && (n.rotation.z += 15 * e)
  22854. }
  22855. }
  22856. )(this.camera);
  22857. window.Loading = e,
  22858. this.updateListeners.push(e)
  22859. }
  22860. ,
  22861. h.prototype.createCursor = function(e, t, i, n, r) {
  22862. var o, a = new M.SpriteMaterial({
  22863. opacity: i,
  22864. color: n,
  22865. transparent: t,
  22866. map: this.boluoGetTexture("images/cursor.png"),
  22867. needsUpdate: !0,
  22868. side: M.DoubleSide
  22869. });
  22870. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22871. a.map.repeat = new M.Vector2(1 / 17,1),
  22872. a.depthTest = !1,
  22873. a.blending = M.AdditiveBlending,
  22874. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22875. o.position.z = -2,
  22876. o.visible = !1,
  22877. o.name = "cursor",
  22878. this.camera.add(o),
  22879. this.scene.add(this.camera),
  22880. this.cursor = o;
  22881. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22882. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22883. this.updateListeners.push(s)
  22884. }
  22885. ,
  22886. h.prototype.CursorAnimation = function(e, t, o) {
  22887. this.cursor = t,
  22888. this.raycaster = new M.Raycaster,
  22889. this.targetEventObj = {},
  22890. this.type = 1,
  22891. this.tweenFlag = !0;
  22892. var s = this;
  22893. this.target = o,
  22894. console.log(o.uuid),
  22895. this.euler = new M.Euler,
  22896. this.q0 = new M.Quaternion,
  22897. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22898. this.zee = new M.Vector3(0,0,1),
  22899. this.alpha = -1e3,
  22900. this.beta = -1e3,
  22901. this.gamma = -1e3,
  22902. this.orient = M.Math.degToRad(window.orientation || 0),
  22903. window.addEventListener("orientationchange", function() {
  22904. s.orient = M.Math.degToRad(window.orientation || 0)
  22905. }),
  22906. window.addEventListener("deviceorientation", function(e) {
  22907. var t = M.Math.degToRad(e.alpha)
  22908. , i = M.Math.degToRad(e.beta)
  22909. , n = M.Math.degToRad(e.gamma);
  22910. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22911. -1e3 === s.beta && (s.beta = i),
  22912. -1e3 === s.gamma && (s.gamma = n),
  22913. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22914. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22915. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22916. s.beta = i,
  22917. s.gamma = n),
  22918. h.vrDebug) {
  22919. $("#info-device-orientation").css("display", "block");
  22920. var r = "";
  22921. r += "alpha=(" + s.alpha + ")<BR/>",
  22922. r += "beta=(" + s.beta + ")<BR/>",
  22923. r += "gamma=" + s.gamma + "<BR/>",
  22924. document.getElementById("info-device-orientation").innerHTML = r
  22925. }
  22926. }),
  22927. this.setObjectQuaternion = function(e, t, i, n, r) {
  22928. s.euler.set(i, t, -n, "YXZ"),
  22929. e.setFromEuler(s.euler),
  22930. e.multiply(s.q1),
  22931. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22932. o.updateMatrixWorld()
  22933. }
  22934. ,
  22935. parent !== window && window.addEventListener("message", function(e) {
  22936. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22937. o && o.alpha && o.beta && o.gamma && (t = a,
  22938. i = M.Math.degToRad(o.alpha),
  22939. n = M.Math.degToRad(o.beta),
  22940. r = M.Math.degToRad(o.gamma),
  22941. t ? (-1e3 === s.alpha && (s.alpha = i),
  22942. -1e3 === s.beta && (s.beta = n),
  22943. -1e3 === s.gamma && (s.gamma = r),
  22944. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22945. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22946. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22947. s.beta = n,
  22948. s.gamma = r))
  22949. }),
  22950. this.update = function(e) {
  22951. TWEEN.update(),
  22952. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22953. this.triggerTargetEvent())
  22954. }
  22955. ,
  22956. this.triggerTargetEvent = function() {
  22957. var e = this.choseObj()
  22958. , t = e ? e.object : void 0;
  22959. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22960. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22961. t && t.enabled && this.startAnimate(function() {
  22962. this.clickCallback(t)
  22963. }
  22964. .bind(this))) : this.type,
  22965. this.targetEventObj.lastObj = t)
  22966. }
  22967. ,
  22968. this.choseObj = function() {
  22969. this.raycaster.setFromCamera({
  22970. x: 0,
  22971. y: 0
  22972. }, o);
  22973. var e = (this.raycaster.ray,
  22974. window.vrMarkers)
  22975. , t = this.raycaster.intersectObjects(e);
  22976. if (0 < t.length)
  22977. return t[0]
  22978. }
  22979. ,
  22980. this.clickCallback = function(e) {
  22981. this.runTHREEAction(e, "onclick")
  22982. }
  22983. ,
  22984. this.runTHREEAction = function(e, t) {
  22985. switch (t) {
  22986. case "onclick":
  22987. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22988. e()
  22989. });
  22990. break;
  22991. case "onhover":
  22992. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22993. e()
  22994. });
  22995. break;
  22996. case "onout":
  22997. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22998. e()
  22999. })
  23000. }
  23001. }
  23002. ,
  23003. this.startAnimate = function(e) {
  23004. this.tweenFlag && this.initAnimation(e)
  23005. }
  23006. ,
  23007. this.initAnimation = function(e) {
  23008. var t = this
  23009. , i = this.cursor.material.map.offset;
  23010. t.tweenFlag = !1,
  23011. this.cursorAnimate = new TWEEN.Tween(i).to({
  23012. x: 1
  23013. }, 1e3).onStart(function() {
  23014. t.tweenFlag = !1
  23015. }).onStop(function() {
  23016. t.tweenFlag = !0,
  23017. this.x = 0,
  23018. i.x = 0
  23019. }).onUpdate(function() {}).onComplete(function() {
  23020. e(),
  23021. i.x = 0,
  23022. setTimeout(function() {
  23023. t.tweenFlag = !0
  23024. }, 1500)
  23025. }),
  23026. this.cursorAnimate.easing(function(e) {
  23027. return Math.floor(17 * e) / 17
  23028. }),
  23029. this.cursorAnimate.start()
  23030. }
  23031. ,
  23032. this.autoCursorPosition = function(e) {
  23033. this.cursor.scale.set(.3, .3, .3)
  23034. }
  23035. }
  23036. ,
  23037. h.prototype.vrRenderer = function(a, i, e) {
  23038. var s = new i.vrCamera(e);
  23039. s.bananaAspect = .8,
  23040. this.width,
  23041. this.height;
  23042. i = this;
  23043. this.setSize = function(e, t) {
  23044. a.setSize.call(this, e, t),
  23045. i.width = e,
  23046. i.height = t
  23047. }
  23048. ,
  23049. this.render = function(e, t, i, n) {
  23050. var r, o;
  23051. if (window.cameraQua = t.quaternion.clone(),
  23052. t.__RESS__SKIP__STEREO__)
  23053. return a.render(e, t, i, n);
  23054. if ("PerspectiveCamera" === t.type)
  23055. r = s.cameraL,
  23056. o = s.cameraR,
  23057. e.updateMatrixWorld(),
  23058. null === t.parent && t.updateMatrixWorld(),
  23059. s.vrCameraUpdate(t);
  23060. else {
  23061. if ("OrthographicCamera" !== t.type)
  23062. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23063. r = o = t
  23064. }
  23065. a.setScissorTest(!0),
  23066. a.setScissor(0, 0, this.width / 2, this.height),
  23067. a.setViewport(0, 0, this.width / 2, this.height),
  23068. a.render.call(this, e, r, i, n),
  23069. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23070. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23071. a.render.call(this, e, o, i, n),
  23072. a.setScissorTest(!1)
  23073. }
  23074. ,
  23075. this.__proto__ = {
  23076. __proto__: a
  23077. }
  23078. }
  23079. ,
  23080. h.prototype.vrCamera = function(e) {
  23081. this.type = "StereoCamera",
  23082. this._aspect = 1,
  23083. this._overlap = .064,
  23084. this.cameraL = new M.PerspectiveCamera,
  23085. this.cameraL.layers.enable(1),
  23086. this.cameraL.matrixAutoUpdate = !1,
  23087. this.cameraR = new M.PerspectiveCamera,
  23088. this.cameraR.layers.enable(2),
  23089. this.cameraR.matrixAutoUpdate = !1,
  23090. this.eyeRight = new M.Matrix4,
  23091. this.eyeLeft = new M.Matrix4,
  23092. this.vrCameraNeedsUpdate = !0,
  23093. window.vrCameraL = this.cameraL,
  23094. Object.defineProperty(this, "bananaAspect", {
  23095. get: function() {
  23096. return this._aspect
  23097. },
  23098. set: function(e) {
  23099. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23100. this._aspect = e
  23101. }
  23102. }),
  23103. Object.defineProperty(this, "overlap", {
  23104. get: function() {
  23105. return this._overlap
  23106. },
  23107. set: function(e) {
  23108. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23109. this._overlap = e
  23110. }
  23111. }),
  23112. this.vrCameraUpdate = function(e) {
  23113. if (this.vrCameraNeedsUpdate = !0,
  23114. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23115. this.vrCameraNeedsUpdate) {
  23116. this.vrCameraNeedsUpdate = !1,
  23117. console.debug("vrCameraUpdate"),
  23118. this.bananaFocus = e.focus,
  23119. this.bananaFov = e.fov,
  23120. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23121. this.bananaNear = e.near,
  23122. this.bananaFar = e.far,
  23123. console.debug(e.aspect),
  23124. this.bananaFocus = 10;
  23125. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  23126. this.eyeLeft.elements[12] = -r,
  23127. this.eyeRight.elements[12] = r,
  23128. t = -a * this.bananaReal_aspect + o,
  23129. i = a * this.bananaReal_aspect + o,
  23130. n.elements[0] = 2 * this.bananaNear / (i - t),
  23131. n.elements[8] = (i + t) / (i - t),
  23132. this.cameraL.projectionMatrix.copy(n),
  23133. t = -a * this.bananaReal_aspect - o,
  23134. i = a * this.bananaReal_aspect - o,
  23135. n.elements[0] = 2 * this.bananaNear / (i - t),
  23136. n.elements[8] = (i + t) / (i - t),
  23137. this.cameraR.projectionMatrix.copy(n)
  23138. }
  23139. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23140. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23141. }
  23142. }
  23143. ,
  23144. h.prototype.boluoGetTexture = function(e) {
  23145. var t = new M.TextureLoader;
  23146. return t.crossOrigin = "anonymous",
  23147. t.load(e)
  23148. }
  23149. ,
  23150. h.prototype.updateScreenSize = function(e) {
  23151. var t, i, n, r = !1;
  23152. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23153. n = e.height,
  23154. r = !0,
  23155. t = 1) : (i = $("#player").width(),
  23156. n = $("#player").height(),
  23157. e && e.resize && (o = this.renderWidth,
  23158. a = this.renderHeight),
  23159. i === o && n === a && !this.forceUpdateSize || (o = i,
  23160. a = n,
  23161. r = !0,
  23162. t = window.devicePixelRatio)),
  23163. r && (this.setSize(i, n, t),
  23164. this.forceUpdateSize = !1)
  23165. }
  23166. ,
  23167. h.prototype.updateComponents = function() {
  23168. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23169. this.updateListeners[t].update(e)
  23170. }
  23171. ,
  23172. h.prototype.suspend = function() {
  23173. this.started = !1,
  23174. this.suspendedObjects = this.scene.children.map(function(e) {
  23175. return this.scene.remove(e),
  23176. e
  23177. }
  23178. .bind(this)),
  23179. this.render()
  23180. }
  23181. ,
  23182. h.prototype.resume = function() {
  23183. this.suspendedObjects.forEach(function(e) {
  23184. this.scene.add(e)
  23185. }
  23186. .bind(this)),
  23187. this.suspendedObjects = [],
  23188. this.started = !0,
  23189. b()
  23190. }
  23191. ;
  23192. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23193. this.started && (window.requestAnimationFrame(b),
  23194. this.updateScreenSize(),
  23195. this.updateComponents(),
  23196. this.updateTextureMemory(),
  23197. this.render(),
  23198. this.emit(r.AfterRender))
  23199. };
  23200. h.prototype.getImageData = (E = document.createElement("canvas"),
  23201. _ = E.getContext("2d"),
  23202. function(e, t, i) {
  23203. return E.width === t && E.height === i || (E.width = t,
  23204. E.height = i),
  23205. _.drawImage(e, 0, 0, t, i),
  23206. _.getImageData(0, 0, t, i)
  23207. }
  23208. ),
  23209. h.prototype.initSizedTexture2D = function(e, t, i) {
  23210. var n = this.renderer
  23211. , r = n.context
  23212. , o = n.state
  23213. , a = new M.Texture(null);
  23214. !(a.flipY = !1) !== i && (i = !1),
  23215. a.generateMipmaps = i;
  23216. var s = n.paramThreeToGL(a.format)
  23217. , l = n.paramThreeToGL(a.type)
  23218. , c = n.properties.get(a)
  23219. , h = r.createTexture();
  23220. o.bindTexture(r.TEXTURE_2D, h),
  23221. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23222. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23223. a.wrapS = t,
  23224. a.wrapT = t;
  23225. var u = n.paramThreeToGL(t);
  23226. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23227. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23228. i ? (a.magFilter = M.LinearFilter,
  23229. a.minFilter = M.LinearMipMapLinearFilter,
  23230. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23231. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23232. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23233. a.minFilter = M.LinearFilter,
  23234. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23235. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23236. o.bindTexture(r.TEXTURE_2D, null),
  23237. c.__webglTexture = h,
  23238. a
  23239. }
  23240. ,
  23241. h.prototype.initSizedCubeMap = function(e, t) {
  23242. var i = this.renderer
  23243. , n = i.context
  23244. , r = i.state
  23245. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23246. o.flipY = !1,
  23247. o.generateMipmaps = t;
  23248. var a = i.paramThreeToGL(o.format)
  23249. , s = i.paramThreeToGL(o.type)
  23250. , l = i.properties.get(o)
  23251. , c = n.createTexture();
  23252. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23253. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23254. for (var h = 0; h < 6; h++)
  23255. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23256. return t ? (o.magFilter = M.LinearFilter,
  23257. o.minFilter = M.LinearMipMapLinearFilter,
  23258. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23259. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23260. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23261. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23262. o.minFilter = M.LinearFilter,
  23263. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23264. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23265. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23266. l.__image__webglTextureCube = c,
  23267. o
  23268. }
  23269. ,
  23270. h.prototype.deallocateCubeTexture = function(e) {
  23271. var t = this.renderer
  23272. , i = t.context
  23273. , n = t.properties.get(e);
  23274. i.deleteTexture(n.__image__webglTextureCube)
  23275. }
  23276. ,
  23277. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23278. var a = this.renderer
  23279. , s = a.context
  23280. , l = a.state
  23281. , c = a.properties.get(t);
  23282. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23283. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23284. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23285. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23286. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23287. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23288. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23289. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23290. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23291. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23292. l.bindTexture(s.TEXTURE_2D, null)
  23293. }
  23294. ,
  23295. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23296. var s = this.renderer
  23297. , l = s.context
  23298. , c = s.state
  23299. , h = s.properties.get(t);
  23300. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23301. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23302. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23303. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23304. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23305. }
  23306. ,
  23307. h.prototype.rebuildMipMaps2D = function(e) {
  23308. var t = this.renderer
  23309. , i = t.context
  23310. , n = t.state;
  23311. t.properties.get(e),
  23312. i.generateMipmap(i.TEXTURE_2D),
  23313. n.bindTexture(i.TEXTURE_2D, null)
  23314. }
  23315. ,
  23316. h.prototype.rebuildMipMaps3D = function(e) {
  23317. var t = this.renderer
  23318. , i = t.context
  23319. , n = t.state
  23320. , r = t.properties.get(e);
  23321. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23322. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23323. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23324. }
  23325. ,
  23326. h.prototype.renderToCubeMap = (P = !1,
  23327. F = N = D = L = O = null,
  23328. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23329. this.renderer.context,
  23330. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23331. (O = new M.Scene).add(L),
  23332. D = new M.ShaderMaterial({
  23333. uniforms: {
  23334. tDiffuse: {
  23335. type: "t",
  23336. value: null
  23337. },
  23338. alpha: {
  23339. type: "f",
  23340. value: 1
  23341. }
  23342. },
  23343. vertexShader: R.basicTextured.vertexShader,
  23344. fragmentShader: R.basicTextured.fragmentShader,
  23345. depthWrite: !1,
  23346. depthTest: !1,
  23347. side: M.DoubleSide
  23348. }),
  23349. N = new M.PlaneBufferGeometry(1,1),
  23350. (F = new M.Mesh(N,D)).position.z = 0,
  23351. O.add(F),
  23352. P = !0);
  23353. var m = N.getAttribute("uv");
  23354. m.setDynamic(!0),
  23355. m.needsUpdate = !0;
  23356. var v = m.array
  23357. , y = r / i
  23358. , A = o / n
  23359. , C = a / i
  23360. , I = s / n;
  23361. v[0] = y,
  23362. v[1] = A + I,
  23363. v[2] = y + C,
  23364. v[3] = A + I,
  23365. v[4] = y,
  23366. v[5] = A,
  23367. v[6] = y + C,
  23368. v[7] = A;
  23369. var E = N.getAttribute("position");
  23370. E.setDynamic(!0),
  23371. E.needsUpdate = !0;
  23372. var _ = E.array
  23373. , b = l / t.width - .5
  23374. , w = c / t.height - .5
  23375. , T = h / t.width
  23376. , x = u / t.height;
  23377. _[0] = b,
  23378. _[1] = w + x,
  23379. _[3] = b + T,
  23380. _[4] = w + x,
  23381. _[6] = b,
  23382. _[7] = w,
  23383. _[9] = b + T,
  23384. _[10] = w,
  23385. this.renderer.properties.get(e),
  23386. D.uniforms.tDiffuse.value = e,
  23387. D.blending = p || M.NoBlending,
  23388. D.transparent = !!f,
  23389. null != g || (g = 1),
  23390. D.uniforms.alpha.value = g,
  23391. D.needUpdate = !0,
  23392. t.activeCubeFace = d,
  23393. t.viewport.set(0, 0, t.width, t.height);
  23394. var S = this.renderer.autoClear;
  23395. this.renderer.autoClear = !1,
  23396. this.renderer.render(O, L, t, !1),
  23397. this.renderer.autoClear = S
  23398. }
  23399. ),
  23400. h.prototype.copyCubeMap = (g = !1,
  23401. C = A = y = v = m = null,
  23402. I = new M.Euler,
  23403. new M.Vector3,
  23404. function(e, t, i, n, r, o, a, s, l) {
  23405. this.renderer,
  23406. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23407. (m = new M.Scene).add(v),
  23408. y = new M.ShaderMaterial({
  23409. uniforms: {
  23410. tDiffuse: {
  23411. type: "t",
  23412. value: null
  23413. },
  23414. alpha: {
  23415. type: "f",
  23416. value: 1
  23417. }
  23418. },
  23419. vertexShader: R.copyCubeMap.vertexShader,
  23420. fragmentShader: R.copyCubeMap.fragmentShader,
  23421. depthWrite: !1,
  23422. depthTest: !1,
  23423. side: M.DoubleSide
  23424. }),
  23425. A = new M.BoxGeometry(2,2,2),
  23426. C = new M.Mesh(A,y),
  23427. m.add(C),
  23428. g = !0);
  23429. for (var c = 0; c < 6; c++)
  23430. h.getCubeOrientationForCubeFace(c, I),
  23431. C.rotation.copy(I),
  23432. C.matrixWorldNeedsUpdate = !0,
  23433. C.updateMatrixWorld(),
  23434. y.uniforms.tDiffuse.value = e,
  23435. y.blending = a || M.NoBlending,
  23436. y.transparent = !!s,
  23437. null != l || (l = 1),
  23438. y.uniforms.alpha.value = l,
  23439. y.needUpdate = !0,
  23440. t.activeCubeFace = c,
  23441. t.viewport.set(0, 0, r, o),
  23442. this.renderer.render(m, v, t, !1)
  23443. }
  23444. ),
  23445. h.getLookAtForCubeFace = function(e, t) {
  23446. switch (e) {
  23447. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23448. t.set(1, 0, 0);
  23449. break;
  23450. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23451. t.set(-1, 0, 0);
  23452. break;
  23453. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23454. t.set(0, 1, 0);
  23455. break;
  23456. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23457. t.set(0, -1, 0);
  23458. break;
  23459. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23460. t.set(0, 0, 1);
  23461. break;
  23462. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23463. t.set(0, 0, -1)
  23464. }
  23465. }
  23466. ,
  23467. h.getCubeOrientationForCubeFace = function(e, t) {
  23468. switch (e) {
  23469. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23470. t.set(0, -Math.PI / 2, 0);
  23471. break;
  23472. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23473. t.set(0, Math.PI / 2, 0);
  23474. break;
  23475. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23476. t.set(Math.PI / 2, Math.PI, 0);
  23477. break;
  23478. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23479. t.set(-Math.PI / 2, Math.PI, 0);
  23480. break;
  23481. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23482. t.set(0, -Math.PI, 0);
  23483. break;
  23484. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23485. t.set(0, 0, 0)
  23486. }
  23487. }
  23488. ,
  23489. t.exports = h
  23490. }
  23491. , {
  23492. "../enum/GLCubeFaces": 25,
  23493. "../enum/GLTextureType": 26,
  23494. "../enum/SceneRendererEvents": 43,
  23495. "../exception/BasicException": 55,
  23496. "../exception/RendererCreationException": 57,
  23497. "../settings": 166,
  23498. "../shaders": 167,
  23499. "../util/browser": 182,
  23500. events: 202,
  23501. three: 217
  23502. }],
  23503. 159: [function(e, t, i) {
  23504. "use strict";
  23505. function n(e) {
  23506. this.messenger = new a(e),
  23507. this.clientKey = null
  23508. }
  23509. var o = e("../util/ajax")
  23510. , r = e("./PostMessageType")
  23511. , a = e("./postmessage")
  23512. , s = e("./VersionInfo")
  23513. , l = e("events").EventEmitter
  23514. , c = window.location.origin + "/api/v1/user/";
  23515. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23516. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23517. }
  23518. ,
  23519. n.prototype.waitForConnection = function() {
  23520. return new Promise(function(t, i) {
  23521. this.messenger.on(r.CONNECT, function(e) {
  23522. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23523. }
  23524. .bind(this))
  23525. }
  23526. .bind(this))
  23527. }
  23528. ,
  23529. n.prototype.onConnectionReceived = function(i) {
  23530. return this.messenger.setTarget(i.source, i.origin),
  23531. this.verifyConnection(i).then(function(e, t) {
  23532. this.messenger.send({
  23533. type: r.ACCEPT,
  23534. toId: i.fromId,
  23535. warning: t
  23536. }),
  23537. this.clientKey = e,
  23538. this.messenger.removeAllListeners(r.CONNECT),
  23539. this.bindEvents()
  23540. }
  23541. .bind(this), function(e) {
  23542. this.messenger.send({
  23543. type: r.REJECT,
  23544. toId: i.fromId,
  23545. reason: e
  23546. }),
  23547. this.messenger.setTarget()
  23548. }
  23549. .bind(this))
  23550. }
  23551. ,
  23552. n.prototype.verifyConnection = function(r) {
  23553. return new Promise(function(e, t) {
  23554. var i;
  23555. if (s.isDeprecated(r.sdkVersion))
  23556. i = "这个版本正在被弃用";
  23557. else if (!s.isSupported(r.sdkVersion))
  23558. return t("不支持此版本的SDK");
  23559. var n = {
  23560. cache: !1,
  23561. headers: {
  23562. "X-port-Application-Key": r.applicationKey,
  23563. "X-port-Referrer": r.origin
  23564. }
  23565. };
  23566. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23567. }
  23568. )
  23569. }
  23570. ,
  23571. n.prototype.onMessageReceived = function(t) {
  23572. if (this.validateClientApplicationKey(t.applicationKey)) {
  23573. var i = this;
  23574. t.onDone = function(e) {
  23575. e.toId = t.fromId,
  23576. e.uid = t.uid,
  23577. e.type = r.RESPONSE,
  23578. i.messenger.send(e)
  23579. }
  23580. ,
  23581. this.emit(r.ACTION, t)
  23582. }
  23583. }
  23584. ,
  23585. n.prototype.validateClientApplicationKey = function(e) {
  23586. return this.clientKey === e
  23587. }
  23588. ,
  23589. n.prototype.sendEvent = function(e, t) {
  23590. this.messenger.send({
  23591. type: r.EVENT,
  23592. eventType: e,
  23593. eventData: t
  23594. })
  23595. }
  23596. ,
  23597. t.exports = n
  23598. }
  23599. , {
  23600. "../util/ajax": 181,
  23601. "./PostMessageType": 160,
  23602. "./VersionInfo": 163,
  23603. "./postmessage": 165,
  23604. events: 202
  23605. }],
  23606. 160: [function(e, t, i) {
  23607. "use strict";
  23608. t.exports = Object.freeze({
  23609. CONNECT: "postmessage.connect",
  23610. ACCEPT: "postmessage.accept",
  23611. REJECT: "postmessage.reject",
  23612. ACTION: "postmessage.action",
  23613. RESPONSE: "postmessage.response",
  23614. EVENT: "postmessage.event"
  23615. })
  23616. }
  23617. , {}],
  23618. 161: [function(e, t, i) {
  23619. "use strict";
  23620. t.exports = Object.freeze({
  23621. MOVE: "sdk.move",
  23622. ENTER_PANO: "sdk.enterpano",
  23623. MODEL_LOADED: "sdk.modelloaded"
  23624. })
  23625. }
  23626. , {}],
  23627. 162: [function(e, t, i) {
  23628. "use strict";
  23629. t.exports = Object.freeze({
  23630. FLY: "transition.fly",
  23631. FADEOUT: "transition.fade",
  23632. INSTANT: "transition.instant"
  23633. })
  23634. }
  23635. , {}],
  23636. 163: [function(e, t, i) {
  23637. "use strict";
  23638. t.exports = {
  23639. current: "1.0",
  23640. supported: ["1.0"],
  23641. deprecated: [],
  23642. isSupported: function(e) {
  23643. return -1 !== this.supported.indexOf(e)
  23644. },
  23645. isDeprecated: function(e) {
  23646. return -1 !== this.deprecated.indexOf(e)
  23647. },
  23648. isValid: function(e) {
  23649. return this.isSupported(e) || this.isDeprecated(e)
  23650. }
  23651. }
  23652. }
  23653. , {}],
  23654. 164: [function(q, X, e) {
  23655. (function(e) {
  23656. "use strict";
  23657. function r(e, t, i) {
  23658. e = e && e.toLowerCase().trim();
  23659. var n = new C.UP.clone
  23660. , r = Math.PI / 3
  23661. , o = Math.PI / 2;
  23662. switch (e) {
  23663. case "left":
  23664. i.copy(t),
  23665. i.applyAxisAngle(n, o);
  23666. break;
  23667. case "right":
  23668. i.copy(t),
  23669. i.applyAxisAngle(n, -o);
  23670. break;
  23671. case "forwardleft":
  23672. i.copy(t),
  23673. i.applyAxisAngle(n, r);
  23674. break;
  23675. case "forwardright":
  23676. i.copy(t),
  23677. i.applyAxisAngle(n, -r);
  23678. break;
  23679. case "forward":
  23680. default:
  23681. i.copy(t)
  23682. }
  23683. return i
  23684. }
  23685. function o(e, t) {
  23686. if (e) {
  23687. var i = {
  23688. pano: e,
  23689. lookAtPoint: null,
  23690. duration: null,
  23691. maxDistanceOverride: null,
  23692. skipWarpingCheck: !1
  23693. };
  23694. this.player.flyToPano(i, function() {
  23695. t && t({
  23696. success: !0,
  23697. message: "Transition complete."
  23698. })
  23699. })
  23700. } else
  23701. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23702. t && t({
  23703. success: !1,
  23704. error: "Unable to find pano."
  23705. })
  23706. }
  23707. function a(e, t) {
  23708. t.copy(C.FORWARD),
  23709. e.getDirection(t)
  23710. }
  23711. function c(i) {
  23712. return {
  23713. panos: i.panos.list.map(function(e) {
  23714. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23715. return {
  23716. uuid: e.id,
  23717. aligned: e.alignmentType === g.ALIGNED,
  23718. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23719. position: function(e) {
  23720. return e.alignmentType !== g.ALIGNED ? null : {
  23721. x: e.position.x,
  23722. y: e.position.y,
  23723. z: e.position.z
  23724. }
  23725. }(e),
  23726. rotation: function(e) {
  23727. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23728. return {
  23729. x: h.Math.radToDeg(t._x),
  23730. y: h.Math.radToDeg(t._y),
  23731. z: h.Math.radToDeg(t._z)
  23732. }
  23733. }(e),
  23734. thumbnail: t
  23735. }
  23736. })
  23737. }
  23738. }
  23739. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  23740. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23741. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23742. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23743. N.angle = 0,
  23744. N.angleTravelled = 0,
  23745. N.playerDirection = new h.Vector3,
  23746. N.lastFacingDirection = new h.Vector3,
  23747. N.onDone = null,
  23748. N.player = null,
  23749. N.start = function(e, t, i, n) {
  23750. N.active = !0,
  23751. e && t && (t = 0),
  23752. N.angle = e || t,
  23753. N.xAngle = e,
  23754. N.yAngle = t,
  23755. N.angleTravelled = 0,
  23756. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23757. i.getDirection(N.playerDirection),
  23758. N.lastFacingDirection.copy(N.playerDirection),
  23759. N.projectVectors(),
  23760. N.onDone = n,
  23761. N.player = i,
  23762. N()
  23763. }
  23764. ,
  23765. N.projectVectors = function() {
  23766. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23767. N.lastFacingDirection.projectOnPlane(C.UP))
  23768. }
  23769. ,
  23770. N), P = (i = new h.Vector3,
  23771. function(e) {
  23772. e ? (i.copy(e.position),
  23773. i.add(e.discPosition),
  23774. s.projectPositionToCanvas(i, this.player.camera, i),
  23775. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23776. }
  23777. ), O = (l = new h.Vector3,
  23778. function(e) {
  23779. var t = this.player.getDirection();
  23780. l.copy(t);
  23781. var i = l.y;
  23782. l.y = 0,
  23783. l.normalize();
  23784. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23785. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23786. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23787. 0;
  23788. this.player.mode === I.DOLLHOUSE && (n = -n);
  23789. var r = function() {
  23790. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23791. }
  23792. .call(this) - .1
  23793. , o = function() {
  23794. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23795. }
  23796. .call(this) + .1
  23797. , a = n + e;
  23798. r < a ? a = r : a < o && (a = o);
  23799. var s = a - n;
  23800. return 0 < e && s < .01 && (s = 0),
  23801. e < 0 && -.01 < s && (s = 0),
  23802. s
  23803. }
  23804. ), L = (t = new h.Euler,
  23805. function(e) {
  23806. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23807. {
  23808. position: {
  23809. x: e.position.x,
  23810. y: e.position.y,
  23811. z: e.position.z
  23812. },
  23813. rotation: {
  23814. x: h.Math.radToDeg(t.x),
  23815. y: h.Math.radToDeg(t.y),
  23816. z: 0
  23817. },
  23818. pano: e.currentPano ? e.currentPano.id : null,
  23819. mode: e.mode
  23820. }
  23821. }
  23822. ), D = null;
  23823. function N() {
  23824. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23825. N.player.getDirection(N.playerDirection),
  23826. N.projectVectors();
  23827. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23828. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23829. N.onDone && (0,
  23830. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23831. window.setTimeout(N, 4))
  23832. }
  23833. X.exports = {
  23834. init: function(e, t, i, n, r) {
  23835. Y.init(e, t, i, r),
  23836. D = new Promise(function(e, t) {
  23837. i.on(_.Ready, function() {
  23838. e()
  23839. })
  23840. }
  23841. .bind(this));
  23842. var o = new u(window)
  23843. , a = o.waitForConnection();
  23844. a.then(function(e) {
  23845. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23846. });
  23847. var s, l = (s = Date.now(),
  23848. function() {
  23849. if (!(Date.now() - s < 100)) {
  23850. var e = L(i);
  23851. o.sendEvent(b.MOVE, {
  23852. state: e
  23853. }),
  23854. s = Date.now()
  23855. }
  23856. }
  23857. );
  23858. i.on(_.Move, l),
  23859. i.on(_.ViewChanged, l),
  23860. n.on(p.ActiveModelChanged, function(e) {
  23861. function t(e) {
  23862. var t, i = e.newPano.id;
  23863. e.oldPano && (t = e.oldPano.id),
  23864. i !== t && o.sendEvent(b.ENTER_PANO, {
  23865. oldPano: t,
  23866. newPano: i
  23867. })
  23868. }
  23869. var i = e.model
  23870. , n = e.oldModel;
  23871. Y.model = i,
  23872. a.then(function() {
  23873. o.sendEvent(b.MODEL_LOADED, {
  23874. metadata: c(i)
  23875. })
  23876. }),
  23877. n && n.panos.forEach(function(e) {
  23878. e.removeEventListener("enter", t)
  23879. }),
  23880. i.panos.forEach(function(e) {
  23881. e.on("enter", t)
  23882. })
  23883. })
  23884. }
  23885. };
  23886. var F, B, V, k, U, H, z, G, W, j, Y = {
  23887. director: null,
  23888. player: null,
  23889. controls: null,
  23890. sceneRenderer: null,
  23891. model: null,
  23892. init: function(e, t, i, n) {
  23893. this.director = e,
  23894. this.player = i,
  23895. this.controls = t,
  23896. this.sceneRenderer = n
  23897. },
  23898. handleToObject: {},
  23899. objectToHandle: {},
  23900. handleCount: 0,
  23901. onMessageReceive: function(e) {
  23902. if (e) {
  23903. var t = e.targetFunction
  23904. , i = e.params
  23905. , n = e.onDone;
  23906. t && this[t] && this[t](i, n)
  23907. }
  23908. },
  23909. waitForInit: function(e, t) {
  23910. D.then(t.bind({
  23911. success: !0,
  23912. message: "Init complete."
  23913. }))
  23914. },
  23915. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23916. j = new h.Quaternion,
  23917. function(e, t) {
  23918. var i = e.pano
  23919. , n = e.rotation
  23920. , r = e.transition;
  23921. if (!this.model)
  23922. return t({
  23923. success: !1,
  23924. error: "The model has not been loaded yet"
  23925. });
  23926. var o = this.model.panos.get(i);
  23927. if (!o)
  23928. return t({
  23929. success: !1,
  23930. error: i + " does not exist in this model"
  23931. });
  23932. if (!n)
  23933. return t({
  23934. sucess: !1,
  23935. erorr: n + " is not a valid rotation"
  23936. });
  23937. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23938. console.log(n.z);
  23939. var a = {
  23940. success: !0,
  23941. message: i
  23942. };
  23943. if (r === v.FADEOUT)
  23944. j.setFromEuler(W),
  23945. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23946. else {
  23947. var s, l;
  23948. r === v.INSTANT && (l = s = 0);
  23949. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23950. this.player.flyToPano({
  23951. pano: o,
  23952. lookAtPoint: c,
  23953. duration: s,
  23954. aimDuration: l
  23955. }, t.bind(this, a))
  23956. }
  23957. }
  23958. ),
  23959. moveInDirection: function(e, t) {
  23960. var i = e.direction;
  23961. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23962. void (t && t({
  23963. success: !1,
  23964. error: "Invalid direction."
  23965. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23966. t(e ? {
  23967. success: !0,
  23968. message: "moved " + i
  23969. } : {
  23970. success: !1,
  23971. error: "Cannot move in direction: " + i
  23972. })
  23973. })
  23974. },
  23975. getPose: function(e, t) {
  23976. return this.player.camera.position,
  23977. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23978. t({
  23979. success: !0,
  23980. message: L(this.player)
  23981. })
  23982. },
  23983. takeScreenShot: (z = new h.PerspectiveCamera,
  23984. G = new h.WebGLRenderTarget,
  23985. function(e, t) {
  23986. if (!e.resolution)
  23987. return t({
  23988. success: !1,
  23989. error: "An invalid resolution was specified"
  23990. });
  23991. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23992. var i = this.sceneRenderer.renderer.getSize();
  23993. e.resolution.width = i.width,
  23994. e.resolution.height = i.height
  23995. }
  23996. z.layers.set(T.DEFAULT),
  23997. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23998. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23999. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24000. var n = e.resolution.width
  24001. , r = e.resolution.height
  24002. , o = n / r;
  24003. z.position.copy(this.sceneRenderer.camera.position),
  24004. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24005. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24006. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24007. G.setSize(n, r),
  24008. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24009. var a = new Uint8Array(n * r * 4);
  24010. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24011. var s = S.encode({
  24012. data: a,
  24013. width: n,
  24014. height: r,
  24015. heading: 180,
  24016. pitch: 0
  24017. }, {
  24018. quality: 75,
  24019. flipY: !0
  24020. });
  24021. t({
  24022. success: !0,
  24023. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24024. })
  24025. }
  24026. ),
  24027. findRankedPano: (U = new h.Vector3,
  24028. H = new h.Vector3,
  24029. function(e, t) {
  24030. a(this.player, H),
  24031. r(t, H, U);
  24032. var i = this.player.rankedPanoInDirection(e, U);
  24033. if (i) {
  24034. var n = this.objectToHandle[i.id];
  24035. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24036. this.handleToObject[n] = i),
  24037. n
  24038. }
  24039. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24040. -1
  24041. }
  24042. ),
  24043. findRankedtag: (V = new h.Vector3,
  24044. k = new h.Vector3,
  24045. function(e, t) {
  24046. a(this.player, k),
  24047. r(t, k, V);
  24048. var i = this.player.rankedtagInDirection(e, V);
  24049. if (i) {
  24050. var n = this.objectToHandle[i.sid];
  24051. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24052. this.handleToObject[n] = i),
  24053. n
  24054. }
  24055. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24056. -1
  24057. }
  24058. ),
  24059. clickNearesttag: function(e) {
  24060. this.clickRankedtag(0, e)
  24061. },
  24062. clickRankedtag: function(e, t) {
  24063. var i = function(e, t) {
  24064. var i = this.findRankedtag(e, t);
  24065. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24066. null)
  24067. }
  24068. .call(this, e, t);
  24069. i && P.call(this, i)
  24070. },
  24071. clickNearestPano: function(e, t) {
  24072. this.clickRankedPano(0, e, t)
  24073. },
  24074. clickRankedPano: function(e, t, i) {
  24075. var n = function(e, t) {
  24076. var i = this.findRankedPano(e, t);
  24077. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24078. null)
  24079. }
  24080. .call(this, e, t);
  24081. n ? o.call(this, n, i) : i(null)
  24082. },
  24083. clickPano: function(e, t) {
  24084. var i = this.handleTable[e];
  24085. i ? o.call(this, i, t) : t(null)
  24086. },
  24087. rotateDirection: function(e, t) {
  24088. var i = e.direction
  24089. , n = e.angle;
  24090. if (!R.active) {
  24091. var r = 0
  24092. , o = 0
  24093. , a = 0
  24094. , s = 0;
  24095. if (!n || isNaN(n))
  24096. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24097. void (t && t({
  24098. success: !1,
  24099. error: "Invalid rotation angle."
  24100. }));
  24101. if (this.player.mode === I.TRANSITIONING)
  24102. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24103. void (t && t({
  24104. success: !1,
  24105. error: "Cannot rotate while transitioning"
  24106. }));
  24107. if (i === m.RIGHT || i === m.LEFT)
  24108. i === m.RIGHT && (n = -n),
  24109. r = 0 < n ? -1 : 1,
  24110. a = n;
  24111. else {
  24112. if (i !== m.UP && i !== m.DOWN)
  24113. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24114. void (t && t({
  24115. success: !1,
  24116. error: "Invalid direction for rotation."
  24117. }));
  24118. if (this.player.mode === I.FLOORPLAN)
  24119. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24120. void (t && t({
  24121. success: !1,
  24122. error: "Cannot rotate " + i + " in floorplan mode"
  24123. }));
  24124. if (i === m.DOWN && (n = -n),
  24125. 0 === (n = O.call(this, n)))
  24126. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24127. void (t && t({
  24128. success: !1,
  24129. error: "Already at maximum rotation in direction: " + i
  24130. }));
  24131. o = 0 < n ? 1 : -1,
  24132. s = n
  24133. }
  24134. var l = n;
  24135. n = h.Math.degToRad(n),
  24136. a = h.Math.degToRad(a),
  24137. s = h.Math.degToRad(s);
  24138. var c = this.controls.activeControl;
  24139. c.startRotating(r, o),
  24140. R.start(a, s, this.player, function() {
  24141. c.stopRotating(!0),
  24142. t && t({
  24143. success: !0,
  24144. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24145. })
  24146. })
  24147. }
  24148. },
  24149. rotate: (F = new h.Vector3,
  24150. B = new h.Vector3,
  24151. function(e, t) {
  24152. var i = e.xAngle
  24153. , n = e.yAngle;
  24154. if (!R.active) {
  24155. if (i = i || 0,
  24156. n = n || 0,
  24157. isNaN(i) || isNaN(n))
  24158. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24159. void (t && t({
  24160. success: !1,
  24161. error: "Invalid rotation angle."
  24162. }));
  24163. if (this.player.mode === I.TRANSITIONING)
  24164. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24165. void (t && t({
  24166. success: !1,
  24167. error: "Cannot rotate while transitioning"
  24168. }));
  24169. Math.abs(i) < .01 && (i = 0),
  24170. Math.abs(n) < .01 && (n = 0);
  24171. var r = n;
  24172. n = O.call(this, n);
  24173. var o = 0 < r ? "UP" : "DOWN";
  24174. if (!(i = -i) && r && !n)
  24175. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24176. void (t && t({
  24177. success: !1,
  24178. error: "Already at maximum rotation in direction: " + o
  24179. }));
  24180. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24181. var a = n;
  24182. n = h.Math.degToRad(n),
  24183. i = h.Math.degToRad(i),
  24184. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24185. this.player.getDirection(F),
  24186. B.copy(F).applyAxisAngle(C.UP, i),
  24187. B.applyAxisAngle(C.RIGHT, n);
  24188. var s = (F.angleTo(B),
  24189. 0 < i ? -1 : i < 0 ? 1 : 0)
  24190. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24191. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24192. var c = this.controls.activeControl;
  24193. c.startRotating(s, l),
  24194. R.start(i, n, this.player, function() {
  24195. c.stopRotating(!0),
  24196. t && t({
  24197. success: !0,
  24198. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24199. })
  24200. })
  24201. }
  24202. }
  24203. ),
  24204. panCamera: function(e, i) {
  24205. function t(e) {
  24206. switch (r.removeAllListeners(w.AutoPanComplete),
  24207. r.removeAllListeners(w.AutoPanInterrupt),
  24208. r.removeAllListeners(w.AutoPanClamped),
  24209. e) {
  24210. case w.AutoPanInterrupt:
  24211. i({
  24212. success: !0,
  24213. message: "Camera panning interrupted."
  24214. });
  24215. break;
  24216. case w.AutoPanClamped:
  24217. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24218. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24219. return void i({
  24220. success: !1,
  24221. error: "Already at edge of current model bounds."
  24222. });
  24223. var t = "The view point is outside the bounds for the current model. ";
  24224. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24225. console.warn(t)
  24226. }
  24227. case w.AutoPanComplete:
  24228. i({
  24229. success: !0,
  24230. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24231. })
  24232. }
  24233. }
  24234. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24235. return i({
  24236. success: !1,
  24237. error: "Camera panning is not available in the current mode: " + this.player.mode
  24238. });
  24239. var n = e.position
  24240. , r = this.player.control;
  24241. r.setAutoPanPosition(n.x, n.z),
  24242. r.autoPan = !0;
  24243. var o = function(e, t) {
  24244. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24245. };
  24246. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24247. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24248. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24249. },
  24250. click: function(e, t) {
  24251. var i = e.x
  24252. , n = e.y;
  24253. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24254. n = n / 100 * $("#player").height()),
  24255. this.player.handleInputStart(i, n),
  24256. this.player.updateIntersect(),
  24257. this.player.handleInputEnd(i, n)
  24258. },
  24259. mouseOver: function(e, t) {
  24260. var i = e.x
  24261. , n = e.y;
  24262. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24263. n = n / 100 * $("#player").height()),
  24264. this.player.handleInputMove(i, n),
  24265. this.player.updateIntersect()
  24266. },
  24267. moveToMode: function(e, t) {
  24268. function i(e) {
  24269. t(e ? {
  24270. success: !1,
  24271. error: "Failed to load new mode: " + e
  24272. } : {
  24273. success: !0,
  24274. message: "Moved to new mode: " + n
  24275. })
  24276. }
  24277. var n = e.mode;
  24278. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24279. i()
  24280. }, function(e) {
  24281. i(e)
  24282. }) : t({
  24283. success: !1,
  24284. error: "Invalid mode selection"
  24285. })
  24286. }
  24287. }
  24288. }
  24289. ).call(this, "/js/sdk/automation.js")
  24290. }
  24291. , {
  24292. "../constants": 8,
  24293. "../enum/AlignmentType": 17,
  24294. "../enum/ControlEvents": 21,
  24295. "../enum/Direction": 22,
  24296. "../enum/GLCubeFaces": 25,
  24297. "../enum/Keys": 30,
  24298. "../enum/ModelManagerEvents": 33,
  24299. "../enum/PlayerEvents": 40,
  24300. "../enum/RenderLayers": 41,
  24301. "../enum/Vectors": 50,
  24302. "../enum/Viewmode": 51,
  24303. "../enum/WarpStyle": 52,
  24304. "../lib/jpeg_encoder": 94,
  24305. "../sdk/SdkEvents": 161,
  24306. "../settings": 166,
  24307. "../util/common": 185,
  24308. "../util/logger": 189,
  24309. "../util/math": 190,
  24310. "../util/panorama": 191,
  24311. "./ApiHost": 159,
  24312. "./PostMessageType": 160,
  24313. "./TransitionStyles": 162,
  24314. three: 217
  24315. }],
  24316. 165: [function(e, t, i) {
  24317. "use strict";
  24318. function n(e) {
  24319. this.sourceWindow = e,
  24320. this.targetWindow = null,
  24321. this.targetOrigin = null,
  24322. this.id = Math.floor(1e5 * Math.random()),
  24323. this.bindEvents()
  24324. }
  24325. var r = e("./PostMessageType")
  24326. , o = e("events").EventEmitter;
  24327. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24328. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24329. }
  24330. ,
  24331. n.prototype.setTarget = function(e, t) {
  24332. this.targetWindow = e,
  24333. this.targetOrigin = t
  24334. }
  24335. ,
  24336. n.prototype.onPostmessageReceived = function(e) {
  24337. var t = e.origin || e.originalEvent.origin
  24338. , i = e.source;
  24339. switch (e.data.type) {
  24340. case r.CONNECT:
  24341. break;
  24342. case r.RESPONSE:
  24343. if (this.id !== e.data.toId)
  24344. return;
  24345. default:
  24346. if (!this.validateMessageOrigin(t))
  24347. return
  24348. }
  24349. var n = e.data;
  24350. n.source = i,
  24351. n.origin = t,
  24352. n.timestamp = Date.now(),
  24353. this.emit(e.data.type, n)
  24354. }
  24355. ,
  24356. n.prototype.validateMessageOrigin = function(e) {
  24357. return "*" === this.targetOrigin || e === this.targetOrigin
  24358. }
  24359. ,
  24360. n.prototype.send = function(e) {
  24361. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24362. this.targetWindow.postMessage(e, this.targetOrigin))
  24363. }
  24364. ,
  24365. t.exports = n
  24366. }
  24367. , {
  24368. "./PostMessageType": 160,
  24369. events: 202
  24370. }],
  24371. 166: [function(e, t, i) {
  24372. "use strict";
  24373. var n = e("three")
  24374. , r = e("./util/browser")
  24375. , o = e("./enum/Viewmode")
  24376. , a = e("./enum/VROption")
  24377. , s = e("./enum/Colors")
  24378. , l = e("./enum/WarpStyle")
  24379. , c = e("./util/easing")
  24380. , h = e("./util/common")
  24381. , u = e("./util/showcase")
  24382. , d = e("./constants")
  24383. , p = {
  24384. debug: !1,
  24385. version: "2.25.6-0-gd87e5b1",
  24386. languageTag: r.valueFromHash("lang", null),
  24387. pageTitle: "四维虚拟漫游",
  24388. authorizationHeader: u.getAuthorizationHeader(),
  24389. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24390. logLevel: r.valueFromHash("log", 2),
  24391. skyboxRadius: 2500,
  24392. modelBoundsPadding: 5,
  24393. showNeighbors: !1,
  24394. brand: r.valueFromHash("brand", !0),
  24395. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24396. startHighlights: r.valueFromHash("hl", -1),
  24397. specialEdition: r.valueFromHash("bn", 0),
  24398. useWheel: r.valueFromHash("wh", !0),
  24399. crossOrigin: "anonymous",
  24400. fancierTransition: !1,
  24401. wireframe: !1,
  24402. skyboxWireframe: !1,
  24403. modelAlpha: 1,
  24404. highlightPanoSelection: !1,
  24405. showSweeps: !0,
  24406. showSkyboxes: !1,
  24407. showMesh: !0,
  24408. showFloors: !1,
  24409. showFloorDuration: 300,
  24410. showFloorDelay: 300,
  24411. hideFloorDuration: 300,
  24412. hideFloorDelay: 0,
  24413. reticuleOpacityTransitionTime: 250,
  24414. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24415. markerOpacityTransitionTime: 500,
  24416. guiAnimationSpeed: 250,
  24417. highlightAnimationDuration: 500,
  24418. modelComponentLoadSpinnerDelay: 150,
  24419. captureErrors: !1,
  24420. maxMobileTextures: 6,
  24421. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24422. startupFlyinDelay: 3e3,
  24423. dollhouseDefault: {
  24424. minDistance: 1,//15, //编辑页面给近一些
  24425. maxDistance: 50,
  24426. minPolarAngle: n.Math.degToRad(10),
  24427. maxPolarAngle: n.Math.degToRad(90)
  24428. },
  24429. hideReticuleTimeout: 1e3,
  24430. analytics: {
  24431. inactivityThreshold: 30,
  24432. sessionTrackingRate: .15,
  24433. maxTrackedErrors: 20,
  24434. sessionDurationPingFrequency: 10,
  24435. sessionDurationTimeout: 15
  24436. },
  24437. flydown: {
  24438. movementEasing: "easeInOutQuad",
  24439. movementDelay: .001,
  24440. rotationEasing: "easeInOutQuad",
  24441. rotationDelay: .5,
  24442. modelTextureDelay: .75,
  24443. skyboxDelay: .75
  24444. },
  24445. transition: {
  24446. flySpeed: .001,
  24447. flyTime: 750,
  24448. flytimeMaxDistanceThreshold: 5,
  24449. flytimeDistanceMultiplier: 150,
  24450. aimTime: 1500,
  24451. aimSlowFactor: 1.5,
  24452. blur: .8,
  24453. movementEasing: "easeInOutQuad",
  24454. blendEasing: "easeInOutQuad",
  24455. fastForwardFactor: 3
  24456. },
  24457. show360Views: {
  24458. enabled: !0,
  24459. transitionTime: 1e3
  24460. },
  24461. quickstart: {
  24462. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24463. animation: 1400,
  24464. showTextDelay: 500,
  24465. fadeOutDelay: 3e3,
  24466. fovChange: 10
  24467. },
  24468. appConfig: {
  24469. webvr_version: null,
  24470. segment_key: null,
  24471. embedly_key: null,
  24472. branch_key: null,
  24473. keen_write_key: null,
  24474. keen_project_id: null
  24475. },
  24476. vr: {
  24477. enabled: !0,
  24478. allowWebVR: !1,
  24479. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24480. },
  24481. share: {
  24482. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24483. },
  24484. input: {
  24485. longTapThreshold: 200,
  24486. moveToleranceNDC: .08,
  24487. touchMoveThreshold: 25
  24488. },
  24489. help: {
  24490. modalStayDuration: 600
  24491. },
  24492. immersive: {
  24493. timeToShowAgain: 1250,
  24494. uiStayDuration: 600
  24495. },
  24496. tourInteraction: {
  24497. disabled: "0" === r.valueFromHash("tourcta", null),
  24498. showPauseButton: 1e3,
  24499. showModal: 1500,
  24500. allowNextClick: 200,
  24501. largeModal: "1" === r.valueFromHash("tourcta", null),
  24502. smallModal: "2" === r.valueFromHash("tourcta", null)
  24503. },
  24504. labels: {
  24505. enabled: !1,
  24506. hideUntilStart: !0,
  24507. fadeInDuration: 250,
  24508. fadeInDelay: 250,
  24509. fadeOutDuration: 250,
  24510. fadeOutDelay: 0,
  24511. zoomHideThreshhold: {
  24512. mobile: r.isSmallScreen() ? .45 : .6,
  24513. desktop: 2
  24514. },
  24515. zoomTruncateThreshhold: {
  24516. mobile: r.isSmallScreen() ? .35 : .45,
  24517. desktop: .85
  24518. },
  24519. minLengthForTruncate: 16,
  24520. truncateLength: 12,
  24521. truncateSuffix: "..."
  24522. },
  24523. tags: {
  24524. enabled: r.valueFromHash("mt", 1),
  24525. startup: {
  24526. hideUntilStart: !0,
  24527. fadeInDuration: 500,
  24528. fadeInDelay: 100
  24529. },
  24530. visibility: {
  24531. anyDistance: !0,
  24532. visibleDistance: 8,
  24533. cameraClearance: .1,
  24534. alphaTestLevel: .05,
  24535. hideViaFloor: !0,
  24536. hideOffScreenDisc: !1,
  24537. hideOffScreenObject: !1
  24538. },
  24539. disc: {
  24540. opacity: 1,
  24541. disabledOpacity: .5,
  24542. scale: {
  24543. nearBound: 1.5,
  24544. farBound: 4.8,
  24545. linkFarBound: !1,
  24546. linkPercent: 40,
  24547. maxSize: 80,
  24548. minSize: 40,
  24549. baseViewportSize: 800,
  24550. responsiveness: 100
  24551. }
  24552. },
  24553. pole: {
  24554. enabled: !0,
  24555. height: .5,
  24556. width: 2,
  24557. opacity: .5,
  24558. color: "white"
  24559. },
  24560. navigate: {
  24561. nearestPano: !0,
  24562. lineOfSight: !0,
  24563. reactivate: !0,
  24564. aimAt: "disc",
  24565. tiltTolerance: 25,
  24566. rotateSpeedFactor: .6
  24567. }
  24568. },
  24569. path: {
  24570. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24571. colorUp: s._desat(s.newBlue, .5),
  24572. colorDown: s._darken(s.newBlue, .35),
  24573. opacity: .5,
  24574. style: "ribbon",
  24575. height: .025,
  24576. ribbonWidth: .24,
  24577. outsideHeight: .5,
  24578. waypointRadius: .5,
  24579. waypointIndoorRadius: .24,
  24580. waypointPulse: 1e3,
  24581. typ: l.BLACK,
  24582. meshFree: r.valueFromHash("mf", 1),
  24583. mapGuides: r.valueFromHash("guides", !0),
  24584. fadeInTime: 400,
  24585. fadeOutTime: 300
  24586. },
  24587. warp: {
  24588. nearPanoDist: .1,
  24589. matchCam: !1,
  24590. blur: .33,
  24591. fastTime: 1500,
  24592. teleportTime: 1500,
  24593. outsideTime: 2e3,
  24594. lookAheadMax: .3,
  24595. lookAheadDist: 2.5,
  24596. softPushDist: .37,
  24597. softPushEnd: .3,
  24598. softBendAngle: 8,
  24599. softBendTilt: 4,
  24600. softBendEnd: .3,
  24601. doBurns: !0,
  24602. burnsAngle: 8,
  24603. minBurnsAngle: 35,
  24604. minDownAngle: -35,
  24605. maxTurnPerSec: 280,
  24606. maxAimPerSec: 35,
  24607. minRotation: 12,
  24608. maxAimRotation: 33.2,
  24609. turnFriction: .2,
  24610. flySpeed: .01,
  24611. minWarpTime: 1200,
  24612. warpInterruptionRedirectTime: 500,
  24613. tourStepDelay: r.valueFromHash("st", 0),
  24614. walkDelay: 0,
  24615. walkMaxDist: 50,
  24616. walkMinDist: .8,
  24617. walkSlideShowThreshhold: 3e3,
  24618. walkExtraPanosDistance: .4,
  24619. timePerMeter: 1200,
  24620. motionLeadTime: 5e3,
  24621. movementEasing: "easeInOutQuad",
  24622. blendEasing: "easeInOutQuad",
  24623. showBunny: !1,
  24624. loop: r.valueFromHash("lp", !1),
  24625. auto: r.valueFromHash("ts", -1),
  24626. eOrder: "YXZ",
  24627. stepFactor: .25,
  24628. brakeStrength: 2,
  24629. minBrakeAngle: .1,
  24630. maxBrakeAngle: 1.8,
  24631. climbEffort: 4
  24632. },
  24633. rotationFriction: .05,
  24634. rotationAccelerationInside: 4.5,
  24635. rotationAccelerationOutside: .15,
  24636. rotationAfterMoveMultiplier: 40,
  24637. rotationAfterMoveHistoryCount: 5,
  24638. panFriction: .09,
  24639. panAccelerationOutside: 60,
  24640. onload: r.valueFromHash("onload", o.PANORAMA),
  24641. zoomNearLimit: .1,
  24642. zoomFarLimit: 10,
  24643. navigation: {
  24644. panoScores: !1,
  24645. mouseDirection: !0,
  24646. filterStrictness: .75,
  24647. angleFactor: -30,
  24648. directionFactor: 10,
  24649. distanceFactor: -1,
  24650. optionalityFactor: 3
  24651. },
  24652. sdkInit: !1,
  24653. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24654. console: r.valueFromHash("console", !1),
  24655. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24656. panoramaNeighbourMaxDistance: 5,
  24657. panoFloorClickRadius: .35,
  24658. showScreenshotLocations: !1,
  24659. showAxis: !1,
  24660. showNeighbourRaycasts: !1,
  24661. colorMarkerOnLoad: !1,
  24662. colorMarkerByFloor: !1,
  24663. tiling: {
  24664. panoPreRenderRepeatDelay: 2500,
  24665. panoPreRenderDelay: 500,
  24666. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24667. tilingFlagNames: ["usetiles", "tiles"],
  24668. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24669. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24670. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24671. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24672. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24673. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24674. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24675. customCompression: r.valueFromHash("tilecustcomp", 0),
  24676. mobileHighQualityOverride: 1,
  24677. allowUltraHighResolution: !0
  24678. },
  24679. zoom: {
  24680. enabled: !0,
  24681. forceOff: r.valueFromHash("nozoom", 0),
  24682. overridemax: r.valueFromHash("maxzoom", null),
  24683. overridemin: r.valueFromHash("minzoom", null),
  24684. max: d.highQualityMaxZoom,
  24685. min: 1,
  24686. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24687. activationThreshold: 1.1,
  24688. restoreTime: 500
  24689. },
  24690. profiling: {
  24691. enabled: r.valueFromHash("mem", !1)
  24692. }
  24693. };
  24694. (p = h.deepExtend(p, d, {
  24695. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24696. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24697. panorama: {
  24698. transitionTime: 1e3,
  24699. modelAlpha: 0,
  24700. modelAlphaDelay: p.flydown.modelTextureDelay,
  24701. modelAlphaLength: 1,
  24702. skyboxOpacity: 1,
  24703. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24704. skyboxOpacityLength: .9,
  24705. fovLength: 1,
  24706. fovDelay: 0,
  24707. cameraMatrixDuration: .8,
  24708. cameraMatrixDelay: 0,
  24709. cameraMatrixEase: c.easeInCubic,
  24710. reticuleOpacity: 1,
  24711. markerOpacity: .3,
  24712. markerOpacityOnHover: 1
  24713. },
  24714. dollhouse: {
  24715. transitionTime: 1e3,
  24716. modelAlpha: 1,
  24717. modelAlphaDelay: 0,
  24718. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24719. skyboxOpacity: 0,
  24720. skyboxOpacityDelay: 0,
  24721. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24722. fovLength: 1,
  24723. fovDelay: 0,
  24724. cameraMatrixDuration: .8,
  24725. cameraMatrixDelay: .3,
  24726. cameraMatrixEase: c.easeInCubic,
  24727. reticuleOpacity: 1,
  24728. markerOpacity: 0,
  24729. markerOpacityOnHover: 0
  24730. },
  24731. floorplan: {
  24732. transitionTime: 1e3,
  24733. modelAlpha: 1,
  24734. modelAlphaDelay: 0,
  24735. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24736. skyboxOpacity: 0,
  24737. skyboxOpacityDelay: 0,
  24738. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24739. fovLength: 1,
  24740. fovDelay: 0,
  24741. cameraMatrixDuration: .5,
  24742. cameraMatrixDelay: 0,
  24743. cameraMatrixEase: c.easeOutCubic,
  24744. reticuleOpacity: 1,
  24745. markerOpacity: 0,
  24746. markerOpacityOnHover: 0,
  24747. cameraHeight: 50
  24748. },
  24749. transitioning: {
  24750. reticuleOpacity: 0,
  24751. markerOpacity: .3,
  24752. markerOpacityOnHover: 1
  24753. },
  24754. "floorplan-dollhouse": {
  24755. rotationDelay: 0,
  24756. rotationDuration: 1
  24757. },
  24758. "floorplan-panorama": {
  24759. rotationDelay: .5,
  24760. rotationDuration: 1
  24761. },
  24762. "dollhouse-panorama": {
  24763. rotationDelay: .5,
  24764. rotationDuration: 1
  24765. },
  24766. "dollhouse-floorplan": {
  24767. rotationDelay: 0,
  24768. rotationDuration: 1,
  24769. cameraMatrixDuration: 1.05,
  24770. cameraMatrixDelay: .5
  24771. },
  24772. "panorama-dollhouse": {
  24773. rotationDelay: 0,
  24774. rotationDuration: .5
  24775. },
  24776. "panorama-floorplan": {
  24777. transitionTime: 1500,
  24778. rotationDelay: 0,
  24779. rotationDuration: .5
  24780. }
  24781. })).path.meshFree && (p.path.typ = l.WALK),
  24782. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24783. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24784. t.exports = p
  24785. }
  24786. , {
  24787. "./constants": 8,
  24788. "./enum/Colors": 19,
  24789. "./enum/VROption": 47,
  24790. "./enum/Viewmode": 51,
  24791. "./enum/WarpStyle": 52,
  24792. "./util/browser": 182,
  24793. "./util/common": 185,
  24794. "./util/easing": 186,
  24795. "./util/showcase": 193,
  24796. three: 217
  24797. }],
  24798. 167: [function(e, t, i) {
  24799. "use strict";
  24800. var n = e("three")
  24801. , r = e("./settings")
  24802. , 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"
  24803. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24804. t.exports = {
  24805. basicTextured: {
  24806. uniforms: {
  24807. tDiffuse: {
  24808. type: "t",
  24809. value: null
  24810. },
  24811. alpha: {
  24812. type: "f",
  24813. value: 1
  24814. }
  24815. },
  24816. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24817. 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}"
  24818. },
  24819. copyCubeMap: {
  24820. uniforms: {
  24821. tDiffuse: {
  24822. type: "t",
  24823. value: null
  24824. },
  24825. alpha: {
  24826. type: "f",
  24827. value: 1
  24828. }
  24829. },
  24830. 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}",
  24831. 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}"
  24832. },
  24833. cube: {
  24834. uniforms: {
  24835. map: {
  24836. type: "t",
  24837. value: null
  24838. },
  24839. opacity: {
  24840. type: "f",
  24841. value: 1
  24842. }
  24843. },
  24844. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24845. 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"
  24846. },
  24847. model: {
  24848. uniforms: {
  24849. map: {
  24850. type: "t",
  24851. value: null
  24852. },
  24853. modelAlpha: {
  24854. type: "f",
  24855. value: r.modelAlpha
  24856. },
  24857. opacity: {
  24858. type: "f",
  24859. value: 1
  24860. },
  24861. progress: {
  24862. type: "f",
  24863. value: 0
  24864. },
  24865. blackout: {
  24866. type: "i",
  24867. value: 0
  24868. },
  24869. pano0Map: {
  24870. type: "t",
  24871. value: null
  24872. },
  24873. pano0Position: {
  24874. type: "v3",
  24875. value: new n.Vector3
  24876. },
  24877. pano0Matrix: {
  24878. type: "m4",
  24879. value: new n.Matrix4
  24880. },
  24881. pano1Map: {
  24882. type: "t",
  24883. value: null
  24884. },
  24885. pano1Position: {
  24886. type: "v3",
  24887. value: new n.Vector3
  24888. },
  24889. pano1Matrix: {
  24890. type: "m4",
  24891. value: new n.Matrix4
  24892. }
  24893. },
  24894. 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",
  24895. 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"
  24896. },
  24897. hot: {
  24898. uniforms: {
  24899. color: {
  24900. type: "c",
  24901. value: new n.Color(16720384)
  24902. },
  24903. opac: {
  24904. type: "f",
  24905. value: 0
  24906. },
  24907. texture1: {
  24908. type: "t",
  24909. value: null
  24910. },
  24911. texture2: {
  24912. type: "t",
  24913. value: null
  24914. }
  24915. },
  24916. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24917. fragmentShader: "varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  24918. },
  24919. modelOutside: {
  24920. uniforms: {
  24921. map: {
  24922. type: "t",
  24923. value: null
  24924. },
  24925. opacity: {
  24926. type: "f",
  24927. value: 1
  24928. }
  24929. },
  24930. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24931. 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"
  24932. },
  24933. ribbon: {
  24934. uniforms: {
  24935. map: {
  24936. type: "t",
  24937. value: null
  24938. },
  24939. opacity: {
  24940. type: "f",
  24941. value: 1
  24942. },
  24943. color: {
  24944. type: "c",
  24945. value: new n.Color(r.path.color)
  24946. }
  24947. },
  24948. 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",
  24949. 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"
  24950. },
  24951. waypoint: {
  24952. uniforms: {
  24953. map: {
  24954. type: "t",
  24955. value: null
  24956. },
  24957. opacity: {
  24958. type: "f",
  24959. value: 1
  24960. },
  24961. pulse: {
  24962. type: "f",
  24963. value: 1
  24964. },
  24965. nearFade: {
  24966. type: "v2",
  24967. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24968. },
  24969. color: {
  24970. type: "c",
  24971. value: new n.Color(r.reticuleColor)
  24972. }
  24973. },
  24974. 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",
  24975. 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"
  24976. },
  24977. modelDebug: {
  24978. uniforms: {
  24979. map: {
  24980. type: "t",
  24981. value: null
  24982. },
  24983. modelAlpha: {
  24984. type: "f",
  24985. value: r.modelAlpha
  24986. },
  24987. depthmapRatio: {
  24988. type: "f",
  24989. value: 0
  24990. },
  24991. opacity: {
  24992. type: "f",
  24993. value: 1
  24994. },
  24995. progress: {
  24996. type: "f",
  24997. value: 0
  24998. },
  24999. considerOcclusion: {
  25000. type: "i",
  25001. value: r.fancierTransition
  25002. },
  25003. highlightPanoSelection: {
  25004. type: "i",
  25005. value: 0
  25006. },
  25007. useThirdPano: {
  25008. type: "i",
  25009. value: r.useThirdPano
  25010. },
  25011. pano0Map: {
  25012. type: "t",
  25013. value: null
  25014. },
  25015. pano0Depth: {
  25016. type: "t",
  25017. value: null
  25018. },
  25019. pano0Position: {
  25020. type: "v3",
  25021. value: new n.Vector3
  25022. },
  25023. pano0Matrix: {
  25024. type: "m4",
  25025. value: new n.Matrix4
  25026. },
  25027. pano0Weight: {
  25028. type: "f",
  25029. value: r.transition.pano0Weight
  25030. },
  25031. pano1Map: {
  25032. type: "t",
  25033. value: null
  25034. },
  25035. pano1Depth: {
  25036. type: "t",
  25037. value: null
  25038. },
  25039. pano1Position: {
  25040. type: "v3",
  25041. value: new n.Vector3
  25042. },
  25043. pano1Matrix: {
  25044. type: "m4",
  25045. value: new n.Matrix4
  25046. },
  25047. pano1Weight: {
  25048. type: "f",
  25049. value: r.transition.pano1Weight
  25050. },
  25051. pano2Map: {
  25052. type: "t",
  25053. value: null
  25054. },
  25055. pano2Depth: {
  25056. type: "t",
  25057. value: null
  25058. },
  25059. pano2Position: {
  25060. type: "v3",
  25061. value: new n.Vector3
  25062. },
  25063. pano2Matrix: {
  25064. type: "m4",
  25065. value: new n.Matrix4
  25066. },
  25067. pano2Weight: {
  25068. type: "f",
  25069. value: r.transition.pano2Weight
  25070. }
  25071. },
  25072. 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",
  25073. 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"
  25074. },
  25075. customDepth: {
  25076. uniforms: {
  25077. panoPosition: {
  25078. type: "v3",
  25079. value: new n.Vector3
  25080. }
  25081. },
  25082. 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",
  25083. 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"
  25084. },
  25085. skysphere: {
  25086. uniforms: {
  25087. radius: {
  25088. type: "f",
  25089. value: 0
  25090. }
  25091. },
  25092. 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",
  25093. 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"
  25094. },
  25095. tagDisc: {
  25096. uniforms: {
  25097. opacity: {
  25098. type: "f",
  25099. value: 0
  25100. },
  25101. color: {
  25102. type: "c",
  25103. value: new n.Color
  25104. },
  25105. bg: {
  25106. type: "t",
  25107. value: null
  25108. },
  25109. mask: {
  25110. type: "t",
  25111. value: null
  25112. }
  25113. },
  25114. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25115. 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"
  25116. }
  25117. }
  25118. window.shaders = t.exports;
  25119. }
  25120. , {
  25121. "./settings": 166,
  25122. three: 217
  25123. }],
  25124. 168: [function(E, _, e) {
  25125. (function(e) {
  25126. "use strict";
  25127. var t = E("three")
  25128. , i = (E("url"),
  25129. E("./util/ajax"))
  25130. , n = E("./settings")
  25131. , r = E("./util/logger")
  25132. , o = E("./util/math")
  25133. , a = E("./util/showcase")
  25134. , s = E("./objects/Panorama")
  25135. , l = new r(e)
  25136. , c = E("./model/Model")
  25137. , h = E("./shaders")
  25138. , u = E("./util/transitions")
  25139. , d = E("./objects/Chunk")
  25140. , p = E("./objects/Reticule")
  25141. , f = E("./objects/Skybox")
  25142. , g = E("./objects/Floor")
  25143. , m = E("./cameras/DollhouseCamera")
  25144. , v = E("./cameras/FloorplanCamera")
  25145. , y = E("./cameras/PanoramaCamera")
  25146. , A = E("./controls/DollhouseControls")
  25147. , C = E("./controls/FloorplanControls")
  25148. , I = E("./controls/PanoramaControls");
  25149. t.ImageUtils.crossOrigin = n.crossOrigin,
  25150. _.exports = {
  25151. shaders: h,
  25152. transitions: u,
  25153. Model: c,
  25154. Chunk: d,
  25155. Floor: g,
  25156. Skybox: f,
  25157. Reticule: p,
  25158. Panorama: s,
  25159. DollhouseCamera: m,
  25160. FloorplanCamera: v,
  25161. PanoramaCamera: y,
  25162. DollhouseControls: A,
  25163. FloorplanControls: C,
  25164. PanoramaControls: I,
  25165. getModel: function(e) {
  25166. if (!e.url)
  25167. throw 'getModel(): missing parameter "url"';
  25168. e.autoload = void 0 === e.autoload || e.autoload;
  25169. var t = a.parseSidUrl(e.url);
  25170. e.urlBase = t.urlBase,
  25171. e.urlModel = t.urlModel,
  25172. e.urlFiles = t.urlFiles;
  25173. var i = this._getPlatformError();
  25174. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25175. this._loadModel().then(this._buildModel.bind(this)))
  25176. },
  25177. _getPlatformError: function() {
  25178. 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"
  25179. },
  25180. _loadModel: function() {
  25181. return i.get(this.options.urlModel, {
  25182. responseType: "json",
  25183. prefetchFrom: "model",
  25184. auth: a.getAuthorizationHeader()
  25185. }).then(null, function() {
  25186. return l.warn("Model loading failed at initial metadata load"),
  25187. "loading-failed"
  25188. })
  25189. },
  25190. _buildModel: function(e) {
  25191. e = a.normalizeModeldata(e, o);
  25192. var t = new c(this.options,e);
  25193. return this.options.autoload ? t.load(!0) : $.when(t)
  25194. }
  25195. }
  25196. }
  25197. ).call(this, "/js/showcase.js")
  25198. }
  25199. , {
  25200. "./cameras/DollhouseCamera": 5,
  25201. "./cameras/FloorplanCamera": 6,
  25202. "./cameras/PanoramaCamera": 7,
  25203. "./controls/DollhouseControls": 10,
  25204. "./controls/FloorplanControls": 11,
  25205. "./controls/PanoramaControls": 13,
  25206. "./model/Model": 139,
  25207. "./objects/Chunk": 144,
  25208. "./objects/Floor": 146,
  25209. "./objects/Panorama": 148,
  25210. "./objects/Reticule": 149,
  25211. "./objects/Skybox": 152,
  25212. "./settings": 166,
  25213. "./shaders": 167,
  25214. "./util/ajax": 181,
  25215. "./util/logger": 189,
  25216. "./util/math": 190,
  25217. "./util/showcase": 193,
  25218. "./util/transitions": 195,
  25219. three: 217,
  25220. url: 208
  25221. }],
  25222. 169: [function(e, t, i) {
  25223. "use strict";
  25224. function l(e) {
  25225. var t = {
  25226. renderTarget: null,
  25227. inUse: !1,
  25228. size: -1,
  25229. pano: null
  25230. };
  25231. return t.inUse = !0,
  25232. t.size = e,
  25233. function(e) {
  25234. O.push(e)
  25235. }(t),
  25236. t
  25237. }
  25238. function c(e) {
  25239. for (var t = 0; t < O.length; t++) {
  25240. var i = O[t];
  25241. if (i.renderTarget === e)
  25242. return !(i.inUse = !1)
  25243. }
  25244. return !1
  25245. }
  25246. function n() {
  25247. this.tileDirectory = {},
  25248. this.activeRenderTargetDescriptors = {},
  25249. this.activePanos = [],
  25250. this.panoLODDescriptors = {},
  25251. this.panoDescriptors = {},
  25252. this.tileTrees = {},
  25253. this.sceneRenderer = null,
  25254. this.tileDownloader = null,
  25255. this.forceQueue = [],
  25256. this.uploadQueues = {},
  25257. this.uploadInterval = null,
  25258. this.uploadIntervalCancelled = !1,
  25259. this.usingTileOverlay = !1,
  25260. this.overlayTilesLoaded = !1,
  25261. this.overlayTileBase = null,
  25262. this.overlayTilesBasic = {},
  25263. this.overlayTilesEnhanced = {},
  25264. this.zoomRenderTarget = null,
  25265. this.zoomPano = null,
  25266. this.zoomingActive = !1,
  25267. this.zoomPanoId = null,
  25268. this.zoomPanoRenderingDisabled = !1,
  25269. this.direction = new _.Vector3,
  25270. this.initTime = -1,
  25271. this.maxBaseUploadsPerFrame = R,
  25272. this.maxNonBaseUploadsPerFrame = M
  25273. }
  25274. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  25275. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25276. e("../objects/Panorama"),
  25277. e("./TileTree")), y = (e("./TileDownloader"),
  25278. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25279. e("../util/browser"),
  25280. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  25281. Base: 0,
  25282. Remaining: 1
  25283. }, O = [];
  25284. function L(e) {
  25285. var t = e.shift();
  25286. return t.uploadQueued = !1,
  25287. t
  25288. }
  25289. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25290. this.sceneRenderer = e,
  25291. this.tileDownloader = t,
  25292. this.qualityManager = i,
  25293. this.bindEvents(),
  25294. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25295. this.initTime = performance.now()
  25296. }
  25297. ,
  25298. n.prototype.getActivePanoTextures = function(e) {
  25299. e = e || [];
  25300. for (var t = 0; t < O.length; t++) {
  25301. var i = O[t];
  25302. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25303. }
  25304. }
  25305. ,
  25306. n.prototype.hasQueuedTiles = function() {
  25307. var e = this.peekNextFromUploadQueue();
  25308. return null != e
  25309. }
  25310. ,
  25311. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25312. return this.activeRenderTargetDescriptors[e]
  25313. }
  25314. ,
  25315. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25316. this.activeRenderTargetDescriptors[e] = t
  25317. }
  25318. ,
  25319. n.prototype.loadOverlayTiles = function() {
  25320. if (0 !== d.tiling.overlayStyle) {
  25321. var n = 0
  25322. , e = function(e, t, i) {
  25323. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25324. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25325. ++n === r.length && (this.overlayTilesLoaded = !0)
  25326. }
  25327. .bind(this)
  25328. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25329. r.forEach(function(e) {
  25330. this.tileDownloader.loadImage(e[0], 0, e[1])
  25331. }
  25332. .bind(this)),
  25333. this.usingTileOverlay = !0
  25334. } else
  25335. this.usingTileOverlay = !1
  25336. }
  25337. ,
  25338. n.prototype.bindEvents = function() {
  25339. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25340. }
  25341. ,
  25342. n.prototype.setupZoomRenderTarget = function() {
  25343. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25344. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25345. return;
  25346. var e = this.zoomRenderTarget;
  25347. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25348. e) {
  25349. var t = e.width
  25350. , i = this.zoomRenderTarget.width;
  25351. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25352. e.texture.dispose(),
  25353. e.texture.loaded = !1,
  25354. e.texture.version = 0,
  25355. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25356. e.texture = null
  25357. }
  25358. this.zoomPanoRenderingDisabled = !1
  25359. } else
  25360. this.zoomPanoRenderingDisabled = !0
  25361. }
  25362. ,
  25363. n.prototype.enableUltraHighQualityMode = function(t) {
  25364. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25365. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25366. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25367. e && (this.qualityManager.enableUltraHighQualityMode(),
  25368. this.setupZoomRenderTarget(),
  25369. t())
  25370. }
  25371. .bind(this))
  25372. }
  25373. }
  25374. ,
  25375. n.prototype.activateTiledPano = function(e, t, i) {
  25376. i && this.clearAllQueuedUploads();
  25377. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25378. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25379. this.linkAllTilesAndNodes(e);
  25380. var r = this.getActiveRenderTargetDescriptor(e.id)
  25381. , o = t;
  25382. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25383. !r || o !== r.size) {
  25384. if (r && c(r.renderTarget),
  25385. !(r = function(e) {
  25386. for (var t = 0; t < O.length; t++) {
  25387. var i = O[t];
  25388. if (!i.inUse && i.size === e)
  25389. return i.inUse = !0,
  25390. i
  25391. }
  25392. return null
  25393. }(o))) {
  25394. var a = this.initTiledPano(o, !1);
  25395. (r = l(a.width)).renderTarget = a
  25396. }
  25397. r.pano = e,
  25398. this.resetPanoDescriptor(e.id),
  25399. this.resetPanoLODDescriptors(e.id),
  25400. this.resetRenderStatus(e.id, !0, !0)
  25401. }
  25402. this.setActiveRenderTargetDescriptor(e.id, r);
  25403. var s = i ? 0 : 1;
  25404. return this.updateActivePanos(e, s),
  25405. r.renderTarget
  25406. }
  25407. ,
  25408. n.prototype.deactivateTiledPano = function(e) {
  25409. var t = this.getActiveRenderTargetDescriptor(e.id);
  25410. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25411. this.setActiveRenderTargetDescriptor(e.id, null);
  25412. var i = this.getUploadQueueForPano(e.id);
  25413. this.clearUploadQueue(i),
  25414. this.updateActivePanos()
  25415. }
  25416. ,
  25417. n.prototype.updateActivePanos = (s = [],
  25418. function(e, t) {
  25419. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25420. e && s.length === t && s.push(e);
  25421. var n = this.activePanos[i]
  25422. , r = this.getActiveRenderTargetDescriptor(n.id);
  25423. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25424. }
  25425. e && t >= s.length && s.push(e),
  25426. this.activePanos.length = 0,
  25427. this.activePanos.push.apply(this.activePanos, s)
  25428. }
  25429. ),
  25430. n.prototype.getActivePanoCount = function() {
  25431. return this.activePanos.length
  25432. }
  25433. ,
  25434. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25435. var i = null;
  25436. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25437. for (var n = function(e, t, i, n) {
  25438. o && (t.tile.zoomUploaded = !1),
  25439. r && (t.tile.uploaded = !1)
  25440. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25441. this.getTileTree(e, a).breadthFirst({
  25442. callback: n.bind(this, a),
  25443. minLevel: i
  25444. })
  25445. }
  25446. }
  25447. ,
  25448. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25449. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25450. t.tile.zoomUploaded = t.tile.uploaded,
  25451. t.zoomCovered = t.covered
  25452. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25453. this.getTileTree(e, n).breadthFirst({
  25454. callback: i.bind(this, n),
  25455. maxLevel: t
  25456. })
  25457. }
  25458. }
  25459. ,
  25460. n.prototype.renderPanoTiles = (h = [],
  25461. function(e, t, i, n) {
  25462. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25463. t = t || this.direction || m.FORWARD;
  25464. var r = this.getActiveRenderTargetDescriptor(e);
  25465. if (!this.isRenderTargetDescriptorValid(r))
  25466. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25467. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25468. var a = this.getTileTree(e, o);
  25469. h.length = 0,
  25470. a.breadthFirst({
  25471. saveVisited: h
  25472. });
  25473. for (var s = 0; s < h.length; s++) {
  25474. var l = h[s];
  25475. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25476. }
  25477. }
  25478. this.updateDirection(t)
  25479. }
  25480. ),
  25481. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25482. return e && e.renderTarget
  25483. }
  25484. ,
  25485. n.prototype.isPanoActive = function(e) {
  25486. var t = this.getActiveRenderTargetDescriptor(e);
  25487. return this.isRenderTargetDescriptorValid(t)
  25488. }
  25489. ,
  25490. n.prototype.isPanoZoomed = function(e) {
  25491. return this.zoomingActive && this.zoomPanoId === e
  25492. }
  25493. ,
  25494. n.prototype.initTileTree = function(e, t, i) {
  25495. var n = this.tileTrees[e];
  25496. n || (n = [],
  25497. this.tileTrees[e] = n);
  25498. var r = n[t];
  25499. if (!r) {
  25500. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25501. r = new v(A.TILE_SIZE,o),
  25502. n[t] = r
  25503. }
  25504. }
  25505. ,
  25506. n.prototype.getTileTree = function(e, t) {
  25507. var i = this.tileTrees[e];
  25508. if (!i)
  25509. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25510. var n = i[t];
  25511. if (!n)
  25512. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25513. return n
  25514. }
  25515. ,
  25516. n.prototype.initTiledPano = function(e, t) {
  25517. var i = this.sceneRenderer.renderer
  25518. , n = (i.context,
  25519. new _.WebGLRenderTargetCube(e,e,{
  25520. stencilBuffer: !1
  25521. }))
  25522. , r = new _.CubeTexture([]);
  25523. (n.texture = r).image = [null, null, null, null, null, null],
  25524. r.flipY = !0,
  25525. t ? (r.generateMipmaps = !0,
  25526. r.magFilter = _.LinearFilter,
  25527. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25528. r.magFilter = _.LinearFilter,
  25529. r.minFilter = _.LinearFilter),
  25530. r.format = _.RGBAFormat,
  25531. i.setRenderTarget(n),
  25532. i.setRenderTarget(null);
  25533. var o = i.properties.get(r);
  25534. return o.__image__webglTextureCube = o.__webglTexture,
  25535. n
  25536. }
  25537. ,
  25538. n.prototype.getUploadQueueForPano = function(e) {
  25539. var t = this.uploadQueues[e];
  25540. return t || (t = [],
  25541. this.uploadQueues[e] = t),
  25542. t
  25543. }
  25544. ,
  25545. n.prototype.isTileUploaded = function(e) {
  25546. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25547. }
  25548. ,
  25549. n.prototype.setUploaded = function(e, t) {
  25550. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25551. }
  25552. ,
  25553. n.prototype.queueTileUpload = function(e, t, i) {
  25554. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25555. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25556. var r = this.getUploadQueueForPano(e.panoId);
  25557. 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),
  25558. e.uploadQueued = !0,
  25559. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25560. }
  25561. }
  25562. ,
  25563. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25564. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25565. }
  25566. ,
  25567. n.prototype.getTopUploadQueue = function() {
  25568. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25569. for (var n = 0; n < this.activePanos.length; n++)
  25570. if (e = this.activePanos[n],
  25571. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25572. switch (i) {
  25573. case P.Base:
  25574. if (0 === t[0].level)
  25575. return t;
  25576. break;
  25577. case P.Remaining:
  25578. return t
  25579. }
  25580. return null
  25581. }
  25582. ,
  25583. n.prototype.getNextFromUploadQueue = function() {
  25584. if (0 < this.forceQueue.length)
  25585. return L(this.forceQueue);
  25586. var e = this.getTopUploadQueue();
  25587. return e && 0 < e.length ? L(e) : null
  25588. }
  25589. ,
  25590. n.prototype.peekNextFromUploadQueue = function() {
  25591. if (0 < this.forceQueue.length)
  25592. return this.forceQueue[0];
  25593. var e = this.getTopUploadQueue();
  25594. return e && 0 < e.length ? e[0] : null
  25595. }
  25596. ,
  25597. n.prototype.clearAllQueuedUploads = function() {
  25598. this.clearAllUploadQueues(null, 0)
  25599. }
  25600. ,
  25601. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25602. this.clearAllUploadQueues(e, 0)
  25603. }
  25604. ,
  25605. n.prototype.clearAllUploadQueues = function(e, t) {
  25606. if (e)
  25607. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25608. this.clearUploadQueue(this.forceQueue, t, e);
  25609. else {
  25610. for (var i = 0; i < this.activePanos.length; i++) {
  25611. var n = this.activePanos[i];
  25612. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25613. }
  25614. this.clearUploadQueue(this.forceQueue, t)
  25615. }
  25616. }
  25617. ,
  25618. n.prototype.clearUploadQueue = function(e, t, i) {
  25619. null != t || (t = 0);
  25620. for (var n = 0; n < e.length; ) {
  25621. var r = e[n];
  25622. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25623. e.splice(n, 1)) : n++
  25624. }
  25625. }
  25626. ,
  25627. n.prototype.refreshUploadInterval = (a = null,
  25628. function(e) {
  25629. this.uploadIntervalCancelled || (a = a || function() {
  25630. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25631. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25632. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25633. }
  25634. .bind(this),
  25635. null != e || (e = x),
  25636. T || (e = S),
  25637. this.uploadInterval = window.setTimeout(a, e),
  25638. this.uploadIntervalDelay = e)
  25639. }
  25640. ),
  25641. n.prototype.update = (r = performance.now(),
  25642. o = 0,
  25643. function() {
  25644. this.uploadIntervalCancelled = !0,
  25645. window.clearTimeout(this.uploadInterval),
  25646. this.uploadInterval = null;
  25647. var e = performance.now() - r;
  25648. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25649. r = performance.now()),
  25650. o++
  25651. }
  25652. ),
  25653. n.prototype.updateUploadQueue = function(e, t) {
  25654. e = e || 1;
  25655. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25656. var r = this.getNextFromUploadQueue();
  25657. if (!r)
  25658. break;
  25659. if (0 !== r.level ? i++ : n++,
  25660. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25661. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25662. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25663. }
  25664. }
  25665. }
  25666. ,
  25667. n.prototype.updateDirection = function(e) {
  25668. if (e = e || this.direction) {
  25669. this.direction = e;
  25670. for (var t = 0; t < this.activePanos.length; t++) {
  25671. var i = this.activePanos[t]
  25672. , n = this.getUploadQueueForPano(i.id);
  25673. y.sortPanoTiles(n, i, this.direction)
  25674. }
  25675. }
  25676. }
  25677. ,
  25678. n.prototype.uploadTile = (I = {},
  25679. new _.Vector4,
  25680. E = d.tiling.overlayStyle,
  25681. function(e, t) {
  25682. var i = e.panoId
  25683. , n = e.image
  25684. , r = e.tileSize
  25685. , o = e.panoSize
  25686. , a = e.tileIndex
  25687. , s = (e.faceTileIndex,
  25688. e.totalTiles)
  25689. , l = (e.face,
  25690. e.tileX)
  25691. , c = e.tileY
  25692. , h = !0
  25693. , u = !1
  25694. , d = (this.getPanoDescriptor(i),
  25695. this.getPanoLODDescriptor(i, o))
  25696. , p = this.getActiveRenderTargetDescriptor(i)
  25697. , f = p.renderTarget
  25698. , g = p.size;
  25699. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25700. g = this.qualityManager.getMaxZoomPanoSize()),
  25701. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25702. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25703. this.isTileUploaded(e) && (u = h = !1)),
  25704. h) {
  25705. var m = r / o * g
  25706. , v = l * r / o * g
  25707. , y = c * r / o * g;
  25708. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25709. var A = I[r];
  25710. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25711. 1 === E || 2 === E) {
  25712. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25713. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25714. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25715. } else
  25716. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25717. d.uploadCount++,
  25718. this.emit(b.TileRenderSuccess, i, o, a, s),
  25719. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25720. this.setUploaded(e, !0),
  25721. this.addCoverageForNode(e.node)
  25722. } else
  25723. this.setUploaded(e, !1);
  25724. return e.uploadAttempted || (d.uploadAttempts++,
  25725. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25726. e.uploadAttempted = !0,
  25727. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25728. u
  25729. }
  25730. ),
  25731. n.prototype.linkTileAndNode = function(e, t) {
  25732. (t.tile = e).node = t
  25733. }
  25734. ,
  25735. n.prototype.linkAllTilesAndNodes = function(a) {
  25736. for (var e = function(e, t, i, n, r) {
  25737. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25738. this.linkTileAndNode(o, i)
  25739. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25740. var i = this.getTileTree(a.id, t);
  25741. i.breadthFirst({
  25742. callback: e.bind(this, i, t)
  25743. })
  25744. }
  25745. }
  25746. ,
  25747. n.prototype.anyUploaded = function(e) {
  25748. if (!e)
  25749. return !1;
  25750. if (e.tile && this.isTileUploaded(e.tile))
  25751. return !0;
  25752. if (e.children)
  25753. for (var t = 0; t < e.children.length; t++) {
  25754. var i = e.children[t];
  25755. if (this.anyUploaded(i))
  25756. return !0
  25757. }
  25758. return !1
  25759. }
  25760. ,
  25761. n.prototype.setNodeCovered = function(e, t) {
  25762. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25763. }
  25764. ,
  25765. n.prototype.isNodeCovered = function(e) {
  25766. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25767. }
  25768. ,
  25769. n.prototype.addCoverageForNode = function(e) {
  25770. if (this.setNodeCovered(e, !0),
  25771. e.parent && e.covered) {
  25772. var t = e.parent;
  25773. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25774. }
  25775. }
  25776. ,
  25777. n.prototype.calcFullCoverage = function(e) {
  25778. var t = !1;
  25779. if (e.children)
  25780. for (var i = 0; i < e.children.length; i++) {
  25781. var n = e.children[i];
  25782. t = t || this.calcFullCoverage(n)
  25783. }
  25784. e.covered = e.tile.uploaded || t
  25785. }
  25786. ,
  25787. n.prototype.nodeSubcovered = function(e) {
  25788. if (!e.children)
  25789. return !1;
  25790. for (var t = 0; t < e.children.length; t++)
  25791. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25792. return !1;
  25793. return !0
  25794. }
  25795. ,
  25796. n.prototype.resetPanoDescriptor = function(e) {
  25797. this.getPanoDescriptor(e)
  25798. }
  25799. ,
  25800. n.prototype.getPanoDescriptor = function(e) {
  25801. var t = this.panoDescriptors[e];
  25802. return t || (t = {},
  25803. this.panoDescriptors[e] = t),
  25804. t
  25805. }
  25806. ,
  25807. n.prototype.resetPanoLODDescriptors = function(e) {
  25808. var t = this.getPanoLODDescriptors(e);
  25809. for (var i in t)
  25810. if (t.hasOwnProperty(i)) {
  25811. var n = t[i];
  25812. n.uploadCount = 0,
  25813. n.uploadAttempts = 0
  25814. }
  25815. }
  25816. ,
  25817. n.prototype.getPanoLODDescriptor = function(e, t) {
  25818. var i = this.getPanoLODDescriptors(e)
  25819. , n = i[t];
  25820. return n || (n = {
  25821. uploadCount: 0,
  25822. uploadAttempts: 0
  25823. },
  25824. i[t] = n),
  25825. n
  25826. }
  25827. ,
  25828. n.prototype.getPanoLODDescriptors = function(e) {
  25829. var t = this.panoLODDescriptors[e];
  25830. return t || (t = {},
  25831. this.panoLODDescriptors[e] = t),
  25832. t
  25833. }
  25834. ,
  25835. n.prototype.onTileDownloaded = function(e) {
  25836. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25837. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25838. if (i.downloaded = !0,
  25839. i.image = e.image,
  25840. i.panoSize = e.panoSize,
  25841. i.tileX = e.tileX,
  25842. i.tileY = e.tileY,
  25843. i.totalTiles = e.totalTiles,
  25844. i.tileIndex = e.tileIndex,
  25845. i.faceTileIndex = e.faceTileIndex,
  25846. i.face = e.face,
  25847. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25848. i.panoId = e.panoId,
  25849. i.tileSize = e.tileSize,
  25850. i.direction = (new _.Vector3).copy(e.direction),
  25851. i.node = null,
  25852. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25853. this.isPanoActive(i.panoId)) {
  25854. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25855. this.linkTileAndNode(i, n),
  25856. this.queueTileUpload(i, !0)
  25857. }
  25858. }
  25859. ,
  25860. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25861. var r = this.tileDirectory[e];
  25862. r || (r = {},
  25863. this.tileDirectory[e] = r);
  25864. var o = 16384 * t + 1024 * i + n
  25865. , a = r[o];
  25866. return a || (a = {
  25867. downloaded: !1,
  25868. uploaded: !1,
  25869. zoomUploaded: !1
  25870. },
  25871. r[o] = a),
  25872. a._key = e + ":" + t + ":" + i + ":" + n,
  25873. a._tileKey = o,
  25874. a
  25875. }
  25876. ,
  25877. n.prototype.setZoomingActive = function(e, t, i) {
  25878. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25879. this.zoomPanoId = t.id,
  25880. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25881. }
  25882. ,
  25883. n.prototype.updateZoomedPanoFromBase = function(e) {
  25884. if (!this.zoomPanoRenderingDisabled) {
  25885. var t = this.getActiveRenderTargetDescriptor(e.id);
  25886. if (t && t.renderTarget) {
  25887. var i = this.qualityManager.getMaxZoomPanoSize()
  25888. , n = t.renderTarget
  25889. , r = t.size;
  25890. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25891. this.copyBaseRenderStatusToZoomed(e.id)
  25892. }
  25893. }
  25894. }
  25895. ,
  25896. t.exports = n
  25897. }
  25898. , {
  25899. "../enum/GLCubeFaces": 25,
  25900. "../enum/PanoRendererEvents": 35,
  25901. "../enum/PanoSizeClass": 36,
  25902. "../enum/SceneRendererEvents": 43,
  25903. "../enum/TileDownloaderEvents": 45,
  25904. "../enum/Vectors": 50,
  25905. "../exception/BasicException": 55,
  25906. "../objects/Panorama": 148,
  25907. "../settings": 166,
  25908. "../util/browser": 182,
  25909. "../util/panorama": 191,
  25910. "./TileDownloader": 171,
  25911. "./TilePrioritizer": 172,
  25912. "./TileTree": 173,
  25913. "./TileUtils": 174,
  25914. events: 202,
  25915. three: 217
  25916. }],
  25917. 170: [function(e, t, i) {
  25918. "use strict";
  25919. function n(e, t, i) {
  25920. this.maxNavPanoSize = -1,
  25921. this.maxZoomPanoSize = -1,
  25922. this.devicePixelDensity = e,
  25923. this.deviceScreenSize = t,
  25924. this.clientBandwidth = i,
  25925. this.panoSizeClassMap = {},
  25926. this.useHighResolutionPanos = !0,
  25927. this.useUltraHighResolutionPanos = !1,
  25928. this.modelHasUltraHighPanos = !1
  25929. }
  25930. var r = e("../enum/PanoSizeClass")
  25931. , o = e("../settings")
  25932. , a = e("../util/browser")
  25933. , s = e("../constants")
  25934. , l = e("../util/showcase")
  25935. , c = e("../enum/ModelManagerEvents");
  25936. n.prototype.init = function(e) {
  25937. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25938. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25939. this.highSize = this.getPanoSize(r.HIGH),
  25940. this.standardSize = this.getPanoSize(r.STANDARD),
  25941. this.baseSize = this.getPanoSize(r.BASE),
  25942. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25943. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25944. this.updateMaximums(),
  25945. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25946. }
  25947. ,
  25948. n.prototype.updateFromModel = function(e) {
  25949. this.updateHighResolutionSettings(e),
  25950. this.updateUltraHighResolutionSettings(e)
  25951. }
  25952. ,
  25953. n.prototype.updateHighResolutionSettings = function(e) {
  25954. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25955. this.updateMaximums()
  25956. }
  25957. ,
  25958. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25959. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25960. this.updateMaximums()
  25961. }
  25962. ,
  25963. n.prototype.enableUltraHighQualityMode = function() {
  25964. this.modelHasUltraHighPanos = !0,
  25965. this.updateUltraHighResolutionSettings(null)
  25966. }
  25967. ,
  25968. n.prototype.ultraHighQualityModeEnabled = function() {
  25969. return this.modelHasUltraHighPanos
  25970. }
  25971. ,
  25972. n.prototype.onModelChanged = function(e) {
  25973. this.updateFromModel(e.model),
  25974. this.updateMaximums()
  25975. }
  25976. ,
  25977. n.prototype.updateMaximums = function() {
  25978. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25979. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25980. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25981. }
  25982. ,
  25983. n.prototype.buildPanoSizeClassMap = function() {
  25984. this.panoSizeClassMap[r.BASE] = 512,
  25985. this.panoSizeClassMap[r.STANDARD] = 1024,
  25986. this.panoSizeClassMap[r.HIGH] = 2048,
  25987. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25988. }
  25989. ,
  25990. n.prototype.getPanoSize = function(e) {
  25991. return this.panoSizeClassMap[e]
  25992. }
  25993. ,
  25994. n.prototype.getMaxPossiblePanoSize = function() {
  25995. return this.getPanoSize(r.ULTRAHIGH)
  25996. }
  25997. ,
  25998. n.prototype.getMaxPanoSize = function() {
  25999. return this.maxZoomPanoSize
  26000. }
  26001. ,
  26002. n.prototype.getMaxNavPanoSize = function() {
  26003. return this.maxNavPanoSize
  26004. }
  26005. ,
  26006. n.prototype.getMaxZoomPanoSize = function() {
  26007. return this.maxZoomPanoSize
  26008. }
  26009. ,
  26010. n.prototype.detectMaxNavPanoSizeClass = function() {
  26011. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26012. }
  26013. ,
  26014. n.prototype.detectMaxNavPanoSize = function() {
  26015. var e = this.detectMaxNavPanoSizeClass();
  26016. return this.getPanoSize(e)
  26017. }
  26018. ,
  26019. n.prototype.detectMaxZoomPanoSize = function() {
  26020. 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)
  26021. }
  26022. ,
  26023. t.exports = n
  26024. }
  26025. , {
  26026. "../constants": 8,
  26027. "../enum/ModelManagerEvents": 33,
  26028. "../enum/PanoSizeClass": 36,
  26029. "../settings": 166,
  26030. "../util/browser": 182,
  26031. "../util/showcase": 193
  26032. }],
  26033. 171: [function(A, C, e) {
  26034. (function(e) {
  26035. "use strict";
  26036. function i(e) {
  26037. this.panos = null,
  26038. this.retryMinimumTime = 1e4,
  26039. this.urls = null,
  26040. this.panoLoadCallbacks = {},
  26041. this.downloadDescriptors = {},
  26042. this.priorityQueue = [],
  26043. this.forceQueue = [],
  26044. this.activeDownloads = [],
  26045. this.qualityManager = null,
  26046. this.tilePrioritizer = null,
  26047. this.refreshInterval = null,
  26048. this.processPriorityQueue = !1,
  26049. this.concurrentDownloads = e.concurrentDownloads || 1,
  26050. this.downloadTestResults = {}
  26051. }
  26052. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26053. A("../settings")), r = (A("../objects/Panorama"),
  26054. A("../util/logger")), o = (A("../enum/Vectors"),
  26055. A("../enum/PanoSizeClass"),
  26056. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26057. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26058. Object.freeze({
  26059. Testing: 1,
  26060. Success: 2,
  26061. Fail: 3
  26062. }));
  26063. i.prototype = Object.create(l.prototype),
  26064. i.IDLE_REFRESH_DELAY = 500,
  26065. i.ACTIVE_REFRESH_DELAY = 16,
  26066. i.DOWNLOAD_RETRIES = 4,
  26067. i.prototype.init = function(e) {
  26068. this.qualityManager = e
  26069. }
  26070. ,
  26071. i.prototype.setUrls = function(e) {
  26072. this.urls = e
  26073. }
  26074. ,
  26075. i.prototype.setPanoData = function(e, t, i) {
  26076. this.panos = e,
  26077. this.imagePanos = t,
  26078. this.panoGroupId = i
  26079. }
  26080. ,
  26081. i.prototype.start = function() {
  26082. this.refreshUpdateInterval(0)
  26083. }
  26084. ,
  26085. i.prototype.stop = function() {
  26086. window.cancel(this.refreshInterval)
  26087. }
  26088. ,
  26089. i.prototype.refreshUpdateInterval = function(e) {
  26090. e = e || 0,
  26091. this.refreshInterval = window.setTimeout(function() {
  26092. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26093. }
  26094. .bind(this), e)
  26095. }
  26096. ,
  26097. i.prototype.update = function() {
  26098. var e = 0 < this.forceQueue.length;
  26099. return this.processQueueForDownloading(this.forceQueue),
  26100. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26101. 0 < this.priorityQueue.length && (e = !0),
  26102. this.processQueueForDownloading(this.priorityQueue)),
  26103. e
  26104. }
  26105. ,
  26106. i.prototype.forceQueueTilesForPano = (p = [],
  26107. f = [],
  26108. function(e, t, i, n, r, o) {
  26109. p.length = 0;
  26110. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26111. var l = a[s];
  26112. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26113. }
  26114. if (i && 0 < p.length) {
  26115. g.sortPanoTiles(p, e, i),
  26116. f.length = 0,
  26117. m.matchingTilesInDirection(e, t, i, n, r, f);
  26118. for (var c = 0, h = function(e) {
  26119. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26120. }; c < p.length; ) {
  26121. var u = p[c];
  26122. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26123. }
  26124. }
  26125. for (var d = 0; d < p.length; d++)
  26126. this.forceQueue.push(p[d]);
  26127. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26128. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26129. o && this.processQueueForDownloading(this.forceQueue, !0)
  26130. }
  26131. ),
  26132. i.prototype.clearForceQueue = function() {
  26133. this.clearQueue(this.forceQueue)
  26134. }
  26135. ,
  26136. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26137. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26138. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26139. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26140. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26141. }
  26142. ,
  26143. i.prototype.clearQueue = function(e) {
  26144. this.setStatusForAllDescriptors(e, v.None),
  26145. e.length = 0
  26146. }
  26147. ,
  26148. i.prototype.clearFromQueue = function(e, t, i) {
  26149. for (var n = 0; n < e.length; n++) {
  26150. var r = e[n];
  26151. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26152. }
  26153. }
  26154. ,
  26155. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26156. for (var i = 0; i < e.length; i++) {
  26157. var n = e[i];
  26158. n && (n.status = t)
  26159. }
  26160. }
  26161. ,
  26162. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26163. for (var i = 0; i < e.length; i++) {
  26164. var n = e[i];
  26165. n && (n.status !== t ? n.status = t : e[i] = null)
  26166. }
  26167. }
  26168. ,
  26169. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26170. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26171. , n = i[t];
  26172. return n || (n = this.buildDownloadDescriptorArray(t),
  26173. i[t] = n,
  26174. this.initTileDownloadDescriptors(n, e, t)),
  26175. n
  26176. }
  26177. ,
  26178. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26179. var t = this.downloadDescriptors[e.id];
  26180. return t || (t = {},
  26181. this.downloadDescriptors[e.id] = t),
  26182. t
  26183. }
  26184. ,
  26185. i.prototype.processQueueForDownloading = function(e, t) {
  26186. if (this.cleanupActiveDownloads(),
  26187. this.activeDownloads.length < this.concurrentDownloads || t)
  26188. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26189. var r = e.shift();
  26190. r && (this.startDownload(r),
  26191. n++)
  26192. }
  26193. }
  26194. ,
  26195. i.prototype.testDownload = function(t, e, i) {
  26196. var n = this.downloadTestResults[t];
  26197. if (n)
  26198. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26199. else {
  26200. this.downloadTestResults[t] = y.Testing;
  26201. var r = this.panos.list[0]
  26202. , o = this.getTileUrl(r.id, t, e, 0)
  26203. , a = function(e) {
  26204. this.downloadTestResults[t] = y.Success,
  26205. i(!0)
  26206. }
  26207. .bind(this)
  26208. , s = function() {
  26209. this.downloadTestResults[t] = y.Fail,
  26210. i(!1)
  26211. }
  26212. .bind(this);
  26213. this.loadImage(o, 0, a, s)
  26214. }
  26215. }
  26216. ,
  26217. i.prototype.startDownload = function(e) {
  26218. e.status = v.Downloading;
  26219. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26220. this.activeDownloads.push(e),
  26221. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26222. }
  26223. ,
  26224. i.prototype.downloadFailed = function(e, t) {}
  26225. ,
  26226. i.prototype.downloadComplete = function(e, t) {
  26227. if (e.panoGroupId === this.panoGroupId) {
  26228. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26229. e.status = v.Downloaded,
  26230. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26231. var n = {
  26232. panoId: e.pano.id,
  26233. image: t,
  26234. tileSize: e.tileSize,
  26235. panoSize: e.panoSize,
  26236. tileIndex: e.tileIndex,
  26237. faceTileIndex: e.faceTileIndex,
  26238. totalTiles: e.totalTiles,
  26239. face: e.face,
  26240. tileX: e.tileX,
  26241. tileY: e.tileY,
  26242. direction: e.direction
  26243. };
  26244. e.image = t,
  26245. this.emit(o.TileDownloadSuccess, n),
  26246. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26247. panoId: e.pano.id,
  26248. tileSize: e.tileSize,
  26249. panoSize: e.panoSize
  26250. },
  26251. this.emit(o.PanoDownloadComplete, n),
  26252. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26253. }
  26254. }
  26255. ,
  26256. i.prototype.cleanupActiveDownloads = (n = [],
  26257. function() {
  26258. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26259. var t = this.activeDownloads[e];
  26260. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26261. }
  26262. this.activeDownloads.length = 0,
  26263. this.activeDownloads.push.apply(this.activeDownloads, n)
  26264. }
  26265. ),
  26266. i.prototype.isPanoDownloaded = function(e, t) {
  26267. var i = this.getTileDownloadDescriptors(e, t);
  26268. if (i.length <= 0)
  26269. return !1;
  26270. for (var n = 0; n < i.length; n++) {
  26271. if (i[n].status !== v.Downloaded)
  26272. return !1
  26273. }
  26274. return !0
  26275. }
  26276. ,
  26277. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26278. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26279. this.panoLoadCallbacks[o] = {
  26280. onLoad: i,
  26281. onFail: n,
  26282. onProgress: r
  26283. }
  26284. }
  26285. ,
  26286. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26287. var i = e.id + ":" + t;
  26288. return this.panoLoadCallbacks[i]
  26289. }
  26290. ,
  26291. i.prototype.buildDownloadDescriptorArray = function(e) {
  26292. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26293. var r = this.buildDownloadDescriptor();
  26294. i.push(r)
  26295. }
  26296. return i
  26297. }
  26298. ,
  26299. i.prototype.buildDownloadDescriptor = function() {
  26300. return {
  26301. panoGroupId: null,
  26302. pano: null,
  26303. panoSize: -1,
  26304. tileSize: -1,
  26305. tileIndex: -1,
  26306. totalTiles: -1,
  26307. faceTileIndex: -1,
  26308. status: v.None,
  26309. url: null,
  26310. image: null,
  26311. direction: new t.Vector3,
  26312. face: -1,
  26313. cubeFace: -1,
  26314. tileX: -1,
  26315. tileY: -1
  26316. }
  26317. }
  26318. ,
  26319. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26320. for (var n = 0; n < e.length; n++) {
  26321. var r = e[n];
  26322. this.initTileDownloadDescriptor(r, t, i, n)
  26323. }
  26324. }
  26325. ,
  26326. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26327. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26328. e.face = m.getFaceForTile(i, n),
  26329. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26330. e.panoGroupId = this.panoGroupId,
  26331. e.pano = t,
  26332. e.panoSize = i,
  26333. e.tileSize = r,
  26334. e.tileIndex = n,
  26335. e.totalTiles = m.getTileCountForSize(i),
  26336. e.status = v.None,
  26337. e.image = null,
  26338. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26339. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26340. }
  26341. ,
  26342. i.prototype.getTileUrl = (c = {
  26343. 256: "256",
  26344. 512: "512",
  26345. 1024: "1k",
  26346. 2048: "2k",
  26347. 4096: "4k"
  26348. },
  26349. h = {
  26350. face: -1,
  26351. faceTileIndex: -1,
  26352. tileX: -1,
  26353. tileY: -1
  26354. },
  26355. function(e, t, i, n) {
  26356. m.getTileLocation(t, n, h);
  26357. var r = Math.floor(t / i)
  26358. , o = r * r
  26359. , a = Math.floor(n / o)
  26360. , s = "";
  26361. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26362. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26363. return d.changeIfTileGenerating(l)
  26364. }
  26365. ),
  26366. i.prototype.loadImage = function(e, t, i, n) {
  26367. s.getImage(e, t).then(function(e) {
  26368. i(e)
  26369. }).fail(n)
  26370. }
  26371. ,
  26372. C.exports = i
  26373. }
  26374. ).call(this, "/js/tile/TileDownloader.js")
  26375. }
  26376. , {
  26377. "../ab": 3,
  26378. "../enum/DownloadStatus": 24,
  26379. "../enum/GLCubeFaces": 25,
  26380. "../enum/PanoSizeClass": 36,
  26381. "../enum/TileDownloaderEvents": 45,
  26382. "../enum/Vectors": 50,
  26383. "../enum/Viewmode": 51,
  26384. "../objects/Panorama": 148,
  26385. "../settings": 166,
  26386. "../util/ajax": 181,
  26387. "../util/logger": 189,
  26388. "../util/panorama": 191,
  26389. "./TilePrioritizer": 172,
  26390. "./TileUtils": 174,
  26391. events: 202,
  26392. three: 217
  26393. }],
  26394. 172: [function(n, C, e) {
  26395. (function(e) {
  26396. "use strict";
  26397. function h(e, t, i, n, r) {
  26398. this.qualityManager = e,
  26399. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26400. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26401. this.baseSize = t,
  26402. this.standardSize = i,
  26403. this.highSize = n,
  26404. this.ultraHighSize = r,
  26405. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26406. }
  26407. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26408. n("../settings"),
  26409. n("../settings"),
  26410. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26411. n("../enum/PanoSizeClass"),
  26412. n("../enum/ModelManagerEvents"),
  26413. n("../enum/GLCubeFaces"),
  26414. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26415. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26416. new t(e),
  26417. Object.freeze({
  26418. None: 0,
  26419. DirectionalFOV: 1
  26420. }));
  26421. h.PriorityCriteria = function(e, t, i, n, r) {
  26422. this.pano = e,
  26423. this.cameraPosition = (new o.Vector3).copy(t),
  26424. this.cameraDir = (new o.Vector3).copy(i),
  26425. this.panoSpaceDir = (new o.Vector3).copy(n),
  26426. this.upcomingPanos = r,
  26427. this.copy = function(e) {
  26428. this.pano = e.pano,
  26429. this.cameraPosition.copy(e.cameraPosition),
  26430. this.cameraDir.copy(e.cameraDir),
  26431. this.panoSpaceDir.copy(e.panoSpaceDir),
  26432. this.upcomingPanos = r
  26433. }
  26434. ,
  26435. this.zoomingActive = !1
  26436. }
  26437. ,
  26438. h.DIRECTIONAL_FOV = 180,
  26439. h.DIRECTIONAL_FOV_NARROW = 120,
  26440. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26441. h.MAX_SCORED_PANOS_TOADD = 2,
  26442. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26443. h.DIRECTION_SCORE_STRICTNESS = .75,
  26444. h.appendQueue = function(e, t) {
  26445. if (e && t)
  26446. for (var i = 0; i < t.length; i++)
  26447. e.push(t[i])
  26448. }
  26449. ,
  26450. h.prototype.updateCriteria = function(e, t, i, n) {
  26451. this.priorityCriteria.pano = e,
  26452. this.priorityCriteria.cameraPosition.copy(t),
  26453. this.priorityCriteria.cameraDir.copy(i),
  26454. this.priorityCriteria.upcomingPanos = n,
  26455. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26456. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26457. }
  26458. ,
  26459. h.prototype.filterAndPrioritize = (u = [],
  26460. p = [],
  26461. f = [],
  26462. function(e, t, i) {
  26463. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26464. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26465. var n = this.baseSize
  26466. , r = this.standardSize
  26467. , o = this.highSize
  26468. , a = this.ultraHighSize;
  26469. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26470. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26471. f.length = 0,
  26472. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26473. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26474. h.appendQueue(e, f),
  26475. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26476. f.length = 0,
  26477. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26478. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26479. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26480. h.appendQueue(e, f),
  26481. f.length = 0,
  26482. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26483. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26484. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26485. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26486. h.appendQueue(e, f),
  26487. this.queueTilesForPanos(e, u, i, n)
  26488. }
  26489. ),
  26490. h.prototype.canDownloadSize = function(e) {
  26491. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26492. }
  26493. ,
  26494. h.prototype.populateNeighborPanos = function(e, t, i) {
  26495. (i = i || []).length = 0;
  26496. var n = t.getNeighbours(e);
  26497. for (var r in n)
  26498. if (n.hasOwnProperty(r)) {
  26499. var o = t.get(r);
  26500. i.push(o)
  26501. }
  26502. return i
  26503. }
  26504. ,
  26505. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26506. (i = i || []).length = 0;
  26507. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26508. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26509. , s = t.sortByScore(o, a);
  26510. if (s)
  26511. for (var l = 0; l < s.length && l < r; l++) {
  26512. var c = s[l].pano;
  26513. i.push(c)
  26514. }
  26515. return i
  26516. }
  26517. ,
  26518. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26519. for (var o = 0, a = 0; a < t.length; a++) {
  26520. var s = t[a];
  26521. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26522. r && r <= o)
  26523. break
  26524. }
  26525. return o
  26526. }
  26527. ,
  26528. h.prototype.queueTilesForPano = (r = {
  26529. filter: a.None
  26530. },
  26531. function(e, t, i, n) {
  26532. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26533. }
  26534. ),
  26535. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26536. function(e, t, i, n, r, o, a, s) {
  26537. for (var l = 0, c = 0; c < i.length; c++) {
  26538. var h = i[c];
  26539. d.copy(h.position),
  26540. d.sub(r),
  26541. d.normalize();
  26542. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26543. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26544. s && s <= l))
  26545. break
  26546. }
  26547. return l
  26548. }
  26549. ),
  26550. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26551. for (var l = 0, c = 0; c < i.length; c++) {
  26552. var h = i[c];
  26553. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26554. s && s <= l)
  26555. break
  26556. }
  26557. return l
  26558. }
  26559. ,
  26560. h.prototype.queueTilesInDirectionForPano = (s = {
  26561. filter: a.DirectionalFOV,
  26562. direction: new o.Vector3,
  26563. fov: 60
  26564. },
  26565. l = new o.Vector3,
  26566. function(e, t, i, n, r, o, a) {
  26567. return l.copy(o),
  26568. m.getRelativeDirection(i.quaternion, l),
  26569. s.direction.copy(l),
  26570. s.fov = a,
  26571. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26572. }
  26573. ),
  26574. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26575. function(e, t, i, n, r) {
  26576. var o = t.getTileDownloadDescriptors(i, n);
  26577. c.length = 0,
  26578. this.filterTileDownloadDescriptors(i, o, c, r);
  26579. for (var a = 0, s = 0; s < c.length; s++) {
  26580. var l = c[s];
  26581. l && (e.push(l),
  26582. a++)
  26583. }
  26584. return a
  26585. }
  26586. ),
  26587. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26588. function(e, t, i, n) {
  26589. var r, o;
  26590. switch (n.filter) {
  26591. case a.DirectionalFOV:
  26592. for (r = 0; r < t.length; r++)
  26593. o = t[r],
  26594. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26595. break;
  26596. default:
  26597. for (r = 0; r < t.length; r++)
  26598. o = t[r],
  26599. i.push(o)
  26600. }
  26601. for (r = 0; r < i.length; r++)
  26602. o = i[r],
  26603. this.canIncludeDescriptor(o) || (i[r] = null)
  26604. }
  26605. ),
  26606. h.prototype.canIncludeDescriptor = function(e) {
  26607. return e.status !== i.Downloading && e.status !== i.Downloaded
  26608. }
  26609. ,
  26610. h.prototype.canIncludePano = function(e, t) {
  26611. return !e.isLoaded(t)
  26612. }
  26613. ,
  26614. h.getFOVDotThreshold = function(e) {
  26615. return Math.cos(o.Math.degToRad(e / 2))
  26616. }
  26617. ;
  26618. var y = (A._panoSpaceDir = new o.Vector3,
  26619. A._fovThreshold = -1,
  26620. A._fovThresholdNarrow = -1,
  26621. A);
  26622. function A(e, t) {
  26623. var i = A._panoSpaceDir
  26624. , n = A._fovThreshold
  26625. , r = A._fovThresholdNarrow
  26626. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26627. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26628. return e._dot = o,
  26629. t._dot = a,
  26630. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  26631. }
  26632. h.sortPanoTiles = function(e, t, i) {
  26633. y._panoSpaceDir.copy(i),
  26634. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26635. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26636. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26637. e.sort(y)
  26638. }
  26639. ,
  26640. h.insertSortedPanoTile = function(e, t, i, n) {
  26641. y._panoSpaceDir.copy(n),
  26642. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26643. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26644. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26645. for (var r = -1, o = 0; o < e.length; o++) {
  26646. if (y(t, e[o]) <= 0) {
  26647. r = o;
  26648. break
  26649. }
  26650. }
  26651. if (-1 === r)
  26652. e[e.length] = t;
  26653. else {
  26654. for (var a = e.length; r < a; a--)
  26655. e[a] = e[a - 1];
  26656. e[r] = t
  26657. }
  26658. }
  26659. ,
  26660. h.prototype.setZoomingActive = function(e) {
  26661. e !== this.zoomingActive && (this.zoomingActive = e)
  26662. }
  26663. ,
  26664. C.exports = h
  26665. }
  26666. ).call(this, "/js/tile/TilePrioritizer.js")
  26667. }
  26668. , {
  26669. "../enum/DownloadStatus": 24,
  26670. "../enum/GLCubeFaces": 25,
  26671. "../enum/ModelManagerEvents": 33,
  26672. "../enum/PanoSizeClass": 36,
  26673. "../enum/Vectors": 50,
  26674. "../enum/Viewmode": 51,
  26675. "../objects/Panorama": 148,
  26676. "../settings": 166,
  26677. "../util/browser": 182,
  26678. "../util/logger": 189,
  26679. "../util/math": 190,
  26680. "./TileUtils": 174,
  26681. events: 202,
  26682. three: 217
  26683. }],
  26684. 173: [function(e, t, i) {
  26685. "use strict";
  26686. function f(e, t) {
  26687. this.levels = t,
  26688. this.tileSize = e,
  26689. this.root = null,
  26690. this.allNodes = [],
  26691. function(e) {
  26692. e.root = function e(t, i, n) {
  26693. if (n > t.levels)
  26694. return null;
  26695. var r = new a(t,i);
  26696. t.allNodes.push(r);
  26697. for (var o = 0; o < s; o++)
  26698. r.children[o] = e(t, r, n + 1);
  26699. return r
  26700. }(e, null, 0)
  26701. }(this)
  26702. }
  26703. function a(e, t) {
  26704. this.tree = e,
  26705. this.parent = t,
  26706. this.children = [],
  26707. this.id = ++n
  26708. }
  26709. var g = (e("three"),
  26710. e("./TileUtils"),
  26711. e("../objects/Panorama"),
  26712. e("../util/panorama"),
  26713. e("events").EventEmitter,
  26714. 2)
  26715. , s = g * g;
  26716. f.TraversalType = Object.freeze({
  26717. PreOrder: 0,
  26718. PostOrder: 1
  26719. });
  26720. var n = 0;
  26721. f.getLevelCountForSize = function(e, t) {
  26722. var i = 0;
  26723. for (t < e && (t = e); !((t /= g) < e); )
  26724. i++;
  26725. return i
  26726. }
  26727. ,
  26728. f.getSizeForLevel = function(e, t) {
  26729. return Math.pow(g, t) * e
  26730. }
  26731. ,
  26732. f.prototype.getSubNode = function(e, t, i) {
  26733. (!t || e < this.tileSize) && (t = 0),
  26734. (!i || e < this.tileSize) && (i = 0),
  26735. e < this.tileSize && (e = this.tileSize);
  26736. var n = f.getLevelCountForSize(this.tileSize, e);
  26737. return function e(t, i, n, r, o) {
  26738. if (!t)
  26739. return null;
  26740. if (0 === n)
  26741. return t;
  26742. if (!t.children || 0 === t.children.length)
  26743. return null;
  26744. var a = Math.pow(g, n) / g
  26745. , s = r % a
  26746. , l = o % a
  26747. , c = Math.floor(o / a)
  26748. , h = Math.floor(r / a)
  26749. , u = c * g + h;
  26750. return e(t.children[u], i + 1, n - 1, s, l)
  26751. }(this.root, 0, n, t, i)
  26752. }
  26753. ,
  26754. f.prototype.breadthFirst = function(e) {
  26755. var t = !!(e = e || {}).nullLevelEnd
  26756. , i = e.maxLevel
  26757. , n = e.minLevel
  26758. , r = e.callback
  26759. , o = e.saveVisited
  26760. , a = []
  26761. , s = {}
  26762. , l = 0;
  26763. for (a.push(this.root),
  26764. a.push(s); 0 < a.length && !(i && i < l); ) {
  26765. var c = a.shift();
  26766. if (c === s)
  26767. (!n || n <= l) && (r && t && r(null),
  26768. o && t && o.push(null)),
  26769. 0 < a.length && a.push(s),
  26770. l++,
  26771. 0;
  26772. else {
  26773. if (c.children)
  26774. for (var h = 0; h < c.children.length; h++) {
  26775. c.children[h] && a.push(c.children[h])
  26776. }
  26777. var u = this.getFaceIndexFromNode(c);
  26778. (!n || n <= l) && (r && r(c, l, u),
  26779. o && o.push(c)),
  26780. 0
  26781. }
  26782. }
  26783. }
  26784. ,
  26785. f.prototype.getFaceIndexFromNode = function(e) {
  26786. if (!e)
  26787. return -1;
  26788. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26789. var o = i.parent;
  26790. if (!o)
  26791. break;
  26792. for (var a = -1, s = 0; s < o.children.length; s++)
  26793. o.children[s] === i && (a = s);
  26794. n = a % g * t + n,
  26795. r = Math.floor(a / g) * t + r,
  26796. t *= g,
  26797. i = o
  26798. }
  26799. return r * t + n
  26800. }
  26801. ,
  26802. f.prototype.depthFirst = function(e, t, i) {
  26803. !function e(t, i, n, r, o, a, s, l) {
  26804. if (t) {
  26805. s = s || f.TraversalType.PreOrder;
  26806. var c = r * g + n;
  26807. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26808. a && a.push(t)),
  26809. t.children && 0 !== t.children.length) {
  26810. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26811. for (var p = 0; p < g; p++)
  26812. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26813. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26814. a && a.push(t))
  26815. }
  26816. }
  26817. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26818. }
  26819. ,
  26820. t.exports = f
  26821. }
  26822. , {
  26823. "../objects/Panorama": 148,
  26824. "../util/panorama": 191,
  26825. "./TileUtils": 174,
  26826. events: 202,
  26827. three: 217
  26828. }],
  26829. 174: [function(e, t, i) {
  26830. "use strict";
  26831. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26832. b.TILE_SIZE = 512,
  26833. b.FACES_PER_PANO = 6,
  26834. b.LocationOnTile = {
  26835. Center: 0,
  26836. UpperLeft: 1,
  26837. UpperRight: 2,
  26838. LowerRight: 3,
  26839. LowerLeft: 4
  26840. },
  26841. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26842. var l = e / t
  26843. , c = t / e * 2
  26844. , h = c / 2
  26845. , u = n / l * 2 - 1 + h
  26846. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26847. switch (o = o || b.LocationOnTile.Center) {
  26848. case b.LocationOnTile.UpperLeft:
  26849. u -= h,
  26850. d += h,
  26851. u += a * c;
  26852. break;
  26853. case b.LocationOnTile.UpperRight:
  26854. u += h,
  26855. d += h,
  26856. d -= a * c;
  26857. break;
  26858. case b.LocationOnTile.LowerRight:
  26859. u += h,
  26860. d -= h,
  26861. u -= a * c;
  26862. break;
  26863. case b.LocationOnTile.LowerLeft:
  26864. u -= h,
  26865. d -= h,
  26866. d += a * c;
  26867. break;
  26868. case b.LocationOnTile.Center:
  26869. }
  26870. switch (i) {
  26871. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26872. _.setVector(s, -1, d, -u);
  26873. break;
  26874. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26875. _.setVector(s, 1, d, u);
  26876. break;
  26877. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26878. _.setVector(s, -u, 1, -d);
  26879. break;
  26880. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26881. _.setVector(s, -u, -1, d);
  26882. break;
  26883. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26884. _.setVector(s, -u, d, 1);
  26885. break;
  26886. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26887. _.setVector(s, u, d, -1)
  26888. }
  26889. _.normalize(s)
  26890. }
  26891. ,
  26892. b.getFaceForTile = function(e, t) {
  26893. var i = b.TILE_SIZE;
  26894. e < b.TILE_SIZE && (i = e);
  26895. var n = Math.floor(e / i)
  26896. , r = n * n;
  26897. return Math.floor(t / r)
  26898. }
  26899. ,
  26900. b.getTileLocation = function(e, t, i) {
  26901. var n = b.TILE_SIZE;
  26902. e < b.TILE_SIZE && (n = e);
  26903. var r = b.getFaceForTile(e, t)
  26904. , o = Math.floor(e / n)
  26905. , a = t - r * (o * o);
  26906. i.tileX = a % o,
  26907. i.tileY = Math.floor(a / o),
  26908. i.face = r,
  26909. i.faceTileIndex = a
  26910. }
  26911. ,
  26912. b.getTileCountForSize = function(e) {
  26913. if (e <= b.TILE_SIZE)
  26914. return b.FACES_PER_PANO;
  26915. var t = Math.floor(e / b.TILE_SIZE);
  26916. return t * t * b.FACES_PER_PANO
  26917. }
  26918. ,
  26919. b.getRelativeDirection = (r = new _.Matrix4,
  26920. o = new _.Quaternion,
  26921. function(e, t) {
  26922. o.copy(e),
  26923. o.inverse(),
  26924. r.makeRotationFromQuaternion(o),
  26925. r.applyToVector3(t),
  26926. _.normalize(t)
  26927. }
  26928. ),
  26929. b.matchingTilesInDirection = (c = new _.Vector3,
  26930. h = new _.Vector3(0,0,-1),
  26931. u = new _.Quaternion,
  26932. l = {
  26933. face: -1,
  26934. faceTileIndex: -1,
  26935. tileX: -1,
  26936. tileY: -1
  26937. },
  26938. d = function(e, t, i) {
  26939. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26940. b.getTileLocation(e, o, l),
  26941. t && !t(l) || (r++,
  26942. i && (a = l,
  26943. i.push({
  26944. face: a.face,
  26945. faceTileIndex: a.faceTileIndex,
  26946. tileX: a.tileX,
  26947. tileY: a.tileY
  26948. })));
  26949. var a;
  26950. return r
  26951. }
  26952. ,
  26953. function(e, t, i, n, r, o) {
  26954. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26955. if (b.getTileCountForSize(t),
  26956. !n && !r)
  26957. return d(t, null, o);
  26958. var s = !!r;
  26959. return r = r || n,
  26960. r = Math.max(0, Math.min(r, 360)),
  26961. n = Math.max(0, Math.min(n, 360)),
  26962. _.copyVector(i, c),
  26963. b.getRelativeDirection(e.quaternion, c),
  26964. s ? (u.setFromUnitVectors(c, h),
  26965. d(t, function(e) {
  26966. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26967. }, o)) : d(t, function(e) {
  26968. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26969. }, o)
  26970. }
  26971. ),
  26972. b.isTileWithinFrustum = (E = new _.Vector3,
  26973. function(e, t, i, n, r, o, a, s) {
  26974. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  26975. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26976. _.applyQuaternionToVector(o, E),
  26977. -1e-5 <= E.z)
  26978. ;
  26979. else {
  26980. var A = -1 / E.z
  26981. , C = E.x * A
  26982. , I = E.y * A;
  26983. l < I ? p++ : I < c && f++,
  26984. h < C ? g++ : C < u && m++,
  26985. v++
  26986. }
  26987. return f !== v && p !== v && g !== v && m !== v
  26988. }
  26989. ),
  26990. b.isTileWithinFOV = (p = new _.Vector3,
  26991. f = new _.Vector3(0,1,0),
  26992. g = new _.Vector3(1,0,0),
  26993. function(e, t, i, n, r, o, a) {
  26994. var s = b.mapFaceToCubemapFace(i);
  26995. if (_.cross(o, f, g),
  26996. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26997. b.isWithinFOV(p, o, a, null))
  26998. return !0;
  26999. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27000. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27001. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27002. b.isWithinFOV(p, o, a, null))
  27003. return !0;
  27004. h += l
  27005. }
  27006. return !1
  27007. }
  27008. ),
  27009. b.isWithinFOV = (a = new _.Vector3,
  27010. s = new _.Vector3,
  27011. function(e, t, i, n) {
  27012. if (_.copyVector(e, s),
  27013. n) {
  27014. _.copyVector(n, a),
  27015. _.normalize(a);
  27016. var r = _.dot(a, e);
  27017. a.x *= r,
  27018. a.y *= r,
  27019. a.z *= r,
  27020. _.subVector(s, a)
  27021. }
  27022. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27023. return Math.cos(o) <= _.dot(s, t)
  27024. }
  27025. ),
  27026. b.mapFaceToCubemapFace = (n = {
  27027. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27028. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27029. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27030. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27031. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27032. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27033. },
  27034. function(e) {
  27035. return n[e]
  27036. }
  27037. ),
  27038. t.exports = b
  27039. }
  27040. , {
  27041. "../enum/GLCubeFaces": 25,
  27042. "../util/MathLight": 176
  27043. }],
  27044. 175: [function(i, n, e) {
  27045. (function(e) {
  27046. "use strict";
  27047. function t() {
  27048. this.list = [],
  27049. this.index = {},
  27050. Object.defineProperty(this, "length", {
  27051. get: function() {
  27052. return this.list.length
  27053. }
  27054. })
  27055. }
  27056. new (i("./common"),
  27057. i("./logger"))(e),
  27058. t.prototype.forEach = function(e) {
  27059. this.list.forEach(e)
  27060. }
  27061. ,
  27062. t.prototype.add = function(e) {
  27063. this.list.push(e),
  27064. this.index[this.getIndex(e)] = e
  27065. }
  27066. ,
  27067. t.prototype.getIndex = function(e) {
  27068. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27069. }
  27070. ,
  27071. t.prototype.extend = function(e) {
  27072. for (var t = 0; t < e.length; t++)
  27073. this.add(e[t])
  27074. }
  27075. ,
  27076. t.prototype.get = function(e) {
  27077. return this.index[e]
  27078. }
  27079. ,
  27080. t.prototype.first = function() {
  27081. return this.list[0]
  27082. }
  27083. ,
  27084. t.prototype.last = function() {
  27085. return this.list[this.list.length - 1]
  27086. }
  27087. ,
  27088. t.prototype.reIndex = function() {
  27089. this.index = {};
  27090. var t = this;
  27091. this.forEach(function(e) {
  27092. t.index[t.getIndex(e)] = e
  27093. })
  27094. }
  27095. ,
  27096. t.prototype.filter = function(e) {
  27097. var t = this.list.filter(e);
  27098. return this.reIndex(),
  27099. t
  27100. }
  27101. ,
  27102. t.prototype.reduce = function(e, t) {
  27103. return this.list.reduce(e, t)
  27104. }
  27105. ,
  27106. t.prototype.sort = function(e) {
  27107. return this.list.sort(e)
  27108. }
  27109. ,
  27110. t.prototype.indexOf = function(e) {
  27111. for (var t = 0; t < this.list.length; ++t)
  27112. if (this.list[t] === e)
  27113. return t;
  27114. return -1
  27115. }
  27116. ,
  27117. n.exports = t
  27118. }
  27119. ).call(this, "/js/util/IndexedCollection.js")
  27120. }
  27121. , {
  27122. "./common": 185,
  27123. "./logger": 189
  27124. }],
  27125. 176: [function(e, t, i) {
  27126. "use strict";
  27127. e("../constants");
  27128. var n, r, o = {};
  27129. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27130. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27131. o.Vector3 = function(e, t, i) {
  27132. this.x = e || 0,
  27133. this.y = t || 0,
  27134. this.z = i || 0
  27135. }
  27136. ,
  27137. o.Matrix4 = function() {
  27138. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27139. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27140. }
  27141. ,
  27142. o.Matrix4.prototype = {
  27143. identity: function() {
  27144. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27145. this
  27146. },
  27147. copy: function(e) {
  27148. return this.elements.set(e.elements),
  27149. this
  27150. },
  27151. applyToVector3: function(e) {
  27152. var t = e.x
  27153. , i = e.y
  27154. , n = e.z
  27155. , r = this.elements;
  27156. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27157. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27158. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27159. this
  27160. },
  27161. getInverse: function(e, t) {
  27162. var i = this.elements
  27163. , n = e.elements
  27164. , r = n[0]
  27165. , o = n[1]
  27166. , a = n[2]
  27167. , s = n[3]
  27168. , l = n[4]
  27169. , c = n[5]
  27170. , h = n[6]
  27171. , u = n[7]
  27172. , d = n[8]
  27173. , p = n[9]
  27174. , f = n[10]
  27175. , g = n[11]
  27176. , m = n[12]
  27177. , v = n[13]
  27178. , y = n[14]
  27179. , A = n[15]
  27180. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27181. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27182. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27183. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27184. , b = r * C + o * I + a * E + s * _;
  27185. if (0 == b) {
  27186. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27187. if (t)
  27188. throw new Error(w);
  27189. return console.warn(w),
  27190. this.identity()
  27191. }
  27192. var T = 1 / b;
  27193. return i[0] = C * T,
  27194. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27195. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27196. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27197. i[4] = I * T,
  27198. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27199. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27200. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27201. i[8] = E * T,
  27202. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27203. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27204. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27205. i[12] = _ * T,
  27206. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27207. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27208. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27209. this
  27210. },
  27211. makeRotationFromQuaternion: function(e) {
  27212. var t = this.elements
  27213. , i = e.x
  27214. , n = e.y
  27215. , r = e.z
  27216. , o = e.w
  27217. , a = i + i
  27218. , s = n + n
  27219. , l = r + r
  27220. , c = i * a
  27221. , h = i * s
  27222. , u = i * l
  27223. , d = n * s
  27224. , p = n * l
  27225. , f = r * l
  27226. , g = o * a
  27227. , m = o * s
  27228. , v = o * l;
  27229. return t[0] = 1 - (d + f),
  27230. t[4] = h - v,
  27231. t[8] = u + m,
  27232. t[1] = h + v,
  27233. t[5] = 1 - (c + f),
  27234. t[9] = p - g,
  27235. t[2] = u - m,
  27236. t[6] = p + g,
  27237. t[10] = 1 - (c + d),
  27238. t[3] = 0,
  27239. t[7] = 0,
  27240. t[11] = 0,
  27241. t[12] = 0,
  27242. t[13] = 0,
  27243. t[14] = 0,
  27244. t[15] = 1,
  27245. this
  27246. }
  27247. },
  27248. o.Quaternion = function(e, t, i, n) {
  27249. this._x = e || 0,
  27250. this._y = t || 0,
  27251. this._z = i || 0,
  27252. this._w = void 0 !== n ? n : 1
  27253. }
  27254. ,
  27255. o.Quaternion.prototype = {
  27256. get x() {
  27257. return this._x
  27258. },
  27259. set x(e) {
  27260. this._x = e
  27261. },
  27262. get y() {
  27263. return this._y
  27264. },
  27265. set y(e) {
  27266. this._y = e
  27267. },
  27268. get z() {
  27269. return this._z
  27270. },
  27271. set z(e) {
  27272. this._z = e
  27273. },
  27274. get w() {
  27275. return this._w
  27276. },
  27277. set w(e) {
  27278. this._w = e
  27279. },
  27280. copy: function(e) {
  27281. this._x = e.x,
  27282. this._y = e.y,
  27283. this._z = e.z,
  27284. this._w = e.w
  27285. },
  27286. inverse: function() {
  27287. return this.conjugate().normalize()
  27288. },
  27289. conjugate: function() {
  27290. return this._x *= -1,
  27291. this._y *= -1,
  27292. this._z *= -1,
  27293. this
  27294. },
  27295. length: function() {
  27296. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27297. },
  27298. normalize: function() {
  27299. var e = this.length();
  27300. return 0 === e ? (this._x = 0,
  27301. this._y = 0,
  27302. this._z = 0,
  27303. this._w = 1) : (e = 1 / e,
  27304. this._x = this._x * e,
  27305. this._y = this._y * e,
  27306. this._z = this._z * e,
  27307. this._w = this._w * e),
  27308. this
  27309. },
  27310. setFromAxisAngle: function(e, t) {
  27311. var i = t / 2
  27312. , n = Math.sin(i);
  27313. return this._x = e.x * n,
  27314. this._y = e.y * n,
  27315. this._z = e.z * n,
  27316. this._w = Math.cos(i),
  27317. this
  27318. },
  27319. setFromUnitVectors: function(e, t) {
  27320. return void 0 === n && (n = new o.Vector3),
  27321. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27322. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27323. this._x = n.x,
  27324. this._y = n.y,
  27325. this._z = n.z,
  27326. this._w = r,
  27327. this.normalize()
  27328. },
  27329. multiply: function(e) {
  27330. return this.multiplyQuaternions(this, e)
  27331. },
  27332. premultiply: function(e) {
  27333. return this.multiplyQuaternions(e, this)
  27334. },
  27335. multiplyQuaternions: function(e, t) {
  27336. var i = e._x
  27337. , n = e._y
  27338. , r = e._z
  27339. , o = e._w
  27340. , a = t._x
  27341. , s = t._y
  27342. , l = t._z
  27343. , c = t._w;
  27344. return this._x = i * c + o * a + n * l - r * s,
  27345. this._y = n * c + o * s + r * a - i * l,
  27346. this._z = r * c + o * l + i * s - n * a,
  27347. this._w = o * c - i * a - n * s - r * l,
  27348. this
  27349. }
  27350. },
  27351. o.convertWorkshopVector = function(e) {
  27352. return new o.Vector3(-e.x,e.y,e.z)
  27353. }
  27354. ,
  27355. o.convertWorkshopQuaternion = function(e) {
  27356. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27357. }
  27358. ,
  27359. o.convertWorkshopOrthoZoom = function(e) {
  27360. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27361. }
  27362. ,
  27363. o.convertWorkshopPanoramaQuaternion = function(e) {
  27364. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27365. }
  27366. ,
  27367. o.normalize = function(e) {
  27368. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27369. , i = Math.sqrt(t);
  27370. e.x /= i,
  27371. e.y /= i,
  27372. e.z /= i
  27373. }
  27374. ,
  27375. o.dot = function(e, t) {
  27376. return e.x * t.x + e.y * t.y + e.z * t.z
  27377. }
  27378. ,
  27379. o.cross = function(e, t, i) {
  27380. var n = e.x
  27381. , r = e.y
  27382. , o = e.z;
  27383. i.x = r * t.z - o * t.y,
  27384. i.y = o * t.x - n * t.z,
  27385. i.z = n * t.y - r * t.x
  27386. }
  27387. ,
  27388. o.setVector = function(e, t, i, n) {
  27389. e.x = t,
  27390. e.y = i,
  27391. e.z = n
  27392. }
  27393. ,
  27394. o.copyVector = function(e, t) {
  27395. t.x = e.x,
  27396. t.y = e.y,
  27397. t.z = e.z
  27398. }
  27399. ,
  27400. o.addVector = function(e, t) {
  27401. e.x += t.x,
  27402. e.y += t.y,
  27403. e.z += t.z
  27404. }
  27405. ,
  27406. o.subVector = function(e, t) {
  27407. e.x -= t.x,
  27408. e.y -= t.y,
  27409. e.z -= t.z
  27410. }
  27411. ,
  27412. o.applyQuaternionToVector = function(e, t) {
  27413. var i = t.x
  27414. , n = t.y
  27415. , r = t.z
  27416. , o = e.x
  27417. , a = e.y
  27418. , s = e.z
  27419. , l = e.w
  27420. , c = l * i + a * r - s * n
  27421. , h = l * n + s * i - o * r
  27422. , u = l * r + o * n - a * i
  27423. , d = -o * i - a * n - s * r;
  27424. t.x = c * l + d * -o + h * -s - u * -a,
  27425. t.y = h * l + d * -a + u * -o - c * -s,
  27426. t.z = u * l + d * -s + c * -a - h * -o
  27427. }
  27428. ,
  27429. o.angleBetweenVectors = function(e, t) {
  27430. return Math.acos(o.dot(e, t))
  27431. }
  27432. ,
  27433. t.exports = o
  27434. }
  27435. , {
  27436. "../constants": 8
  27437. }],
  27438. 177: [function(c, h, e) {
  27439. (function(e) {
  27440. "use strict";
  27441. function t(e) {
  27442. this.cache = null,
  27443. this.expires = 0
  27444. }
  27445. function i() {
  27446. this.baseUrl = null,
  27447. this.cache = null,
  27448. this.expires = 0
  27449. }
  27450. function n() {
  27451. this.baseUrl = null,
  27452. this.expires = 0
  27453. }
  27454. function r(e) {
  27455. this.initialLoadingPromise = null,
  27456. this.endpoint = e + "?type=3",
  27457. this.urlContainer = null,
  27458. this.authorizationHeader = s.getAuthorizationHeader(),
  27459. this.containerClasses = [n, i, t]
  27460. }
  27461. c("./ajax");
  27462. var o = c("./logger")
  27463. , a = c("../constants")
  27464. , s = c("./showcase")
  27465. , l = (c("../ab"),
  27466. new o(e));
  27467. t.prototype = {
  27468. version: 1,
  27469. validate: function(e) {
  27470. return "catalog.json"in e && 0 < Object.keys(e).length
  27471. },
  27472. update: function(e) {
  27473. return this.cache = e,
  27474. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27475. $.when()
  27476. },
  27477. get: function(e) {
  27478. return this.cache[e]
  27479. }
  27480. },
  27481. i.prototype = {
  27482. version: 2,
  27483. validate: function(e) {
  27484. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27485. },
  27486. update: function(e) {
  27487. return this.baseUrl = e["base.url"],
  27488. this.cache = e,
  27489. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27490. $.when()
  27491. },
  27492. get: function(e) {
  27493. var t = this.cache[e];
  27494. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27495. }
  27496. },
  27497. n.prototype = {
  27498. version: 3,
  27499. validate: function(e) {
  27500. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27501. },
  27502. update: function(e) {
  27503. return this.baseUrl = e.templates[0],
  27504. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27505. $.when()
  27506. },
  27507. get: function(e) {
  27508. return this.baseUrl.replace("{{filename}}", e)
  27509. }
  27510. },
  27511. r.prototype = {
  27512. init: function() {
  27513. return this.initialLoadingPromise || (setInterval(function() {
  27514. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27515. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27516. this.refresh().done(function() {
  27517. l.debug("Refreshed")
  27518. }).fail(function() {
  27519. l.error("Failed url refresh, urls might go stale soon")
  27520. }))
  27521. }
  27522. .bind(this), a.signedUrlCheckInterval),
  27523. this.initialLoadingPromise = this.refresh()),
  27524. this.initialLoadingPromise
  27525. },
  27526. refresh: function(e) {
  27527. return {},
  27528. $.Deferred().resolve()
  27529. },
  27530. get: function(e) {
  27531. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27532. }
  27533. },
  27534. h.exports = r
  27535. }
  27536. ).call(this, "/js/util/ModelUrls.js")
  27537. }
  27538. , {
  27539. "../ab": 3,
  27540. "../constants": 8,
  27541. "./ajax": 181,
  27542. "./logger": 189,
  27543. "./showcase": 193
  27544. }],
  27545. 178: [function(l, c, e) {
  27546. (function(e) {
  27547. "use strict";
  27548. function t() {
  27549. i.call(this),
  27550. this.neighbourMap = {},
  27551. this.map = null
  27552. }
  27553. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  27554. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27555. n.inherit(t, i),
  27556. t.prototype.getIndex = function(e) {
  27557. return e.id
  27558. }
  27559. ,
  27560. t.prototype.find = function(e, t) {
  27561. var i = n.filterAll(this.list, e);
  27562. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27563. i = n.stableSort(i, e)
  27564. }),
  27565. i[0])
  27566. }
  27567. ,
  27568. t.prototype.sortByScore = function(e, t) {
  27569. var i = n.filterAll(this.list, e);
  27570. return 0 === i.length ? null : i = i.map(function(i) {
  27571. return {
  27572. pano: i,
  27573. score: t.reduce(function(e, t) {
  27574. return e + t(i)
  27575. }, 0)
  27576. }
  27577. }).sort(function(e, t) {
  27578. return t.score - e.score
  27579. })
  27580. }
  27581. ,
  27582. t.prototype.lowestByScore = function(e, t, i) {
  27583. return this.findRankedByScore(0, e, t, i)
  27584. }
  27585. ,
  27586. t.prototype.findRankedByScore = function(e, t, i, n) {
  27587. n && (n.candidates = null,
  27588. n.pano = null),
  27589. e = e || 0;
  27590. var r = this.sortByScore(t, i);
  27591. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27592. n.pano = r[e].pano),
  27593. r[e].pano)
  27594. }
  27595. ,
  27596. t.prototype.showPanoScores = function(e) {
  27597. this.list.forEach(function(e) {
  27598. e.removeTextSprite()
  27599. });
  27600. var t = 6344768;
  27601. e.forEach(function(e) {
  27602. e.pano.addTextSprite(e.score.toFixed(2), t),
  27603. t = 16428055
  27604. })
  27605. }
  27606. ,
  27607. t.prototype.isNeighbour = function(e, t) {
  27608. return this.neighbourMap[e.id][t.id]
  27609. }
  27610. ,
  27611. t.prototype.getNeighbours = function(e) {
  27612. return this.neighbourMap[e.id]
  27613. }
  27614. ,
  27615. t.prototype.setNeighbour = function(e, t, i) {
  27616. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27617. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27618. this.neighbourMap[e.id][e.id] = !0,
  27619. this.neighbourMap[t.id][t.id] = !0,
  27620. this.neighbourMap[e.id][t.id] = i,
  27621. this.neighbourMap[t.id][e.id] = i,
  27622. this.neighbourMap[e.id]
  27623. }
  27624. ,
  27625. t.prototype.findClosest = function(e, t) {
  27626. var i = [r.filters.isPanoAligned()];
  27627. return t && i.push(r.filters.inDirection(e, t, .75)),
  27628. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27629. }
  27630. ,
  27631. t.prototype.dualNeighbors = function(e, t) {
  27632. var i, n = [];
  27633. for (i in this.neighbourMap[e.id])
  27634. this.neighbourMap[t.id][i] && n.push(i);
  27635. return n
  27636. }
  27637. ,
  27638. t.prototype.populate_path_graph = function() {
  27639. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27640. for (e = 0; e < this.list.length; e += 1) {
  27641. for (t in s = !(a = {}),
  27642. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27643. if (i[t]) {
  27644. o = this.index[t],
  27645. u.copy(r.floorPosition),
  27646. u.sub(o.floorPosition);
  27647. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27648. , p = (Math.abs(u.y),
  27649. Math.max(d, .01),
  27650. Math.max(0, Math.abs(u.y) - .2));
  27651. n = 0 < p ? (1,
  27652. p = Math.pow(4 * p, 2),
  27653. d = Math.pow(d, 2),
  27654. Math.sqrt(p * p + d * d)) : (1,
  27655. u.length()),
  27656. a[o.id] = n,
  27657. s = !0
  27658. }
  27659. s ? c[r.id] = a : h += 1
  27660. }
  27661. this.map = c,
  27662. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27663. }
  27664. ,
  27665. t.prototype.aStarSearch = function(e, t) {
  27666. var i = Date.now()
  27667. , n = new o({
  27668. start: e,
  27669. isEnd: function(e) {
  27670. return e === t
  27671. },
  27672. neighbor: function(e) {
  27673. var t = e.neighbourPanos || e.findNeighourPanos()
  27674. , i = [];
  27675. for (var n in t)
  27676. i.push(this.index[n]);
  27677. return i
  27678. }
  27679. .bind(this),
  27680. distance: function(e, t) {
  27681. return this.map[e.id][t.id]
  27682. }
  27683. .bind(this),
  27684. heuristic: function(e, t) {
  27685. return 1
  27686. }
  27687. .bind(this),
  27688. hash: function(e) {
  27689. return e.id
  27690. },
  27691. timeout: 5e3
  27692. });
  27693. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27694. "success" !== n.status)
  27695. return T.debug("Did not find A* path from " + e + " to " + t),
  27696. null;
  27697. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27698. var r = [];
  27699. return n.path.forEach(function(e) {
  27700. r.push(e.id)
  27701. }),
  27702. r
  27703. }
  27704. ,
  27705. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27706. g = new w.Vector3,
  27707. m = new w.Vector3,
  27708. v = new w.Vector3,
  27709. y = new w.Vector3,
  27710. A = new w.Vector3,
  27711. C = new w.Vector3,
  27712. I = new w.Vector3,
  27713. E = [],
  27714. _ = new w.Vector3,
  27715. b = new w.Vector3,
  27716. function(e, t) {
  27717. if (e)
  27718. for (var i = function(e, t, i) {
  27719. return y.copy(t).sub(e),
  27720. y.dot(i)
  27721. }, n = function(e, t) {
  27722. return i(_, e.position, m) - i(_, t.position, m)
  27723. }, r = 0; r < e.length - 1; ) {
  27724. var o = e[r]
  27725. , a = e[r + 1]
  27726. , s = this.index[o]
  27727. , l = this.index[a];
  27728. _.copy(s.position),
  27729. b.copy(l.position),
  27730. E.length = 0,
  27731. f.copy(b).sub(_),
  27732. m.copy(f).normalize();
  27733. for (var c = 0; c < this.list.length; c++) {
  27734. var h = this.list[c];
  27735. y.copy(h.position).sub(_);
  27736. var u = y.dot(m);
  27737. 0 < u && (C.copy(m),
  27738. C.multiplyScalar(u),
  27739. A.copy(y),
  27740. A.sub(C),
  27741. A.length() < t && (g.copy(f).negate(),
  27742. v.copy(g).normalize(),
  27743. I.copy(h.position).sub(b),
  27744. 0 < I.dot(v) && E.push(h)))
  27745. }
  27746. if (0 < E.length) {
  27747. E.sort(n);
  27748. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27749. e[d] = e[d - E.length];
  27750. for (var p = 0; p < E.length; p++)
  27751. e[p + r + 1] = E[p].id
  27752. }
  27753. r += E.length + 1
  27754. }
  27755. }
  27756. ),
  27757. t.prototype.fadeMarkerOpacity = function(e, t) {
  27758. var i = void 0 === e ? a.panorama.markerOpacity : e
  27759. , n = this.list.findIndex(function(e) {
  27760. return e.marker
  27761. });
  27762. if (!(n < 0)) {
  27763. var r = this.list[n].marker.material.opacity;
  27764. if (r !== e) {
  27765. var o = i - r;
  27766. s.trigger({
  27767. func: function(e, t) {
  27768. var i = r + e * o;
  27769. this.forEach(function(e) {
  27770. e.marker && (e.marker.material.opacity = i)
  27771. })
  27772. }
  27773. .bind(this),
  27774. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27775. name: "_fpm"
  27776. })
  27777. }
  27778. }
  27779. }
  27780. ,
  27781. c.exports = t
  27782. }
  27783. ).call(this, "/js/util/PanoramaCollection.js")
  27784. }
  27785. , {
  27786. "../objects/Panorama": 148,
  27787. "../settings": 166,
  27788. "./IndexedCollection": 175,
  27789. "./aStar": 180,
  27790. "./common": 185,
  27791. "./logger": 189,
  27792. "./transitions": 195,
  27793. three: 217
  27794. }],
  27795. 179: [function(e, t, i) {
  27796. "use strict";
  27797. function n() {
  27798. this.actionSequence = [],
  27799. this.actionSequenceInProgress = !1
  27800. }
  27801. function r(e, t, i, n) {
  27802. c.trackAlways("zoom_" + e, {
  27803. from: t,
  27804. to: i,
  27805. pano: n
  27806. })
  27807. }
  27808. var o, a, s, l, c = e("../analytics");
  27809. n.prototype.reset = function(e) {
  27810. this.actionSequenceInProgress = !1,
  27811. this.actionSequence.length = 0
  27812. }
  27813. ,
  27814. n.prototype.addZoomAction = (a = o = null,
  27815. s = !1,
  27816. l = function() {
  27817. if (o = null,
  27818. 0 < this.actionSequence.length) {
  27819. var e = this.actionSequence[0].start
  27820. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27821. 1 === e ? function(e, t) {
  27822. r("initial", 1, e, t)
  27823. }(t, a) : function(e, t, i) {
  27824. r("followup", e, t, i)
  27825. }(e, t, a)
  27826. }
  27827. this.reset()
  27828. }
  27829. ,
  27830. function(e, t, i) {
  27831. if (e !== t) {
  27832. s || (l = l.bind(this),
  27833. s = !0),
  27834. o && (window.clearTimeout(o),
  27835. o = null),
  27836. i === a && this.actionSequenceInProgress || (this.reset(),
  27837. a = i),
  27838. this.actionSequenceInProgress = !0;
  27839. var n = {
  27840. start: e,
  27841. end: t
  27842. };
  27843. this.actionSequence.push(n),
  27844. o = window.setTimeout(l, 150)
  27845. }
  27846. }
  27847. ),
  27848. t.exports = n
  27849. }
  27850. , {
  27851. "../analytics": 4
  27852. }],
  27853. 180: [function(e, t, i) {
  27854. "use strict";
  27855. function g(e) {
  27856. if (void 0 === e.parent)
  27857. return [e.data];
  27858. var t = g(e.parent);
  27859. return t.push(e.data),
  27860. t
  27861. }
  27862. function m(e) {
  27863. return e.toString()
  27864. }
  27865. function v(e, t) {
  27866. return e.f - t.f
  27867. }
  27868. var y = e("Set")
  27869. , A = e("heap")
  27870. , C = e("dict");
  27871. t.exports = function(e) {
  27872. void 0 === e.timeout && (e.timeout = 1 / 0);
  27873. var t = e.hash || m
  27874. , i = {
  27875. data: e.start,
  27876. g: 0,
  27877. h: e.heuristic(e.start)
  27878. }
  27879. , n = i;
  27880. i.f = i.h;
  27881. var r = new y
  27882. , o = new A(v)
  27883. , a = C();
  27884. o.push(i),
  27885. a.set(t(i.data), i);
  27886. for (var s = new Date; o.size(); ) {
  27887. if (new Date - s > e.timeout)
  27888. return {
  27889. status: "timeout",
  27890. cost: n.g,
  27891. path: g(n)
  27892. };
  27893. var l = o.pop();
  27894. if (a.delete(t(l.data)),
  27895. e.isEnd(l.data))
  27896. return {
  27897. status: "success",
  27898. cost: l.g,
  27899. path: g(l)
  27900. };
  27901. r.add(t(l.data));
  27902. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27903. var u = c[h];
  27904. if (!r.contains(t(u))) {
  27905. var d = l.g + e.distance(l.data, u)
  27906. , p = a.get(t(u))
  27907. , f = !1;
  27908. if (void 0 === p)
  27909. p = {
  27910. data: u
  27911. },
  27912. a.set(t(u), p);
  27913. else {
  27914. if (p.g < d)
  27915. continue;
  27916. f = !0
  27917. }
  27918. p.parent = l,
  27919. p.g = d,
  27920. p.h = e.heuristic(u),
  27921. p.f = d + p.h,
  27922. p.h < n.h && (n = p),
  27923. f ? o.heapify() : o.push(p)
  27924. }
  27925. }
  27926. }
  27927. return {
  27928. status: "noPath",
  27929. cost: n.g,
  27930. path: g(n)
  27931. }
  27932. }
  27933. }
  27934. , {
  27935. Set: 196,
  27936. dict: 210,
  27937. heap: 211
  27938. }],
  27939. 181: [function(i, n, e) {
  27940. (function(e) {
  27941. "use strict";
  27942. function s(e, t, i) {
  27943. function n() {
  27944. l.warn("Retrying ", t),
  27945. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27946. }
  27947. var r = function(e, t, i) {
  27948. var n = new XMLHttpRequest;
  27949. if (i && "withCredentials"in n)
  27950. n.open(e, t, i);
  27951. else if ("undefined" != typeof XDomainRequest)
  27952. (n = new XDomainRequest).open(e, t);
  27953. else {
  27954. if (i)
  27955. throw "Browser does not support CORS!";
  27956. n.open(e, t)
  27957. }
  27958. return n
  27959. }(e, t, !1);
  27960. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27961. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27962. i.responseType)
  27963. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27964. r.responseType = i.responseType;
  27965. else {
  27966. if ("image/jpeg" !== i.responseType)
  27967. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27968. r.responseType = "arraybuffer"
  27969. }
  27970. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27971. i.auth && r.setRequestHeader("Authorization", i.auth),
  27972. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27973. r.setRequestHeader("Content-Type", "application/json")),
  27974. "object" == typeof i.headers)
  27975. for (var o in i.headers)
  27976. r.setRequestHeader(o, i.headers[o]);
  27977. var a = $.Deferred();
  27978. return r.onreadystatechange = function(e) {
  27979. if (4 === this.readyState)
  27980. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27981. i.retries++,
  27982. setTimeout(n, 1e3);
  27983. else if (200 === this.status) {
  27984. var t = function(e, t) {
  27985. var i = e.response;
  27986. if ("json" === t && "object" != typeof i)
  27987. try {
  27988. i = JSON.parse(e.responseText)
  27989. } catch (e) {
  27990. return void a.reject({
  27991. error: "Failed parsing JSON"
  27992. })
  27993. }
  27994. else if ("image/jpeg" === t) {
  27995. var n = new Uint8Array(e.response)
  27996. , r = new Blob([n],{
  27997. type: "image/jpeg"
  27998. })
  27999. , o = URL.createObjectURL(r);
  28000. (i = new Image).src = o,
  28001. i.crossOrigin = "Anonymous",
  28002. i.onload = function() {
  28003. URL.revokeObjectURL(o)
  28004. }
  28005. }
  28006. return i
  28007. }(this, i.responseType);
  28008. a.resolve(t)
  28009. } else
  28010. a.reject(this)
  28011. }
  28012. ,
  28013. r.onprogress = function(e) {
  28014. a.notify(e)
  28015. }
  28016. ,
  28017. r.send(i.data),
  28018. a.promise()
  28019. }
  28020. function o(e, t) {
  28021. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28022. return t.headers && function(t) {
  28023. return Object.keys(t).sort().map(function(e) {
  28024. return {
  28025. key: e,
  28026. value: t[e]
  28027. }
  28028. })
  28029. }(t.headers).forEach(function(e) {
  28030. i += "__" + e.key + ":" + e.value
  28031. }),
  28032. i
  28033. }
  28034. var t = i("./logger")
  28035. , a = i("../ab")
  28036. , l = new t(e);
  28037. window.URL = window.URL || window.webkitURL,
  28038. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28039. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28040. n.exports = {
  28041. get: function(e, t) {
  28042. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28043. if (n) {
  28044. var r = function(e, t) {
  28045. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28046. }(e, t);
  28047. if (r)
  28048. return r
  28049. }
  28050. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28051. n && function(e, t, i) {
  28052. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28053. }(e, t, i),
  28054. i
  28055. },
  28056. post: function(e, t) {
  28057. return s("POST", e, t)
  28058. },
  28059. patch: function(e, t) {
  28060. return s("PATCH", e, t)
  28061. },
  28062. getImage: function(e, t) {
  28063. function i() {
  28064. l.warn("Retrying ", e),
  28065. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28066. }
  28067. var n = $.Deferred()
  28068. , r = new Image
  28069. , o = this;
  28070. return e = a.changeIfImageOptimzing(e),
  28071. null != t || (t = 3),
  28072. r.onerror = function() {
  28073. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28074. }
  28075. ,
  28076. r.onload = function() {
  28077. n.resolve(r)
  28078. }
  28079. ,
  28080. r.crossOrigin = "anonymous",
  28081. r.src = e,
  28082. n
  28083. }
  28084. }
  28085. }
  28086. ).call(this, "/js/util/ajax.js")
  28087. }
  28088. , {
  28089. "../ab": 3,
  28090. "./logger": 189
  28091. }],
  28092. 182: [function(e, t, i) {
  28093. "use strict";
  28094. function n(e, t) {
  28095. var i = window.navigator.userAgent.match(e);
  28096. return i = i ? i[1].split(t) : [],
  28097. {
  28098. major: parseInt(i[0]) || 0,
  28099. minor: parseInt(i[1]) || 0,
  28100. patch: parseInt(i[2]) || 0
  28101. }
  28102. }
  28103. var r = e("../exception/DeviceMismatchException");
  28104. t.exports = {
  28105. isFullscreen: function() {
  28106. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28107. },
  28108. supportsFullscreen: function() {
  28109. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28110. },
  28111. isPointerLocked: function() {
  28112. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28113. },
  28114. requestFullscreen: function(e, t) {
  28115. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28116. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28117. },
  28118. requestPointerLock: function() {
  28119. var e;
  28120. if (document.fullscreenElement)
  28121. e = document.fullscreenElement();
  28122. else if (document.mozFullscreenElement)
  28123. e = document.mozFullscreenElement();
  28124. else if (document.mozFullScreenElement)
  28125. e = document.mozFullScreenElement();
  28126. else {
  28127. if (!document.webkitFullscreenElement)
  28128. return;
  28129. e = document.webkitFullscreenElement()
  28130. }
  28131. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28132. e.requestPointerLock(),
  28133. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28134. },
  28135. exitPointerLock: function() {
  28136. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28137. document.exitPointerLock()
  28138. },
  28139. exitFullscreen: function() {
  28140. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28141. },
  28142. details: function() {
  28143. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28144. return e ? {
  28145. name: e[1],
  28146. version: parseInt(e[2]),
  28147. platform: navigator.platform
  28148. } : {}
  28149. },
  28150. is: function(e) {
  28151. return this.details() && this.details().name === e
  28152. },
  28153. inIframe: function() {
  28154. return window.parent !== window
  28155. },
  28156. aspectRatio: function() {
  28157. var e = $("#player").width() / $("#player").height();
  28158. return isFinite(e) ? e : 0
  28159. },
  28160. userAgent: function() {
  28161. return window.navigator.userAgent
  28162. },
  28163. isMobile: function() {
  28164. var e = navigator.userAgent || navigator.vendor || window.opera;
  28165. 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))
  28166. },
  28167. isLandscape: function() {
  28168. return this.isMobile && 1 < this.aspectRatio()
  28169. },
  28170. isSmallScreen: function() {
  28171. return screen.width / window.devicePixelRatio < 240
  28172. },
  28173. detectIE: function() {
  28174. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28175. },
  28176. detectSafari: function() {
  28177. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28178. },
  28179. detectFirefox: function() {
  28180. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28181. },
  28182. detectChrome: function() {
  28183. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28184. },
  28185. detectOpera: function() {
  28186. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28187. },
  28188. detectIOS: function() {
  28189. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28190. },
  28191. detectIPad: function() {
  28192. var e = window.navigator.userAgent;
  28193. return /iPad/.test(e)
  28194. },
  28195. detectIPod: function() {
  28196. var e = window.navigator.userAgent;
  28197. return /iPod/.test(e)
  28198. },
  28199. detectIPhone: function() {
  28200. var e = window.navigator.userAgent;
  28201. return /iPhone/.test(e)
  28202. },
  28203. detectAndroid: function() {
  28204. return -1 !== window.navigator.userAgent.indexOf("Android")
  28205. },
  28206. detectAndroidMobile: function() {
  28207. var e = window.navigator.userAgent;
  28208. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28209. },
  28210. detectSamsungNative: function() {
  28211. var e = window.navigator.userAgent;
  28212. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28213. },
  28214. detectSamsungS6: function() {
  28215. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28216. },
  28217. detectHUAWEI5X: function() {
  28218. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28219. },
  28220. detectWebVR: function() {
  28221. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28222. },
  28223. getVRDisplay: function() {
  28224. var t = $.Deferred();
  28225. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28226. 1 <= e.length && t.resolve(e[0]),
  28227. t.reject(null)
  28228. }),
  28229. t) : t.reject(null)
  28230. },
  28231. iosVersion: function() {
  28232. if (!this.detectIOS())
  28233. throw new r("Did not detect an iDevice");
  28234. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28235. },
  28236. androidVersion: function() {
  28237. if (!this.detectAndroid())
  28238. throw new r("Did not detect an Android based device");
  28239. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28240. },
  28241. valueFromCookie: function(e, t) {
  28242. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28243. if (!i)
  28244. return t;
  28245. var n = i[1];
  28246. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28247. },
  28248. valueFromHash: function(e, t) {
  28249. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28250. if (!i)
  28251. return t;
  28252. var n = i[1];
  28253. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28254. }
  28255. }
  28256. }
  28257. , {
  28258. "../exception/DeviceMismatchException": 56
  28259. }],
  28260. 183: [function(i, n, e) {
  28261. (function(e) {
  28262. "use strict";
  28263. var o = i("../controls/serializer")
  28264. , a = i("../util/math")
  28265. , s = i("./browser")
  28266. , l = i("../enum/Viewmode")
  28267. , t = i("../util/logger")
  28268. , c = i("three")
  28269. , h = new t(e);
  28270. n.exports = {
  28271. getStartCameraOptions: function(e, t) {
  28272. var i = function(e) {
  28273. var t = s.valueFromHash("start", "")
  28274. , i = {};
  28275. if ("" !== t) {
  28276. h.debug("Start override found in parameters, trying to parse..."),
  28277. i = function(e) {
  28278. return o.deserialize(e)
  28279. }(t) || {};
  28280. var n = s.valueFromHash("tag", null);
  28281. n && (i.tag = n),
  28282. i.panoId && (i.pano = e.get(i.panoId))
  28283. }
  28284. return i
  28285. }(t);
  28286. if (0 < Object.keys(i).length)
  28287. return i;
  28288. if (e.heroImage)
  28289. i = function(e, t) {
  28290. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28291. return {};
  28292. var i = {}
  28293. , n = e.heroImage.metadata;
  28294. h.debug("Using start position from thumbnail image"),
  28295. i.position = n.camera_position,
  28296. i.quaternion = n.camera_quaternion;
  28297. try {
  28298. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28299. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28300. } catch (e) {
  28301. h.debug(e.message)
  28302. }
  28303. return i
  28304. }(e, t);
  28305. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28306. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28307. try {
  28308. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28309. i.position = (new c.Vector3).fromArray(n.camera.position),
  28310. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28311. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28312. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28313. h.debug("Using camera_start"),
  28314. h.debug("Modeldata pano: ", i.pano.quaternion),
  28315. h.debug("Camera start pano: ", n.pano.quaternion)),
  28316. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28317. } catch (e) {
  28318. h.warn(e.message)
  28319. if(i.mode == "panorama" && !i.pano){
  28320. i.pano = t.list[0]
  28321. }
  28322. }
  28323. }
  28324. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28325. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28326. i.pano = t.findClosest(i.position) ,
  28327. i.quaternion = i.pano.quaternion),
  28328. 0 === Object.keys(i).length) {
  28329. var r = t.list[0];
  28330. r && (i.mode = l.PANORAMA,
  28331. i.pano = r,
  28332. i.position = r.position,
  28333. i.quaternion = r.quaternion,
  28334. h.info("Starting at 1st pano " + r.id))
  28335. }
  28336. return i.mode = i.mode || l.DOLLHOUSE,
  28337. i
  28338. }
  28339. }
  28340. }
  28341. ).call(this, "/js/util/camera.js")
  28342. }
  28343. , {
  28344. "../controls/serializer": 14,
  28345. "../enum/Viewmode": 51,
  28346. "../util/logger": 189,
  28347. "../util/math": 190,
  28348. "./browser": 182,
  28349. three: 217
  28350. }],
  28351. 184: [function(e, t, i) {
  28352. "use strict";
  28353. function r(e, t, i) {
  28354. var n = t
  28355. , r = i;
  28356. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28357. }
  28358. function o(e, t, i) {
  28359. var n = t
  28360. , r = i;
  28361. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28362. }
  28363. var a = e("./MathLight");
  28364. t.exports = {
  28365. clampVFOV: function(e, t, i, n) {
  28366. return t < r(e, i, n) ? o(t, i, n) : e
  28367. },
  28368. getHFOVForCamera: function(e, t, i) {
  28369. return r(e.fov, t, i)
  28370. },
  28371. getHFOVFromVFOV: r,
  28372. getVFOVFromHFOV: o
  28373. }
  28374. }
  28375. , {
  28376. "./MathLight": 176
  28377. }],
  28378. 185: [function(e, t, i) {
  28379. "use strict";
  28380. var a = e("three");
  28381. t.exports = {
  28382. delayOneFrame: function(e) {
  28383. window.setTimeout(e, 1)
  28384. },
  28385. normalizeUrl: function(e) {
  28386. return e.replace("https://", "http://")
  28387. },
  28388. domainFromUrl: function(e) {
  28389. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28390. return t ? t[3] : e
  28391. },
  28392. average: function(e, t) {
  28393. if (0 === e.length)
  28394. return null;
  28395. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28396. i += t ? e[r][t] : e[r],
  28397. n++
  28398. }
  28399. return i / n
  28400. },
  28401. countUnique: function(e) {
  28402. for (var t = {}, i = 0; i < e.length; i++)
  28403. t[e[i]] = 1 + (t[e[i]] || 0);
  28404. return Object.keys(t).length
  28405. },
  28406. averageVectors: function(e, t) {
  28407. var i = new a.Vector3;
  28408. if (0 === e.length)
  28409. return i;
  28410. for (var n = 0, r = 0; r < e.length; r++) {
  28411. var o = t ? e[r][t] : e[r];
  28412. i.add(o),
  28413. n++
  28414. }
  28415. return i.divideScalar(n)
  28416. },
  28417. equalLists: function(e, t) {
  28418. if (e.length !== t.length)
  28419. return !1;
  28420. for (var i = 0; i < e.length; i++)
  28421. if (e[i] !== t[i])
  28422. return !1;
  28423. return !0
  28424. },
  28425. lowerMedian: function(e, t) {
  28426. return 0 === e.length ? null : (t = t || 2,
  28427. e.sort(function(e, t) {
  28428. return e - t
  28429. }),
  28430. e[Math.floor(e.length / t)])
  28431. },
  28432. stableSort: function(e, n) {
  28433. return e.map(function(e, t) {
  28434. return {
  28435. value: e,
  28436. index: t
  28437. }
  28438. }).sort(function(e, t) {
  28439. var i = n(e.value, t.value);
  28440. return 0 !== i ? i : e.index - t.index
  28441. }).map(function(e) {
  28442. return e.value
  28443. })
  28444. },
  28445. filterAll: function(e, i) {
  28446. return e.filter(function(t) {
  28447. return i.every(function(e) {
  28448. return e(t)
  28449. })
  28450. })
  28451. },
  28452. formatDate: function(e) {
  28453. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28454. },
  28455. formatDatetime: function(e) {
  28456. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28457. },
  28458. randomString: function(e) {
  28459. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28460. t += i.charAt(Math.floor(Math.random() * i.length));
  28461. return t
  28462. },
  28463. uint8ToBase64: function(e, t) {
  28464. t && "number" == typeof t || (t = 8192);
  28465. for (var i = [], n = 0; n < e.length; n += t)
  28466. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28467. return btoa(i.join(""))
  28468. },
  28469. uuid4: function e(t) {
  28470. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28471. },
  28472. nth: function(e) {
  28473. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28474. },
  28475. extendObject: function(t, i) {
  28476. return Object.keys(i).forEach(function(e) {
  28477. t[e] = i[e]
  28478. }),
  28479. t
  28480. },
  28481. deepExtend: function e(t) {
  28482. t = t || {};
  28483. for (var i = 1; i < arguments.length; i++) {
  28484. var n = arguments[i];
  28485. if (n)
  28486. for (var r in n)
  28487. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28488. }
  28489. return t
  28490. },
  28491. inherit: function(e, t) {
  28492. e.prototype = Object.create(t.prototype),
  28493. e.prototype.constructor = e
  28494. },
  28495. extend: function(e, t) {
  28496. for (var i in t.prototype)
  28497. e.prototype[i] = t.prototype[i]
  28498. }
  28499. },
  28500. Math.sign = function(e) {
  28501. return e < 0 ? -1 : 1
  28502. }
  28503. }
  28504. , {
  28505. three: 217
  28506. }],
  28507. 186: [function(e, t, i) {
  28508. "use strict";
  28509. var r = {
  28510. linearTween: function(e, t, i, n) {
  28511. return i * e / n + t
  28512. },
  28513. easeInQuad: function(e, t, i, n) {
  28514. return i * (e /= n) * e + t
  28515. },
  28516. easeOutQuad: function(e, t, i, n) {
  28517. return -i * (e /= n) * (e - 2) + t
  28518. },
  28519. easeInOutQuad: function(e, t, i, n) {
  28520. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28521. },
  28522. easeInCubic: function(e, t, i, n) {
  28523. return i * (e /= n) * e * e + t
  28524. },
  28525. easeOutCubic: function(e, t, i, n) {
  28526. return e /= n,
  28527. i * (--e * e * e + 1) + t
  28528. },
  28529. easeInOutCubic: function(e, t, i, n) {
  28530. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28531. },
  28532. easeInQuart: function(e, t, i, n) {
  28533. return i * (e /= n) * e * e * e + t
  28534. },
  28535. easeOutQuart: function(e, t, i, n) {
  28536. return e /= n,
  28537. -i * (--e * e * e * e - 1) + t
  28538. },
  28539. easeInOutQuart: function(e, t, i, n) {
  28540. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28541. },
  28542. easeInQuint: function(e, t, i, n) {
  28543. return i * (e /= n) * e * e * e * e + t
  28544. },
  28545. easeOutQuint: function(e, t, i, n) {
  28546. return e /= n,
  28547. i * (--e * e * e * e * e + 1) + t
  28548. },
  28549. easeInOutQuint: function(e, t, i, n) {
  28550. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28551. },
  28552. easeInSine: function(e, t, i, n) {
  28553. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28554. },
  28555. easeOutSine: function(e, t, i, n) {
  28556. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28557. },
  28558. easeInOutSine: function(e, t, i, n) {
  28559. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28560. },
  28561. easeInExpo: function(e, t, i, n) {
  28562. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28563. },
  28564. easeOutExpo: function(e, t, i, n) {
  28565. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28566. },
  28567. easeInOutExpo: function(e, t, i, n) {
  28568. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28569. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28570. },
  28571. easeInCirc: function(e, t, i, n) {
  28572. return e /= n,
  28573. -i * (Math.sqrt(1 - e * e) - 1) + t
  28574. },
  28575. easeOutCirc: function(e, t, i, n) {
  28576. return e /= n,
  28577. e--,
  28578. i * Math.sqrt(1 - e * e) + t
  28579. },
  28580. easeInOutCirc: function(e, t, i, n) {
  28581. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28582. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28583. },
  28584. easeInElastic: function(e, t, i, n) {
  28585. var r = 1.70158
  28586. , o = 0
  28587. , a = i;
  28588. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28589. r = a < Math.abs(i) ? (a = i,
  28590. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28591. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28592. },
  28593. easeOutElastic: function(e, t, i, n) {
  28594. var r = 1.70158
  28595. , o = 0
  28596. , a = i;
  28597. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28598. r = a < Math.abs(i) ? (a = i,
  28599. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28600. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28601. },
  28602. easeInOutElastic: function(e, t, i, n) {
  28603. var r = 1.70158
  28604. , o = 0
  28605. , a = i;
  28606. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28607. r = a < Math.abs(i) ? (a = i,
  28608. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28609. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28610. },
  28611. easeInBack: function(e, t, i, n, r) {
  28612. return void 0 === r && (r = 1.70158),
  28613. i * (e /= n) * e * ((r + 1) * e - r) + t
  28614. },
  28615. easeOutBack: function(e, t, i, n, r) {
  28616. return void 0 === r && (r = 1.70158),
  28617. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28618. },
  28619. easeInOutBack: function(e, t, i, n, r) {
  28620. return void 0 === r && (r = 1.70158),
  28621. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  28622. },
  28623. easeOutBounce: function(e, t, i, n) {
  28624. 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
  28625. },
  28626. easeInBounce: function(e, t, i, n) {
  28627. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28628. },
  28629. easeInOutBounce: function(e, t, i, n) {
  28630. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  28631. }
  28632. };
  28633. t.exports = r
  28634. }
  28635. , {}],
  28636. 187: [function(e, t, i) {
  28637. "use strict";
  28638. function n() {
  28639. this.events = [],
  28640. this.valid = !1
  28641. }
  28642. var r = e("../enum/Joystick");
  28643. n.prototype.push = function(e, t) {
  28644. this.events.push({
  28645. direction: e,
  28646. pano: t
  28647. }),
  28648. this.valid = !0
  28649. }
  28650. ,
  28651. n.prototype.pop = function(e) {
  28652. var t = this.events.pop();
  28653. return this.events.length < 1 && (this.valid = !1),
  28654. t
  28655. }
  28656. ,
  28657. n.prototype.peek = function() {
  28658. return this.events.length ? this.events[this.events.length - 1] : {
  28659. direction: null,
  28660. pano: null
  28661. }
  28662. }
  28663. ,
  28664. n.prototype.invalidate = function() {
  28665. this.events = [],
  28666. this.valid = !1
  28667. }
  28668. ,
  28669. n.prototype.reversePano = function(e) {
  28670. if (!this.valid)
  28671. return null;
  28672. var t = this.peek();
  28673. return r.opposite(e) === t.direction ? (this.pop(),
  28674. t.pano) : null
  28675. }
  28676. ,
  28677. t.exports = n
  28678. }
  28679. , {
  28680. "../enum/Joystick": 29
  28681. }],
  28682. 188: [function(e, t, i) {
  28683. "use strict";
  28684. t.exports = {
  28685. vector: function(t, i) {
  28686. var n = t.clone();
  28687. return i = i.clone(),
  28688. function(e) {
  28689. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28690. }
  28691. },
  28692. quaternion: function(t, i) {
  28693. var n = t.clone();
  28694. return function(e) {
  28695. t.copy(n).slerp(i, e)
  28696. }
  28697. },
  28698. property: function(t, i, n, r) {
  28699. var o = t[i];
  28700. return function(e) {
  28701. t[i] = o * (1 - e) + n * e,
  28702. r && r(t[i])
  28703. }
  28704. },
  28705. uniform: function(t, i, n) {
  28706. var r = t.material.uniforms[i].value;
  28707. return function(e) {
  28708. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28709. }
  28710. },
  28711. matrix4: function(o, a) {
  28712. var s = o.clone();
  28713. return function(e) {
  28714. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28715. t[r] = i[r] * (1 - e) + n[r] * e
  28716. }
  28717. },
  28718. allUniforms: function(e, t, i) {
  28719. var n = e.map(function(e) {
  28720. return this.uniform(e, t, i)
  28721. }
  28722. .bind(this));
  28723. return function(t) {
  28724. n.forEach(function(e) {
  28725. e(t)
  28726. })
  28727. }
  28728. }
  28729. }
  28730. }
  28731. , {}],
  28732. 189: [function(e, t, i) {
  28733. "use strict";
  28734. function h(n) {
  28735. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28736. if (h.consoleEnabled) {
  28737. var l = function(e) {
  28738. $("#debug-console").append("<p>" + e + "</p>"),
  28739. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28740. };
  28741. e = function(e) {
  28742. l(Array.prototype.slice.call(arguments).join(" "))
  28743. }
  28744. ,
  28745. t = function(e) {
  28746. l(Array.prototype.slice.call(arguments).join(" "))
  28747. }
  28748. ,
  28749. i = function(e) {
  28750. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28751. }
  28752. ,
  28753. r = function(e) {
  28754. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28755. }
  28756. } else
  28757. console.log ? (e = console.log,
  28758. t = console.info ? console.info : console.log,
  28759. i = console.warn ? console.warn : console.log,
  28760. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28761. ;
  28762. function c(e) {
  28763. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28764. }
  28765. return {
  28766. debug: function() {
  28767. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28768. },
  28769. info: function() {
  28770. h.level >= h.levels.info && t.apply(console, c(arguments))
  28771. },
  28772. warn: function() {
  28773. (function(e, t) {
  28774. if (u) {
  28775. var i = Array.prototype.slice.call(e).join(" ");
  28776. u.captureMessage(i, {
  28777. level: t,
  28778. path: n,
  28779. timestamp: h.timestamp()
  28780. })
  28781. }
  28782. }
  28783. )(arguments, "warn"),
  28784. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28785. },
  28786. error: function() {
  28787. (function(e, t) {
  28788. if (u) {
  28789. var i = Array.prototype.slice.call(e).join(" ");
  28790. u.captureException(new Error(i), {
  28791. level: t,
  28792. path: n,
  28793. timestamp: h.timestamp()
  28794. })
  28795. }
  28796. }
  28797. )(arguments, "error"),
  28798. h.level >= h.levels.error && r.apply(console, c(arguments))
  28799. },
  28800. v3str: function(e, t) {
  28801. var i = void 0 === t ? 2 : t;
  28802. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28803. },
  28804. eulstr: function(e, t) {
  28805. var i = void 0 === t ? 2 : t;
  28806. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28807. },
  28808. time: function(e) {
  28809. h.level >= h.levels.debug && (s[e] = Date.now())
  28810. },
  28811. timeEnd: function(e) {
  28812. if (h.level >= h.levels.debug) {
  28813. var t = s[e];
  28814. if (!t)
  28815. return;
  28816. var i = (Date.now() - t) / 1e3;
  28817. this.debug(e, i + "s")
  28818. }
  28819. }
  28820. }
  28821. }
  28822. var u = window.Raven;
  28823. h.timestamp = function() {
  28824. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28825. }
  28826. ,
  28827. h.level = (h.levels = {
  28828. debug: 3,
  28829. info: 2,
  28830. warn: 1,
  28831. error: 0
  28832. }).info,
  28833. t.exports = h
  28834. }
  28835. , {}],
  28836. 190: [function(e, t, i) {
  28837. "use strict";
  28838. var o = e("three")
  28839. , r = e("../enum/GLCubeFaces");
  28840. e("../constants");
  28841. t.exports = {
  28842. convertVisionVector: function(e) {
  28843. return new o.Vector3(e.x,e.z,-e.y)
  28844. },
  28845. convertVisionQuaternion: function(e) {
  28846. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  28847. },
  28848. convertWorkshopVector: function(e) {
  28849. return new o.Vector3(-e.x,e.y,e.z)
  28850. },
  28851. convertWorkshopQuaternion: function(e) {
  28852. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28853. },
  28854. convertWorkshopPanoramaQuaternion: function(e) {
  28855. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  28856. },
  28857. convertWorkshopOrthoZoom: function(e) {
  28858. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28859. },
  28860. toPrecision: function(e, t) {
  28861. function i(e, t) {
  28862. var i = Math.pow(10, t);
  28863. return Math.round(e * i) / i
  28864. }
  28865. if (e instanceof Array) {
  28866. for (var n = 0; n < e.length; n++)
  28867. e[n] = i(e[n], t);
  28868. return e
  28869. }
  28870. return i(e, t)
  28871. },
  28872. isEmptyQuaternion: function(e) {
  28873. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28874. },
  28875. projectPositionToCanvas: function(e, t, i) {
  28876. (i = i || new o.Vector3).copy(e);
  28877. var n = .5 * $("#player").width()
  28878. , r = .5 * $("#player").height();
  28879. return i.project(t),
  28880. i.x = i.x * n + n,
  28881. i.y = -i.y * r + r,
  28882. i
  28883. },
  28884. convertScreenPositionToNDC: function(e, t, i) {
  28885. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28886. i.y = -t / $("#player").height() * 2 + 1,
  28887. i
  28888. },
  28889. constrainedTurn: function(e) {
  28890. var t = e % (2 * Math.PI);
  28891. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28892. },
  28893. getFOVDotThreshold: function(e) {
  28894. return Math.cos(o.Math.degToRad(e / 2))
  28895. },
  28896. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28897. switch (e) {
  28898. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28899. i.set(1, t.y, t.x);
  28900. break;
  28901. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28902. i.set(-1, t.y, -t.x);
  28903. break;
  28904. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28905. i.set(-t.x, 1, -t.y);
  28906. break;
  28907. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28908. i.set(-t.x, -1, t.y);
  28909. break;
  28910. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28911. i.set(-t.x, t.y, 1);
  28912. break;
  28913. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28914. i.set(t.x, t.y, -1)
  28915. }
  28916. n && i.normalize()
  28917. },
  28918. //add:
  28919. getPos2d : function(point, camera, dom){
  28920. var camera = camera ;
  28921. var dom = dom;
  28922. 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);
  28923. var x,y;
  28924. x = (pos.x + 1) / 2 * dom.clientWidth;
  28925. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  28926. var inSight = x <= dom.clientWidth && x >= 0
  28927. && y <= dom.clientHeight && y >= 0
  28928. return {
  28929. pos: new THREE.Vector2(x,y),
  28930. vector: pos,
  28931. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  28932. inSight : inSight //在屏幕范围内可见
  28933. };
  28934. },
  28935. }
  28936. }
  28937. , {
  28938. "../constants": 8,
  28939. "../enum/GLCubeFaces": 25,
  28940. three: 217
  28941. }],
  28942. 191: [function(e, t, i) {
  28943. "use strict";
  28944. function o(e) {
  28945. return r[e]
  28946. }
  28947. var n = e("../enum/GLCubeFaces")
  28948. , a = [0, 1, 2, 3, 4, 5]
  28949. , r = {
  28950. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28951. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28952. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28953. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28954. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28955. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28956. };
  28957. t.exports = {
  28958. mapFaceToCubemapFace: o,
  28959. getCubemapUrls: function(i, n, r) {
  28960. return a.map(function(e, t) {
  28961. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28962. }
  28963. .bind(this))
  28964. }
  28965. }
  28966. }
  28967. , {
  28968. "../enum/GLCubeFaces": 25
  28969. }],
  28970. 192: [function(e, t, i) {
  28971. "use strict";
  28972. t.exports = {
  28973. captureErrors: function(e, t, i) {
  28974. if ("Raven"in window) {
  28975. Raven.config(e, t).install(),
  28976. i && Raven.setTagsContext(i);
  28977. var n = console.warn
  28978. , r = console.error;
  28979. console.warn = function() {
  28980. var e = Array.prototype.slice.call(arguments);
  28981. Raven.captureMessage(e.join(" "), {
  28982. level: "warning"
  28983. }),
  28984. n.apply(console, e)
  28985. }
  28986. ,
  28987. console.error = function() {
  28988. var e = Array.prototype.slice.call(arguments);
  28989. Raven.captureException(new Error(e.join(" ")), {
  28990. level: "error"
  28991. }),
  28992. r.apply(console, e)
  28993. }
  28994. } else
  28995. console.error("Raven not found, not capturing errors.")
  28996. }
  28997. }
  28998. }
  28999. , {}],
  29000. 193: [function(c, h, e) {
  29001. (function(e) {
  29002. "use strict";
  29003. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29004. getAuthorizationHeader: function() {
  29005. var e = n.valueFromHash("auth");
  29006. if (e)
  29007. return e.replace(",", " ");
  29008. var t = n.valueFromCookie("token");
  29009. return t ? "Token " + t : null
  29010. },
  29011. parseSidUrl: function(e) {
  29012. var t, i;
  29013. if (t = g_Prefix,
  29014. (e = e || "").match(/^https?/)) {
  29015. o.parse(e);
  29016. t = g_Prefix,
  29017. i = e
  29018. } else
  29019. i = (t = g_Prefix) + "data/" + e;
  29020. return {
  29021. urlBase: t,
  29022. urlModel: i,
  29023. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29024. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29025. }
  29026. },
  29027. getModelIDFromQueryString: function() {
  29028. return n.valueFromHash("model") || n.valueFromHash("m")
  29029. },
  29030. /* normalizeModeldata: function(e, i) {
  29031. e = JSON.parse(JSON.stringify(e));
  29032. var n = null;
  29033. if (e.images.forEach(function(t) {
  29034. if (t.metadata) {
  29035. if ("string" == typeof t.metadata)
  29036. try {
  29037. t.metadata = JSON.parse(t.metadata)
  29038. } catch (e) {
  29039. s.warn("Unable to parse image metadata"),
  29040. t.metadata = null
  29041. }
  29042. else
  29043. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29044. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29045. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  29046. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29047. t.metadata.zoom = t.metadata.zoom || 1),
  29048. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29049. }
  29050. }),
  29051. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29052. var t = {};
  29053. t.pano = {
  29054. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29055. position: i.convertWorkshopVector(n.scan_position),
  29056. uuid: n.scan_id
  29057. },
  29058. t.camera = {
  29059. quaternion: n.camera_quaternion,
  29060. position: n.camera_position
  29061. },
  29062. e.startPano = t
  29063. }
  29064. return e
  29065. }, */
  29066. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29067. e = JSON.parse(JSON.stringify(e));
  29068. var i = null;
  29069. if (e.images.forEach(function(n) {
  29070. if(!n.metadata) return;
  29071. if ("string" == typeof n.metadata)
  29072. try {
  29073. n.metadata = JSON.parse(n.metadata)
  29074. } catch (e) {
  29075. s.warn("Unable to parse image metadata"),
  29076. n.metadata = null
  29077. }
  29078. else{
  29079. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29080. }
  29081. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29082. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29083. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29084. }else{
  29085. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29086. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29087. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29088. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29089. }
  29090. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29091. }),
  29092. //icon初始视角的:
  29093. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29094. var n = {};
  29095. n.pano = {
  29096. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29097. position: t.convertWorkshopVector(i.scan_position),
  29098. uuid: i.scan_id
  29099. },
  29100. n.camera = {
  29101. quaternion: i.camera_quaternion,
  29102. position: i.camera_position
  29103. },
  29104. e.startPano = n
  29105. }
  29106. return e
  29107. },
  29108. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29109. function(e) {
  29110. if (!e)
  29111. throw new Error("Vision version is required");
  29112. var t = i.exec(e);
  29113. if (null === t)
  29114. throw new Error("String is not a vision version: " + e);
  29115. return parseInt(t[1])
  29116. }
  29117. ),
  29118. modelDataPromisesTiles: function(e) {
  29119. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29120. if (t)
  29121. try {
  29122. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29123. } catch (e) {
  29124. s.warn("Invalid vision version: " + t)
  29125. }
  29126. return !1
  29127. }
  29128. };
  29129. h.exports = l
  29130. }
  29131. ).call(this, "/js/util/showcase.js")
  29132. }
  29133. , {
  29134. "../constants": 8,
  29135. "./browser": 182,
  29136. "./logger": 189,
  29137. three: 217,
  29138. url: 208
  29139. }],
  29140. 194: [function(e, t, i) {
  29141. "use strict";
  29142. var r = e("../util/ajax")
  29143. , o = e("three")
  29144. , a = e("../settings")
  29145. , s = {};
  29146. t.exports = {
  29147. load: function(e, t, i) {
  29148. var n = s[e];
  29149. return n ? t && setTimeout(function() {
  29150. t(n)
  29151. }, 1) : (n = new o.Texture,
  29152. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29153. n.magFilter = o.LinearFilter,
  29154. n.generateMipmaps = !1),
  29155. n.sourceFile = e,
  29156. s[e] = n,
  29157. r.getImage(e).then(function(e) {
  29158. n.image = e,
  29159. n.needsUpdate = !0,
  29160. t && t(n)
  29161. }).fail(i)),
  29162. n
  29163. },
  29164. loadBase64: function(e, t) {
  29165. t = t || "png";
  29166. var i = new o.Texture;
  29167. return i.image = document.createElement("img"),
  29168. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29169. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29170. i.magFilter = o.LinearFilter,
  29171. i.generateMipmaps = !1),
  29172. i.needsUpdate = !0,
  29173. i
  29174. },
  29175. isLoaded: function(e) {
  29176. return !!s[e]
  29177. }
  29178. }
  29179. window.Texture = t.exports
  29180. }
  29181. , {
  29182. "../settings": 166,
  29183. "../util/ajax": 181,
  29184. three: 217
  29185. }],
  29186. 195: [function(e, t, i) {
  29187. "use strict";
  29188. var l = e("./easing");
  29189. t.exports = {
  29190. globalDone: null,
  29191. funcs: [],
  29192. counter: 0,
  29193. uniqueID: 0,
  29194. start: function(e, t, i, n, r, o, a) {
  29195. return n = n || 0,
  29196. this.funcs.push({
  29197. func: e,
  29198. current: -n * Math.abs(t),
  29199. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29200. done: i,
  29201. easing: r || l.linearTween,
  29202. cycling: t < 0,
  29203. running: !0,
  29204. debug: n < 0,
  29205. name: o || "T" + this.counter,
  29206. id: void 0 === a ? this.counter : a,
  29207. paused: !1
  29208. }),
  29209. e(0, 16),
  29210. this.counter += 1,
  29211. e
  29212. },
  29213. trigger: function(e) {
  29214. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29215. , i = e.func || function() {}
  29216. , n = void 0 === e.duration ? 0 : e.duration;
  29217. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29218. var r = e.done || null
  29219. , o = e.easing || l.linearTween
  29220. , a = e.name || "R" + this.counter
  29221. , s = void 0 === e.id ? this.counter : e.id;
  29222. return this.start(i, n, r, t, o, a, s)
  29223. },
  29224. setTimeout: function(e, t, i) {
  29225. var n = void 0 === i ? this.counter : i;
  29226. return this.trigger({
  29227. done: e,
  29228. duration: void 0 === t ? 0 : t,
  29229. name: "O" + this.counter,
  29230. id: n
  29231. })
  29232. },
  29233. pause: function() {
  29234. this.paused = !0
  29235. },
  29236. resume: function() {
  29237. this.paused = !1
  29238. },
  29239. update: function(n) {
  29240. this.funcs.forEach(function(e) {
  29241. if (!(e.paused || (e.current += 1e3 * n,
  29242. e.current < 0)))
  29243. if (e.current >= e.duration && !e.cycling) {
  29244. var t = e.easing(1, 0, 1, 1);
  29245. e.func(t, 1e3 * n),
  29246. e.done && e.done(),
  29247. e.running = !1
  29248. } else {
  29249. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29250. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29251. e.running = !1)
  29252. }
  29253. });
  29254. var e = this.funcs.length;
  29255. this.funcs = this.funcs.filter(function(e) {
  29256. return e.running
  29257. });
  29258. var t = this.funcs.length;
  29259. if (0 < e && 0 === t && this.globalDone) {
  29260. var i = this.globalDone;
  29261. this.globalDone = null,
  29262. i()
  29263. }
  29264. },
  29265. adjustSpeed: function(e, t) {
  29266. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29267. var r = i[n];
  29268. r.duration /= t,
  29269. r.current /= t
  29270. }
  29271. },
  29272. getById: function(t) {
  29273. return this.funcs.filter(function(e) {
  29274. return t === e.id
  29275. })
  29276. },
  29277. get: function(e) {
  29278. for (var t = 0; t < this.funcs.length; t += 1)
  29279. if (this.funcs[t].func === e)
  29280. return this.funcs[t];
  29281. return null
  29282. },
  29283. isRunning: function(e) {
  29284. var t = this.get(e);
  29285. return null !== t && t.running
  29286. },
  29287. countActive: function() {
  29288. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29289. e += this.funcs[t].running;
  29290. return e
  29291. },
  29292. listActive: function() {
  29293. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29294. this.funcs[t].running && e.push(this.funcs[t].name);
  29295. return e
  29296. },
  29297. done: function(e) {
  29298. this.globalDone = e
  29299. },
  29300. cancelById: function(e) {
  29301. var t = void 0 === e ? 0 : e;
  29302. this.funcs = this.funcs.filter(function(e) {
  29303. return e.id !== t
  29304. })
  29305. },
  29306. cancel: function(t) {
  29307. this.funcs = this.funcs.filter(function(e) {
  29308. return e.func !== t
  29309. })
  29310. },
  29311. getUniqueId: function() {
  29312. return this.uniqueID -= 1,
  29313. this.uniqueID
  29314. }
  29315. }
  29316. }
  29317. , {
  29318. "./easing": 186
  29319. }],
  29320. 196: [function(e, t, i) {
  29321. function n(e) {
  29322. if (this.set = {},
  29323. this.infContains = function() {
  29324. return !0
  29325. }
  29326. ,
  29327. "object" == typeof e)
  29328. if (e instanceof Array)
  29329. for (var t = 0; t < e.length; t++)
  29330. this.set[e[t]] = !0;
  29331. else
  29332. this.set = e;
  29333. else if ("function" == typeof e)
  29334. this.infContains = e;
  29335. else if (void 0 !== e)
  29336. throw new Error("set must be either an array or an object.")
  29337. }
  29338. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29339. return !!this.set[e]
  29340. }
  29341. ,
  29342. n.prototype.add = function(e) {
  29343. if (1 == arguments.length)
  29344. this.set[e] = !0;
  29345. else
  29346. for (var t = 0; t < arguments.length; t++)
  29347. this.set[arguments[t]] = !0
  29348. }
  29349. ,
  29350. n.prototype.addAll = function(e) {
  29351. if ("object" != typeof e && !(e instanceof Array))
  29352. throw new Error("arr must be an array.");
  29353. for (var t = 0; t < e.length; t++)
  29354. this.add(e[t])
  29355. }
  29356. ,
  29357. n.prototype.delete = n.prototype.remove = function(e) {
  29358. if (1 == arguments.length)
  29359. delete this.set[e];
  29360. else
  29361. for (var t = 0; t < arguments.length; t++)
  29362. delete this.set[arguments[t]]
  29363. }
  29364. ,
  29365. n.prototype.clear = function() {
  29366. this.set = {}
  29367. }
  29368. ,
  29369. n.prototype.size = function() {
  29370. return Object.keys(this.set).length
  29371. }
  29372. ,
  29373. n.prototype.toString = function() {
  29374. return "{" + Object.keys(this.set).toString() + "}"
  29375. }
  29376. ,
  29377. n.prototype["*values"] = n.prototype.toArray = function() {
  29378. return void 0 === this.set ? [] : Object.keys(this.set)
  29379. }
  29380. }
  29381. , {}],
  29382. 197: [function(e, t, i) {}
  29383. , {}],
  29384. 198: [function(N, e, F) {
  29385. (function(e) {
  29386. "use strict";
  29387. function i() {
  29388. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29389. }
  29390. function o(e, t) {
  29391. if (i() < t)
  29392. throw new RangeError("Invalid typed array length");
  29393. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29394. e.length = t),
  29395. e
  29396. }
  29397. function u(e, t, i) {
  29398. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29399. return new u(e,t,i);
  29400. if ("number" != typeof e)
  29401. return n(this, e, t, i);
  29402. if ("string" == typeof t)
  29403. throw new Error("If encoding is specified then the first argument must be a string");
  29404. return a(this, e)
  29405. }
  29406. function n(e, t, i, n) {
  29407. if ("number" == typeof t)
  29408. throw new TypeError('"value" argument must not be a number');
  29409. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29410. if (t.byteLength,
  29411. i < 0 || t.byteLength < i)
  29412. throw new RangeError("'offset' is out of bounds");
  29413. if (t.byteLength < i + (n || 0))
  29414. throw new RangeError("'length' is out of bounds");
  29415. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29416. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29417. e
  29418. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29419. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29420. !u.isEncoding(i))
  29421. throw new TypeError('"encoding" must be a valid string encoding');
  29422. var n = 0 | c(t, i)
  29423. , r = (e = o(e, n)).write(t, i);
  29424. return r !== n && (e = e.slice(0, r)),
  29425. e
  29426. }(e, t, i) : function(e, t) {
  29427. if (u.isBuffer(t)) {
  29428. var i = 0 | l(t.length);
  29429. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29430. e
  29431. }
  29432. if (t) {
  29433. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29434. return "number" != typeof t.length || function(e) {
  29435. return e != e
  29436. }(t.length) ? o(e, 0) : s(e, t);
  29437. if ("Buffer" === t.type && L(t.data))
  29438. return s(e, t.data)
  29439. }
  29440. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29441. }(e, t)
  29442. }
  29443. function r(e) {
  29444. if ("number" != typeof e)
  29445. throw new TypeError('"size" argument must be a number');
  29446. if (e < 0)
  29447. throw new RangeError('"size" argument must not be negative')
  29448. }
  29449. function a(e, t) {
  29450. if (r(t),
  29451. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29452. !u.TYPED_ARRAY_SUPPORT)
  29453. for (var i = 0; i < t; ++i)
  29454. e[i] = 0;
  29455. return e
  29456. }
  29457. function s(e, t) {
  29458. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29459. e = o(e, i);
  29460. for (var n = 0; n < i; n += 1)
  29461. e[n] = 255 & t[n];
  29462. return e
  29463. }
  29464. function l(e) {
  29465. if (e >= i())
  29466. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29467. return 0 | e
  29468. }
  29469. function c(e, t) {
  29470. if (u.isBuffer(e))
  29471. return e.length;
  29472. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29473. return e.byteLength;
  29474. "string" != typeof e && (e = "" + e);
  29475. var i = e.length;
  29476. if (0 === i)
  29477. return 0;
  29478. for (var n = !1; ; )
  29479. switch (t) {
  29480. case "ascii":
  29481. case "latin1":
  29482. case "binary":
  29483. return i;
  29484. case "utf8":
  29485. case "utf-8":
  29486. case void 0:
  29487. return S(e).length;
  29488. case "ucs2":
  29489. case "ucs-2":
  29490. case "utf16le":
  29491. case "utf-16le":
  29492. return 2 * i;
  29493. case "hex":
  29494. return i >>> 1;
  29495. case "base64":
  29496. return M(e).length;
  29497. default:
  29498. if (n)
  29499. return S(e).length;
  29500. t = ("" + t).toLowerCase(),
  29501. n = !0
  29502. }
  29503. }
  29504. function h(e, t, i) {
  29505. var n = e[t];
  29506. e[t] = e[i],
  29507. e[i] = n
  29508. }
  29509. function d(e, t, i, n, r) {
  29510. if (0 === e.length)
  29511. return -1;
  29512. if ("string" == typeof i ? (n = i,
  29513. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29514. i = +i,
  29515. isNaN(i) && (i = r ? 0 : e.length - 1),
  29516. i < 0 && (i = e.length + i),
  29517. i >= e.length) {
  29518. if (r)
  29519. return -1;
  29520. i = e.length - 1
  29521. } else if (i < 0) {
  29522. if (!r)
  29523. return -1;
  29524. i = 0
  29525. }
  29526. if ("string" == typeof t && (t = u.from(t, n)),
  29527. u.isBuffer(t))
  29528. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29529. if ("number" == typeof t)
  29530. return t &= 255,
  29531. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  29532. throw new TypeError("val must be string, number or Buffer")
  29533. }
  29534. function p(e, t, i, n, r) {
  29535. function o(e, t) {
  29536. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29537. }
  29538. var a, s = 1, l = e.length, c = t.length;
  29539. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29540. if (e.length < 2 || t.length < 2)
  29541. return -1;
  29542. l /= s = 2,
  29543. c /= 2,
  29544. i /= 2
  29545. }
  29546. if (r) {
  29547. var h = -1;
  29548. for (a = i; a < l; a++)
  29549. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29550. if (-1 === h && (h = a),
  29551. a - h + 1 === c)
  29552. return h * s
  29553. } else
  29554. -1 !== h && (a -= a - h),
  29555. h = -1
  29556. } else
  29557. for (l < i + c && (i = l - c),
  29558. a = i; 0 <= a; a--) {
  29559. for (var u = !0, d = 0; d < c; d++)
  29560. if (o(e, a + d) !== o(t, d)) {
  29561. u = !1;
  29562. break
  29563. }
  29564. if (u)
  29565. return a
  29566. }
  29567. return -1
  29568. }
  29569. function g(e, t, i, n) {
  29570. i = Number(i) || 0;
  29571. var r = e.length - i;
  29572. n ? r < (n = Number(n)) && (n = r) : n = r;
  29573. var o = t.length;
  29574. if (o % 2 != 0)
  29575. throw new TypeError("Invalid hex string");
  29576. o / 2 < n && (n = o / 2);
  29577. for (var a = 0; a < n; ++a) {
  29578. var s = parseInt(t.substr(2 * a, 2), 16);
  29579. if (isNaN(s))
  29580. return a;
  29581. e[i + a] = s
  29582. }
  29583. return a
  29584. }
  29585. function m(e, t, i, n) {
  29586. return R(function(e) {
  29587. for (var t = [], i = 0; i < e.length; ++i)
  29588. t.push(255 & e.charCodeAt(i));
  29589. return t
  29590. }(t), e, i, n)
  29591. }
  29592. function f(e, t, i) {
  29593. i = Math.min(e.length, i);
  29594. for (var n = [], r = t; r < i; ) {
  29595. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29596. if (r + u <= i)
  29597. switch (u) {
  29598. case 1:
  29599. c < 128 && (h = c);
  29600. break;
  29601. case 2:
  29602. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29603. break;
  29604. case 3:
  29605. o = e[r + 1],
  29606. a = e[r + 2],
  29607. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29608. break;
  29609. case 4:
  29610. o = e[r + 1],
  29611. a = e[r + 2],
  29612. s = e[r + 3],
  29613. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  29614. }
  29615. null === h ? (h = 65533,
  29616. u = 1) : 65535 < h && (h -= 65536,
  29617. n.push(h >>> 10 & 1023 | 55296),
  29618. h = 56320 | 1023 & h),
  29619. n.push(h),
  29620. r += u
  29621. }
  29622. return function(e) {
  29623. var t = e.length;
  29624. if (t <= D)
  29625. return String.fromCharCode.apply(String, e);
  29626. for (var i = "", n = 0; n < t; )
  29627. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29628. return i
  29629. }(n)
  29630. }
  29631. function v(e, t, i) {
  29632. var n = "";
  29633. i = Math.min(e.length, i);
  29634. for (var r = t; r < i; ++r)
  29635. n += String.fromCharCode(127 & e[r]);
  29636. return n
  29637. }
  29638. function y(e, t, i) {
  29639. var n = "";
  29640. i = Math.min(e.length, i);
  29641. for (var r = t; r < i; ++r)
  29642. n += String.fromCharCode(e[r]);
  29643. return n
  29644. }
  29645. function A(e, t, i) {
  29646. var n, r = e.length;
  29647. (!t || t < 0) && (t = 0),
  29648. (!i || i < 0 || r < i) && (i = r);
  29649. for (var o = "", a = t; a < i; ++a)
  29650. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29651. return o
  29652. }
  29653. function C(e, t, i) {
  29654. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29655. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29656. return r
  29657. }
  29658. function I(e, t, i) {
  29659. if (e % 1 != 0 || e < 0)
  29660. throw new RangeError("offset is not uint");
  29661. if (i < e + t)
  29662. throw new RangeError("Trying to access beyond buffer length")
  29663. }
  29664. function E(e, t, i, n, r, o) {
  29665. if (!u.isBuffer(e))
  29666. throw new TypeError('"buffer" argument must be a Buffer instance');
  29667. if (r < t || t < o)
  29668. throw new RangeError('"value" argument is out of bounds');
  29669. if (i + n > e.length)
  29670. throw new RangeError("Index out of range")
  29671. }
  29672. function _(e, t, i, n) {
  29673. t < 0 && (t = 65535 + t + 1);
  29674. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29675. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29676. }
  29677. function b(e, t, i, n) {
  29678. t < 0 && (t = 4294967295 + t + 1);
  29679. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29680. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29681. }
  29682. function w(e, t, i, n) {
  29683. if (i + n > e.length)
  29684. throw new RangeError("Index out of range");
  29685. if (i < 0)
  29686. throw new RangeError("Index out of range")
  29687. }
  29688. function T(e, t, i, n, r) {
  29689. return r || w(e, 0, i, 4),
  29690. O.write(e, t, i, n, 23, 4),
  29691. i + 4
  29692. }
  29693. function x(e, t, i, n, r) {
  29694. return r || w(e, 0, i, 8),
  29695. O.write(e, t, i, n, 52, 8),
  29696. i + 8
  29697. }
  29698. function S(e, t) {
  29699. t = t || 1 / 0;
  29700. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29701. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29702. if (!r) {
  29703. if (56319 < i) {
  29704. -1 < (t -= 3) && o.push(239, 191, 189);
  29705. continue
  29706. }
  29707. if (a + 1 === n) {
  29708. -1 < (t -= 3) && o.push(239, 191, 189);
  29709. continue
  29710. }
  29711. r = i;
  29712. continue
  29713. }
  29714. if (i < 56320) {
  29715. -1 < (t -= 3) && o.push(239, 191, 189),
  29716. r = i;
  29717. continue
  29718. }
  29719. i = 65536 + (r - 55296 << 10 | i - 56320)
  29720. } else
  29721. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29722. if (r = null,
  29723. i < 128) {
  29724. if ((t -= 1) < 0)
  29725. break;
  29726. o.push(i)
  29727. } else if (i < 2048) {
  29728. if ((t -= 2) < 0)
  29729. break;
  29730. o.push(i >> 6 | 192, 63 & i | 128)
  29731. } else if (i < 65536) {
  29732. if ((t -= 3) < 0)
  29733. break;
  29734. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29735. } else {
  29736. if (!(i < 1114112))
  29737. throw new Error("Invalid code point");
  29738. if ((t -= 4) < 0)
  29739. break;
  29740. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29741. }
  29742. }
  29743. return o
  29744. }
  29745. function M(e) {
  29746. return P.toByteArray(function(e) {
  29747. if ((e = function(e) {
  29748. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29749. }(e).replace(t, "")).length < 2)
  29750. return "";
  29751. for (; e.length % 4 != 0; )
  29752. e += "=";
  29753. return e
  29754. }(e))
  29755. }
  29756. function R(e, t, i, n) {
  29757. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29758. t[r + i] = e[r];
  29759. return r
  29760. }
  29761. var P = N("base64-js")
  29762. , O = N("ieee754")
  29763. , L = N("isarray");
  29764. F.Buffer = u,
  29765. F.SlowBuffer = function(e) {
  29766. return +e != e && (e = 0),
  29767. u.alloc(+e)
  29768. }
  29769. ,
  29770. F.INSPECT_MAX_BYTES = 50,
  29771. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29772. try {
  29773. var e = new Uint8Array(1);
  29774. return e.__proto__ = {
  29775. __proto__: Uint8Array.prototype,
  29776. foo: function() {
  29777. return 42
  29778. }
  29779. },
  29780. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29781. } catch (e) {
  29782. return !1
  29783. }
  29784. }(),
  29785. F.kMaxLength = i(),
  29786. u.poolSize = 8192,
  29787. u._augment = function(e) {
  29788. return e.__proto__ = u.prototype,
  29789. e
  29790. }
  29791. ,
  29792. u.from = function(e, t, i) {
  29793. return n(null, e, t, i)
  29794. }
  29795. ,
  29796. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29797. u.__proto__ = Uint8Array,
  29798. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29799. value: null,
  29800. configurable: !0
  29801. })),
  29802. u.alloc = function(e, t, i) {
  29803. return function(e, t, i, n) {
  29804. return r(t),
  29805. 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)
  29806. }(null, e, t, i)
  29807. }
  29808. ,
  29809. u.allocUnsafe = function(e) {
  29810. return a(null, e)
  29811. }
  29812. ,
  29813. u.allocUnsafeSlow = function(e) {
  29814. return a(null, e)
  29815. }
  29816. ,
  29817. u.isBuffer = function(e) {
  29818. return !(null == e || !e._isBuffer)
  29819. }
  29820. ,
  29821. u.compare = function(e, t) {
  29822. if (!u.isBuffer(e) || !u.isBuffer(t))
  29823. throw new TypeError("Arguments must be Buffers");
  29824. if (e === t)
  29825. return 0;
  29826. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29827. if (e[r] !== t[r]) {
  29828. i = e[r],
  29829. n = t[r];
  29830. break
  29831. }
  29832. return i < n ? -1 : n < i ? 1 : 0
  29833. }
  29834. ,
  29835. u.isEncoding = function(e) {
  29836. switch (String(e).toLowerCase()) {
  29837. case "hex":
  29838. case "utf8":
  29839. case "utf-8":
  29840. case "ascii":
  29841. case "latin1":
  29842. case "binary":
  29843. case "base64":
  29844. case "ucs2":
  29845. case "ucs-2":
  29846. case "utf16le":
  29847. case "utf-16le":
  29848. return !0;
  29849. default:
  29850. return !1
  29851. }
  29852. }
  29853. ,
  29854. u.concat = function(e, t) {
  29855. if (!L(e))
  29856. throw new TypeError('"list" argument must be an Array of Buffers');
  29857. if (0 === e.length)
  29858. return u.alloc(0);
  29859. var i;
  29860. if (void 0 === t)
  29861. for (i = t = 0; i < e.length; ++i)
  29862. t += e[i].length;
  29863. var n = u.allocUnsafe(t)
  29864. , r = 0;
  29865. for (i = 0; i < e.length; ++i) {
  29866. var o = e[i];
  29867. if (!u.isBuffer(o))
  29868. throw new TypeError('"list" argument must be an Array of Buffers');
  29869. o.copy(n, r),
  29870. r += o.length
  29871. }
  29872. return n
  29873. }
  29874. ,
  29875. u.byteLength = c,
  29876. u.prototype._isBuffer = !0,
  29877. u.prototype.swap16 = function() {
  29878. var e = this.length;
  29879. if (e % 2 != 0)
  29880. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29881. for (var t = 0; t < e; t += 2)
  29882. h(this, t, t + 1);
  29883. return this
  29884. }
  29885. ,
  29886. u.prototype.swap32 = function() {
  29887. var e = this.length;
  29888. if (e % 4 != 0)
  29889. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29890. for (var t = 0; t < e; t += 4)
  29891. h(this, t, t + 3),
  29892. h(this, t + 1, t + 2);
  29893. return this
  29894. }
  29895. ,
  29896. u.prototype.swap64 = function() {
  29897. var e = this.length;
  29898. if (e % 8 != 0)
  29899. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29900. for (var t = 0; t < e; t += 8)
  29901. h(this, t, t + 7),
  29902. h(this, t + 1, t + 6),
  29903. h(this, t + 2, t + 5),
  29904. h(this, t + 3, t + 4);
  29905. return this
  29906. }
  29907. ,
  29908. u.prototype.toString = function() {
  29909. var e = 0 | this.length;
  29910. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29911. var n, r, o, a = !1;
  29912. if ((void 0 === t || t < 0) && (t = 0),
  29913. t > this.length)
  29914. return "";
  29915. if ((void 0 === i || i > this.length) && (i = this.length),
  29916. i <= 0)
  29917. return "";
  29918. if ((i >>>= 0) <= (t >>>= 0))
  29919. return "";
  29920. for (e = e || "utf8"; ; )
  29921. switch (e) {
  29922. case "hex":
  29923. return A(this, t, i);
  29924. case "utf8":
  29925. case "utf-8":
  29926. return f(this, t, i);
  29927. case "ascii":
  29928. return v(this, t, i);
  29929. case "latin1":
  29930. case "binary":
  29931. return y(this, t, i);
  29932. case "base64":
  29933. return n = this,
  29934. o = i,
  29935. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29936. case "ucs2":
  29937. case "ucs-2":
  29938. case "utf16le":
  29939. case "utf-16le":
  29940. return C(this, t, i);
  29941. default:
  29942. if (a)
  29943. throw new TypeError("Unknown encoding: " + e);
  29944. e = (e + "").toLowerCase(),
  29945. a = !0
  29946. }
  29947. }
  29948. .apply(this, arguments)
  29949. }
  29950. ,
  29951. u.prototype.equals = function(e) {
  29952. if (!u.isBuffer(e))
  29953. throw new TypeError("Argument must be a Buffer");
  29954. return this === e || 0 === u.compare(this, e)
  29955. }
  29956. ,
  29957. u.prototype.inspect = function() {
  29958. var e = ""
  29959. , t = F.INSPECT_MAX_BYTES;
  29960. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29961. this.length > t && (e += " ... ")),
  29962. "<Buffer " + e + ">"
  29963. }
  29964. ,
  29965. u.prototype.compare = function(e, t, i, n, r) {
  29966. if (!u.isBuffer(e))
  29967. throw new TypeError("Argument must be a Buffer");
  29968. if (void 0 === t && (t = 0),
  29969. void 0 === i && (i = e ? e.length : 0),
  29970. void 0 === n && (n = 0),
  29971. void 0 === r && (r = this.length),
  29972. t < 0 || i > e.length || n < 0 || r > this.length)
  29973. throw new RangeError("out of range index");
  29974. if (r <= n && i <= t)
  29975. return 0;
  29976. if (r <= n)
  29977. return -1;
  29978. if (i <= t)
  29979. return 1;
  29980. if (this === e)
  29981. return 0;
  29982. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  29983. if (l[h] !== c[h]) {
  29984. o = l[h],
  29985. a = c[h];
  29986. break
  29987. }
  29988. return o < a ? -1 : a < o ? 1 : 0
  29989. }
  29990. ,
  29991. u.prototype.includes = function(e, t, i) {
  29992. return -1 !== this.indexOf(e, t, i)
  29993. }
  29994. ,
  29995. u.prototype.indexOf = function(e, t, i) {
  29996. return d(this, e, t, i, !0)
  29997. }
  29998. ,
  29999. u.prototype.lastIndexOf = function(e, t, i) {
  30000. return d(this, e, t, i, !1)
  30001. }
  30002. ,
  30003. u.prototype.write = function(e, t, i, n) {
  30004. if (void 0 === t)
  30005. n = "utf8",
  30006. i = this.length,
  30007. t = 0;
  30008. else if (void 0 === i && "string" == typeof t)
  30009. n = t,
  30010. i = this.length,
  30011. t = 0;
  30012. else {
  30013. if (!isFinite(t))
  30014. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30015. t |= 0,
  30016. isFinite(i) ? (i |= 0,
  30017. void 0 === n && (n = "utf8")) : (n = i,
  30018. i = void 0)
  30019. }
  30020. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30021. if ((void 0 === i || p < i) && (i = p),
  30022. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30023. throw new RangeError("Attempt to write outside buffer bounds");
  30024. n = n || "utf8";
  30025. for (var f = !1; ; )
  30026. switch (n) {
  30027. case "hex":
  30028. return g(this, e, t, i);
  30029. case "utf8":
  30030. case "utf-8":
  30031. return u = t,
  30032. d = i,
  30033. R(S(e, (h = this).length - u), h, u, d);
  30034. case "ascii":
  30035. return m(this, e, t, i);
  30036. case "latin1":
  30037. case "binary":
  30038. return m(this, e, t, i);
  30039. case "base64":
  30040. return s = this,
  30041. l = t,
  30042. c = i,
  30043. R(M(e), s, l, c);
  30044. case "ucs2":
  30045. case "ucs-2":
  30046. case "utf16le":
  30047. case "utf-16le":
  30048. return o = t,
  30049. a = i,
  30050. R(function(e, t) {
  30051. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30052. i = e.charCodeAt(a),
  30053. n = i >> 8,
  30054. r = i % 256,
  30055. o.push(r),
  30056. o.push(n);
  30057. return o
  30058. }(e, (r = this).length - o), r, o, a);
  30059. default:
  30060. if (f)
  30061. throw new TypeError("Unknown encoding: " + n);
  30062. n = ("" + n).toLowerCase(),
  30063. f = !0
  30064. }
  30065. }
  30066. ,
  30067. u.prototype.toJSON = function() {
  30068. return {
  30069. type: "Buffer",
  30070. data: Array.prototype.slice.call(this._arr || this, 0)
  30071. }
  30072. }
  30073. ;
  30074. var D = 4096;
  30075. u.prototype.slice = function(e, t) {
  30076. var i, n = this.length;
  30077. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30078. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30079. t < e && (t = e),
  30080. u.TYPED_ARRAY_SUPPORT)
  30081. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30082. else {
  30083. var r = t - e;
  30084. i = new u(r,void 0);
  30085. for (var o = 0; o < r; ++o)
  30086. i[o] = this[o + e]
  30087. }
  30088. return i
  30089. }
  30090. ,
  30091. u.prototype.readUIntLE = function(e, t, i) {
  30092. e |= 0,
  30093. t |= 0,
  30094. i || I(e, t, this.length);
  30095. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30096. n += this[e + o] * r;
  30097. return n
  30098. }
  30099. ,
  30100. u.prototype.readUIntBE = function(e, t, i) {
  30101. e |= 0,
  30102. t |= 0,
  30103. i || I(e, t, this.length);
  30104. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30105. n += this[e + --t] * r;
  30106. return n
  30107. }
  30108. ,
  30109. u.prototype.readUInt8 = function(e, t) {
  30110. return t || I(e, 1, this.length),
  30111. this[e]
  30112. }
  30113. ,
  30114. u.prototype.readUInt16LE = function(e, t) {
  30115. return t || I(e, 2, this.length),
  30116. this[e] | this[e + 1] << 8
  30117. }
  30118. ,
  30119. u.prototype.readUInt16BE = function(e, t) {
  30120. return t || I(e, 2, this.length),
  30121. this[e] << 8 | this[e + 1]
  30122. }
  30123. ,
  30124. u.prototype.readUInt32LE = function(e, t) {
  30125. return t || I(e, 4, this.length),
  30126. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30127. }
  30128. ,
  30129. u.prototype.readUInt32BE = function(e, t) {
  30130. return t || I(e, 4, this.length),
  30131. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30132. }
  30133. ,
  30134. u.prototype.readIntLE = function(e, t, i) {
  30135. e |= 0,
  30136. t |= 0,
  30137. i || I(e, t, this.length);
  30138. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30139. n += this[e + o] * r;
  30140. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30141. n
  30142. }
  30143. ,
  30144. u.prototype.readIntBE = function(e, t, i) {
  30145. e |= 0,
  30146. t |= 0,
  30147. i || I(e, t, this.length);
  30148. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30149. o += this[e + --n] * r;
  30150. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30151. o
  30152. }
  30153. ,
  30154. u.prototype.readInt8 = function(e, t) {
  30155. return t || I(e, 1, this.length),
  30156. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30157. }
  30158. ,
  30159. u.prototype.readInt16LE = function(e, t) {
  30160. t || I(e, 2, this.length);
  30161. var i = this[e] | this[e + 1] << 8;
  30162. return 32768 & i ? 4294901760 | i : i
  30163. }
  30164. ,
  30165. u.prototype.readInt16BE = function(e, t) {
  30166. t || I(e, 2, this.length);
  30167. var i = this[e + 1] | this[e] << 8;
  30168. return 32768 & i ? 4294901760 | i : i
  30169. }
  30170. ,
  30171. u.prototype.readInt32LE = function(e, t) {
  30172. return t || I(e, 4, this.length),
  30173. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30174. }
  30175. ,
  30176. u.prototype.readInt32BE = function(e, t) {
  30177. return t || I(e, 4, this.length),
  30178. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30179. }
  30180. ,
  30181. u.prototype.readFloatLE = function(e, t) {
  30182. return t || I(e, 4, this.length),
  30183. O.read(this, e, !0, 23, 4)
  30184. }
  30185. ,
  30186. u.prototype.readFloatBE = function(e, t) {
  30187. return t || I(e, 4, this.length),
  30188. O.read(this, e, !1, 23, 4)
  30189. }
  30190. ,
  30191. u.prototype.readDoubleLE = function(e, t) {
  30192. return t || I(e, 8, this.length),
  30193. O.read(this, e, !0, 52, 8)
  30194. }
  30195. ,
  30196. u.prototype.readDoubleBE = function(e, t) {
  30197. return t || I(e, 8, this.length),
  30198. O.read(this, e, !1, 52, 8)
  30199. }
  30200. ,
  30201. u.prototype.writeUIntLE = function(e, t, i, n) {
  30202. e = +e,
  30203. t |= 0,
  30204. i |= 0,
  30205. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30206. var r = 1
  30207. , o = 0;
  30208. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30209. this[t + o] = e / r & 255;
  30210. return t + i
  30211. }
  30212. ,
  30213. u.prototype.writeUIntBE = function(e, t, i, n) {
  30214. e = +e,
  30215. t |= 0,
  30216. i |= 0,
  30217. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30218. var r = i - 1
  30219. , o = 1;
  30220. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30221. this[t + r] = e / o & 255;
  30222. return t + i
  30223. }
  30224. ,
  30225. u.prototype.writeUInt8 = function(e, t, i) {
  30226. return e = +e,
  30227. t |= 0,
  30228. i || E(this, e, t, 1, 255, 0),
  30229. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30230. this[t] = 255 & e,
  30231. t + 1
  30232. }
  30233. ,
  30234. u.prototype.writeUInt16LE = function(e, t, i) {
  30235. return e = +e,
  30236. t |= 0,
  30237. i || E(this, e, t, 2, 65535, 0),
  30238. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30239. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30240. t + 2
  30241. }
  30242. ,
  30243. u.prototype.writeUInt16BE = function(e, t, i) {
  30244. return e = +e,
  30245. t |= 0,
  30246. i || E(this, e, t, 2, 65535, 0),
  30247. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30248. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30249. t + 2
  30250. }
  30251. ,
  30252. u.prototype.writeUInt32LE = function(e, t, i) {
  30253. return e = +e,
  30254. t |= 0,
  30255. i || E(this, e, t, 4, 4294967295, 0),
  30256. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30257. this[t + 2] = e >>> 16,
  30258. this[t + 1] = e >>> 8,
  30259. this[t] = 255 & e) : b(this, e, t, !0),
  30260. t + 4
  30261. }
  30262. ,
  30263. u.prototype.writeUInt32BE = function(e, t, i) {
  30264. return e = +e,
  30265. t |= 0,
  30266. i || E(this, e, t, 4, 4294967295, 0),
  30267. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30268. this[t + 1] = e >>> 16,
  30269. this[t + 2] = e >>> 8,
  30270. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30271. t + 4
  30272. }
  30273. ,
  30274. u.prototype.writeIntLE = function(e, t, i, n) {
  30275. if (e = +e,
  30276. t |= 0,
  30277. !n) {
  30278. var r = Math.pow(2, 8 * i - 1);
  30279. E(this, e, t, i, r - 1, -r)
  30280. }
  30281. var o = 0
  30282. , a = 1
  30283. , s = 0;
  30284. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30285. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30286. this[t + o] = (e / a >> 0) - s & 255;
  30287. return t + i
  30288. }
  30289. ,
  30290. u.prototype.writeIntBE = function(e, t, i, n) {
  30291. if (e = +e,
  30292. t |= 0,
  30293. !n) {
  30294. var r = Math.pow(2, 8 * i - 1);
  30295. E(this, e, t, i, r - 1, -r)
  30296. }
  30297. var o = i - 1
  30298. , a = 1
  30299. , s = 0;
  30300. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30301. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30302. this[t + o] = (e / a >> 0) - s & 255;
  30303. return t + i
  30304. }
  30305. ,
  30306. u.prototype.writeInt8 = function(e, t, i) {
  30307. return e = +e,
  30308. t |= 0,
  30309. i || E(this, e, t, 1, 127, -128),
  30310. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30311. e < 0 && (e = 255 + e + 1),
  30312. this[t] = 255 & e,
  30313. t + 1
  30314. }
  30315. ,
  30316. u.prototype.writeInt16LE = function(e, t, i) {
  30317. return e = +e,
  30318. t |= 0,
  30319. i || E(this, e, t, 2, 32767, -32768),
  30320. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30321. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30322. t + 2
  30323. }
  30324. ,
  30325. u.prototype.writeInt16BE = function(e, t, i) {
  30326. return e = +e,
  30327. t |= 0,
  30328. i || E(this, e, t, 2, 32767, -32768),
  30329. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30330. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30331. t + 2
  30332. }
  30333. ,
  30334. u.prototype.writeInt32LE = function(e, t, i) {
  30335. return e = +e,
  30336. t |= 0,
  30337. i || E(this, e, t, 4, 2147483647, -2147483648),
  30338. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30339. this[t + 1] = e >>> 8,
  30340. this[t + 2] = e >>> 16,
  30341. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30342. t + 4
  30343. }
  30344. ,
  30345. u.prototype.writeInt32BE = function(e, t, i) {
  30346. return e = +e,
  30347. t |= 0,
  30348. i || E(this, e, t, 4, 2147483647, -2147483648),
  30349. e < 0 && (e = 4294967295 + e + 1),
  30350. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30351. this[t + 1] = e >>> 16,
  30352. this[t + 2] = e >>> 8,
  30353. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30354. t + 4
  30355. }
  30356. ,
  30357. u.prototype.writeFloatLE = function(e, t, i) {
  30358. return T(this, e, t, !0, i)
  30359. }
  30360. ,
  30361. u.prototype.writeFloatBE = function(e, t, i) {
  30362. return T(this, e, t, !1, i)
  30363. }
  30364. ,
  30365. u.prototype.writeDoubleLE = function(e, t, i) {
  30366. return x(this, e, t, !0, i)
  30367. }
  30368. ,
  30369. u.prototype.writeDoubleBE = function(e, t, i) {
  30370. return x(this, e, t, !1, i)
  30371. }
  30372. ,
  30373. u.prototype.copy = function(e, t, i, n) {
  30374. if (i = i || 0,
  30375. n || 0 === n || (n = this.length),
  30376. t >= e.length && (t = e.length),
  30377. t = t || 0,
  30378. 0 < n && n < i && (n = i),
  30379. n === i)
  30380. return 0;
  30381. if (0 === e.length || 0 === this.length)
  30382. return 0;
  30383. if (t < 0)
  30384. throw new RangeError("targetStart out of bounds");
  30385. if (i < 0 || i >= this.length)
  30386. throw new RangeError("sourceStart out of bounds");
  30387. if (n < 0)
  30388. throw new RangeError("sourceEnd out of bounds");
  30389. n > this.length && (n = this.length),
  30390. e.length - t < n - i && (n = e.length - t + i);
  30391. var r, o = n - i;
  30392. if (this === e && i < t && t < n)
  30393. for (r = o - 1; 0 <= r; --r)
  30394. e[r + t] = this[r + i];
  30395. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30396. for (r = 0; r < o; ++r)
  30397. e[r + t] = this[r + i];
  30398. else
  30399. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30400. return o
  30401. }
  30402. ,
  30403. u.prototype.fill = function(e, t, i, n) {
  30404. if ("string" == typeof e) {
  30405. if ("string" == typeof t ? (n = t,
  30406. t = 0,
  30407. i = this.length) : "string" == typeof i && (n = i,
  30408. i = this.length),
  30409. 1 === e.length) {
  30410. var r = e.charCodeAt(0);
  30411. r < 256 && (e = r)
  30412. }
  30413. if (void 0 !== n && "string" != typeof n)
  30414. throw new TypeError("encoding must be a string");
  30415. if ("string" == typeof n && !u.isEncoding(n))
  30416. throw new TypeError("Unknown encoding: " + n)
  30417. } else
  30418. "number" == typeof e && (e &= 255);
  30419. if (t < 0 || this.length < t || this.length < i)
  30420. throw new RangeError("Out of range index");
  30421. if (i <= t)
  30422. return this;
  30423. var o;
  30424. if (t >>>= 0,
  30425. i = void 0 === i ? this.length : i >>> 0,
  30426. "number" == typeof (e = e || 0))
  30427. for (o = t; o < i; ++o)
  30428. this[o] = e;
  30429. else {
  30430. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30431. , s = a.length;
  30432. for (o = 0; o < i - t; ++o)
  30433. this[o + t] = a[o % s]
  30434. }
  30435. return this
  30436. }
  30437. ;
  30438. var t = /[^+\/0-9A-Za-z-_]/g
  30439. }
  30440. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30441. }
  30442. , {
  30443. "base64-js": 199,
  30444. ieee754: 200,
  30445. isarray: 201
  30446. }],
  30447. 199: [function(e, t, i) {
  30448. "use strict";
  30449. function l(e) {
  30450. var t = e.length;
  30451. if (0 < t % 4)
  30452. throw new Error("Invalid string. Length must be a multiple of 4");
  30453. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30454. }
  30455. function c(e, t, i) {
  30456. for (var n, r = [], o = t; o < i; o += 3)
  30457. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30458. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30459. var a;
  30460. return r.join("")
  30461. }
  30462. i.byteLength = function(e) {
  30463. return 3 * e.length / 4 - l(e)
  30464. }
  30465. ,
  30466. i.toByteArray = function(e) {
  30467. var t, i, n, r, o, a = e.length;
  30468. r = l(e),
  30469. o = new d(3 * a / 4 - r),
  30470. i = 0 < r ? a - 4 : a;
  30471. var s = 0;
  30472. for (t = 0; t < i; t += 4,
  30473. 3)
  30474. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30475. o[s++] = n >> 16 & 255,
  30476. o[s++] = n >> 8 & 255,
  30477. o[s++] = 255 & n;
  30478. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30479. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30480. o[s++] = n >> 8 & 255,
  30481. o[s++] = 255 & n),
  30482. o
  30483. }
  30484. ,
  30485. i.fromByteArray = function(e) {
  30486. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30487. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30488. return 1 == n ? (t = e[i - 1],
  30489. r += h[t >> 2],
  30490. r += h[t << 4 & 63],
  30491. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30492. r += h[t >> 10],
  30493. r += h[t >> 4 & 63],
  30494. r += h[t << 2 & 63],
  30495. r += "="),
  30496. o.push(r),
  30497. o.join("")
  30498. }
  30499. ;
  30500. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30501. h[r] = n[r],
  30502. u[n.charCodeAt(r)] = r;
  30503. u["-".charCodeAt(0)] = 62,
  30504. u["_".charCodeAt(0)] = 63
  30505. }
  30506. , {}],
  30507. 200: [function(e, t, i) {
  30508. i.read = function(e, t, i, n, r) {
  30509. 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];
  30510. for (u += d,
  30511. o = p & (1 << -h) - 1,
  30512. p >>= -h,
  30513. h += s; 0 < h; o = 256 * o + e[t + u],
  30514. u += d,
  30515. h -= 8)
  30516. ;
  30517. for (a = o & (1 << -h) - 1,
  30518. o >>= -h,
  30519. h += n; 0 < h; a = 256 * a + e[t + u],
  30520. u += d,
  30521. h -= 8)
  30522. ;
  30523. if (0 === o)
  30524. o = 1 - c;
  30525. else {
  30526. if (o === l)
  30527. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30528. a += Math.pow(2, n),
  30529. o -= c
  30530. }
  30531. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30532. }
  30533. ,
  30534. i.write = function(e, t, i, n, r, o) {
  30535. 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;
  30536. for (t = Math.abs(t),
  30537. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30538. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30539. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30540. l *= 2),
  30541. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30542. l /= 2),
  30543. h <= a + u ? (s = 0,
  30544. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30545. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30546. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30547. p += f,
  30548. s /= 256,
  30549. r -= 8)
  30550. ;
  30551. for (a = a << r | s,
  30552. c += r; 0 < c; e[i + p] = 255 & a,
  30553. p += f,
  30554. a /= 256,
  30555. c -= 8)
  30556. ;
  30557. e[i + p - f] |= 128 * g
  30558. }
  30559. }
  30560. , {}],
  30561. 201: [function(e, t, i) {
  30562. var n = {}.toString;
  30563. t.exports = Array.isArray || function(e) {
  30564. return "[object Array]" == n.call(e)
  30565. }
  30566. }
  30567. , {}],
  30568. 202: [function(e, t, i) {
  30569. function n() {
  30570. this._events = this._events || {},
  30571. this._maxListeners = this._maxListeners || void 0
  30572. }
  30573. function l(e) {
  30574. return "function" == typeof e
  30575. }
  30576. function c(e) {
  30577. return "object" == typeof e && null !== e
  30578. }
  30579. function h(e) {
  30580. return void 0 === e
  30581. }
  30582. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30583. n.prototype._maxListeners = void 0,
  30584. n.defaultMaxListeners = 10,
  30585. n.prototype.setMaxListeners = function(e) {
  30586. if (!function(e) {
  30587. return "number" == typeof e
  30588. }(e) || e < 0 || isNaN(e))
  30589. throw TypeError("n must be a positive number");
  30590. return this._maxListeners = e,
  30591. this
  30592. }
  30593. ,
  30594. n.prototype.emit = function(e) {
  30595. var t, i, n, r, o, a;
  30596. if (this._events || (this._events = {}),
  30597. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30598. if ((t = arguments[1])instanceof Error)
  30599. throw t;
  30600. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30601. throw s.context = t,
  30602. s
  30603. }
  30604. if (h(i = this._events[e]))
  30605. return !1;
  30606. if (l(i))
  30607. switch (arguments.length) {
  30608. case 1:
  30609. i.call(this);
  30610. break;
  30611. case 2:
  30612. i.call(this, arguments[1]);
  30613. break;
  30614. case 3:
  30615. i.call(this, arguments[1], arguments[2]);
  30616. break;
  30617. default:
  30618. r = Array.prototype.slice.call(arguments, 1),
  30619. i.apply(this, r)
  30620. }
  30621. else if (c(i))
  30622. for (r = Array.prototype.slice.call(arguments, 1),
  30623. n = (a = i.slice()).length,
  30624. o = 0; o < n; o++)
  30625. a[o].apply(this, r);
  30626. return !0
  30627. }
  30628. ,
  30629. n.prototype.on = n.prototype.addListener = function(e, t) {
  30630. var i;
  30631. if (!l(t))
  30632. throw TypeError("listener must be a function");
  30633. return this._events || (this._events = {}),
  30634. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30635. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30636. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  30637. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30638. "function" == typeof console.trace && console.trace())),
  30639. this
  30640. }
  30641. ,
  30642. n.prototype.once = function(e, t) {
  30643. function i() {
  30644. this.removeListener(e, i),
  30645. n || (n = !0,
  30646. t.apply(this, arguments))
  30647. }
  30648. if (!l(t))
  30649. throw TypeError("listener must be a function");
  30650. var n = !1;
  30651. return i.listener = t,
  30652. this.on(e, i),
  30653. this
  30654. }
  30655. ,
  30656. n.prototype.removeListener = function(e, t) {
  30657. var i, n, r, o;
  30658. if (!l(t))
  30659. throw TypeError("listener must be a function");
  30660. if (!this._events || !this._events[e])
  30661. return this;
  30662. if (r = (i = this._events[e]).length,
  30663. n = -1,
  30664. i === t || l(i.listener) && i.listener === t)
  30665. delete this._events[e],
  30666. this._events.removeListener && this.emit("removeListener", e, t);
  30667. else if (c(i)) {
  30668. for (o = r; 0 < o--; )
  30669. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30670. n = o;
  30671. break
  30672. }
  30673. if (n < 0)
  30674. return this;
  30675. 1 === i.length ? (i.length = 0,
  30676. delete this._events[e]) : i.splice(n, 1),
  30677. this._events.removeListener && this.emit("removeListener", e, t)
  30678. }
  30679. return this
  30680. }
  30681. ,
  30682. n.prototype.removeAllListeners = function(e) {
  30683. var t, i;
  30684. if (!this._events)
  30685. return this;
  30686. if (!this._events.removeListener)
  30687. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30688. this;
  30689. if (0 === arguments.length) {
  30690. for (t in this._events)
  30691. "removeListener" !== t && this.removeAllListeners(t);
  30692. return this.removeAllListeners("removeListener"),
  30693. this._events = {},
  30694. this
  30695. }
  30696. if (l(i = this._events[e]))
  30697. this.removeListener(e, i);
  30698. else if (i)
  30699. for (; i.length; )
  30700. this.removeListener(e, i[i.length - 1]);
  30701. return delete this._events[e],
  30702. this
  30703. }
  30704. ,
  30705. n.prototype.listeners = function(e) {
  30706. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30707. }
  30708. ,
  30709. n.prototype.listenerCount = function(e) {
  30710. if (this._events) {
  30711. var t = this._events[e];
  30712. if (l(t))
  30713. return 1;
  30714. if (t)
  30715. return t.length
  30716. }
  30717. return 0
  30718. }
  30719. ,
  30720. n.listenerCount = function(e, t) {
  30721. return e.listenerCount(t)
  30722. }
  30723. }
  30724. , {}],
  30725. 203: [function(e, t, i) {
  30726. function n() {
  30727. throw new Error("setTimeout has not been defined")
  30728. }
  30729. function r() {
  30730. throw new Error("clearTimeout has not been defined")
  30731. }
  30732. function o(t) {
  30733. if (h === setTimeout)
  30734. return setTimeout(t, 0);
  30735. if ((h === n || !h) && setTimeout)
  30736. return h = setTimeout,
  30737. setTimeout(t, 0);
  30738. try {
  30739. return h(t, 0)
  30740. } catch (e) {
  30741. try {
  30742. return h.call(null, t, 0)
  30743. } catch (e) {
  30744. return h.call(this, t, 0)
  30745. }
  30746. }
  30747. }
  30748. function a() {
  30749. g && p && (g = !1,
  30750. p.length ? f = p.concat(f) : m = -1,
  30751. f.length && s())
  30752. }
  30753. function s() {
  30754. if (!g) {
  30755. var e = o(a);
  30756. g = !0;
  30757. for (var t = f.length; t; ) {
  30758. for (p = f,
  30759. f = []; ++m < t; )
  30760. p && p[m].run();
  30761. m = -1,
  30762. t = f.length
  30763. }
  30764. p = null,
  30765. g = !1,
  30766. function(t) {
  30767. if (u === clearTimeout)
  30768. return clearTimeout(t);
  30769. if ((u === r || !u) && clearTimeout)
  30770. return u = clearTimeout,
  30771. clearTimeout(t);
  30772. try {
  30773. u(t)
  30774. } catch (e) {
  30775. try {
  30776. return u.call(null, t)
  30777. } catch (e) {
  30778. return u.call(this, t)
  30779. }
  30780. }
  30781. }(e)
  30782. }
  30783. }
  30784. function l(e, t) {
  30785. this.fun = e,
  30786. this.array = t
  30787. }
  30788. function c() {}
  30789. var h, u, d = t.exports = {};
  30790. !function() {
  30791. try {
  30792. h = "function" == typeof setTimeout ? setTimeout : n
  30793. } catch (e) {
  30794. h = n
  30795. }
  30796. try {
  30797. u = "function" == typeof clearTimeout ? clearTimeout : r
  30798. } catch (e) {
  30799. u = r
  30800. }
  30801. }();
  30802. var p, f = [], g = !1, m = -1;
  30803. d.nextTick = function(e) {
  30804. var t = new Array(arguments.length - 1);
  30805. if (1 < arguments.length)
  30806. for (var i = 1; i < arguments.length; i++)
  30807. t[i - 1] = arguments[i];
  30808. f.push(new l(e,t)),
  30809. 1 !== f.length || g || o(s)
  30810. }
  30811. ,
  30812. l.prototype.run = function() {
  30813. this.fun.apply(null, this.array)
  30814. }
  30815. ,
  30816. d.title = "browser",
  30817. d.browser = !0,
  30818. d.env = {},
  30819. d.argv = [],
  30820. d.version = "",
  30821. d.versions = {},
  30822. d.on = c,
  30823. d.addListener = c,
  30824. d.once = c,
  30825. d.off = c,
  30826. d.removeListener = c,
  30827. d.removeAllListeners = c,
  30828. d.emit = c,
  30829. d.binding = function(e) {
  30830. throw new Error("process.binding is not supported")
  30831. }
  30832. ,
  30833. d.cwd = function() {
  30834. return "/"
  30835. }
  30836. ,
  30837. d.chdir = function(e) {
  30838. throw new Error("process.chdir is not supported")
  30839. }
  30840. ,
  30841. d.umask = function() {
  30842. return 0
  30843. }
  30844. }
  30845. , {}],
  30846. 204: [function(e, O, L) {
  30847. (function(P) {
  30848. !function(e) {
  30849. function v(e) {
  30850. throw new RangeError(g[e])
  30851. }
  30852. function r(e, t) {
  30853. for (var i = e.length, n = []; i--; )
  30854. n[i] = t(e[i]);
  30855. return n
  30856. }
  30857. function t(e, t) {
  30858. var i = e.split("@")
  30859. , n = "";
  30860. return 1 < i.length && (n = i[0] + "@",
  30861. e = i[1]),
  30862. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30863. }
  30864. function y(e) {
  30865. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30866. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30867. r--) : n.push(t);
  30868. return n
  30869. }
  30870. function A(e) {
  30871. return r(e, function(e) {
  30872. var t = "";
  30873. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30874. e = 56320 | 1023 & e),
  30875. t + R(e)
  30876. }).join("")
  30877. }
  30878. function C(e, t) {
  30879. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30880. }
  30881. function I(e, t, i) {
  30882. var n = 0;
  30883. for (e = i ? M(e / u) : e >> 1,
  30884. e += M(e / t); m * w >> 1 < e; n += _)
  30885. e = M(e / m);
  30886. return M(n + (m + 1) * e / (e + h))
  30887. }
  30888. function i(e) {
  30889. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30890. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30891. n = 0; n < i; ++n)
  30892. 128 <= e.charCodeAt(n) && v("not-basic"),
  30893. d.push(e.charCodeAt(n));
  30894. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30895. for (o = f,
  30896. a = 1,
  30897. s = _; p <= r && v("invalid-input"),
  30898. u = e.charCodeAt(r++),
  30899. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30900. f += l * a,
  30901. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30902. a > M(E / (h = _ - c)) && v("overflow"),
  30903. a *= h;
  30904. m = I(f - o, t = d.length + 1, 0 == o),
  30905. M(f / t) > E - g && v("overflow"),
  30906. g += M(f / t),
  30907. f %= t,
  30908. d.splice(f++, 0, g)
  30909. }
  30910. return A(d)
  30911. }
  30912. function n(e) {
  30913. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30914. for (d = (e = y(e)).length,
  30915. t = x,
  30916. o = T,
  30917. a = i = 0; a < d; ++a)
  30918. (u = e[a]) < 128 && m.push(R(u));
  30919. for (n = r = m.length,
  30920. r && m.push(S); n < d; ) {
  30921. for (s = E,
  30922. a = 0; a < d; ++a)
  30923. t <= (u = e[a]) && u < s && (s = u);
  30924. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30925. i += (s - t) * p,
  30926. t = s,
  30927. a = 0; a < d; ++a)
  30928. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30929. u == t) {
  30930. for (l = i,
  30931. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30932. g = l - h,
  30933. f = _ - h,
  30934. m.push(R(C(h + g % f, 0))),
  30935. l = M(g / f);
  30936. m.push(R(C(l, 0))),
  30937. o = I(i, p, n == r),
  30938. i = 0,
  30939. ++n
  30940. }
  30941. ++i,
  30942. ++t
  30943. }
  30944. return m.join("")
  30945. }
  30946. var o = "object" == typeof L && L && !L.nodeType && L
  30947. , a = "object" == typeof O && O && !O.nodeType && O
  30948. , s = "object" == typeof P && P;
  30949. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30950. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  30951. overflow: "Overflow: input needs wider integers to process",
  30952. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30953. "invalid-input": "Invalid input"
  30954. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30955. if (l = {
  30956. version: "1.4.1",
  30957. ucs2: {
  30958. decode: y,
  30959. encode: A
  30960. },
  30961. decode: i,
  30962. encode: n,
  30963. toASCII: function(e) {
  30964. return t(e, function(e) {
  30965. return p.test(e) ? "xn--" + n(e) : e
  30966. })
  30967. },
  30968. toUnicode: function(e) {
  30969. return t(e, function(e) {
  30970. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30971. })
  30972. }
  30973. },
  30974. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30975. define("punycode", function() {
  30976. return l
  30977. });
  30978. else if (o && a)
  30979. if (O.exports == o)
  30980. a.exports = l;
  30981. else
  30982. for (c in l)
  30983. l.hasOwnProperty(c) && (o[c] = l[c]);
  30984. else
  30985. e.punycode = l
  30986. }(this)
  30987. }
  30988. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30989. }
  30990. , {}],
  30991. 205: [function(e, t, i) {
  30992. "use strict";
  30993. t.exports = function(e, t, i, n) {
  30994. t = t || "&",
  30995. i = i || "=";
  30996. var r = {};
  30997. if ("string" != typeof e || 0 === e.length)
  30998. return r;
  30999. var o = /\+/g;
  31000. e = e.split(t);
  31001. var a = 1e3;
  31002. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31003. var s, l, c = e.length;
  31004. 0 < a && a < c && (c = a);
  31005. for (var h = 0; h < c; ++h) {
  31006. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31007. d = 0 <= m ? (u = g.substr(0, m),
  31008. g.substr(m + 1)) : (u = g,
  31009. ""),
  31010. p = decodeURIComponent(u),
  31011. f = decodeURIComponent(d),
  31012. s = r,
  31013. l = p,
  31014. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31015. }
  31016. return r
  31017. }
  31018. ;
  31019. var v = Array.isArray || function(e) {
  31020. return "[object Array]" === Object.prototype.toString.call(e)
  31021. }
  31022. }
  31023. , {}],
  31024. 206: [function(e, t, i) {
  31025. "use strict";
  31026. function o(e, t) {
  31027. if (e.map)
  31028. return e.map(t);
  31029. for (var i = [], n = 0; n < e.length; n++)
  31030. i.push(t(e[n], n));
  31031. return i
  31032. }
  31033. function a(e) {
  31034. switch (typeof e) {
  31035. case "string":
  31036. return e;
  31037. case "boolean":
  31038. return e ? "true" : "false";
  31039. case "number":
  31040. return isFinite(e) ? e : "";
  31041. default:
  31042. return ""
  31043. }
  31044. }
  31045. t.exports = function(i, n, r, e) {
  31046. return n = n || "&",
  31047. r = r || "=",
  31048. null === i && (i = void 0),
  31049. "object" == typeof i ? o(l(i), function(e) {
  31050. var t = encodeURIComponent(a(e)) + r;
  31051. return s(i[e]) ? o(i[e], function(e) {
  31052. return t + encodeURIComponent(a(e))
  31053. }).join(n) : t + encodeURIComponent(a(i[e]))
  31054. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31055. }
  31056. ;
  31057. var s = Array.isArray || function(e) {
  31058. return "[object Array]" === Object.prototype.toString.call(e)
  31059. }
  31060. , l = Object.keys || function(e) {
  31061. var t = [];
  31062. for (var i in e)
  31063. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31064. return t
  31065. }
  31066. }
  31067. , {}],
  31068. 207: [function(e, t, i) {
  31069. "use strict";
  31070. i.decode = i.parse = e("./decode"),
  31071. i.encode = i.stringify = e("./encode")
  31072. }
  31073. , {
  31074. "./decode": 205,
  31075. "./encode": 206
  31076. }],
  31077. 208: [function(e, t, i) {
  31078. "use strict";
  31079. function x() {
  31080. this.protocol = null,
  31081. this.slashes = null,
  31082. this.auth = null,
  31083. this.host = null,
  31084. this.port = null,
  31085. this.hostname = null,
  31086. this.hash = null,
  31087. this.search = null,
  31088. this.query = null,
  31089. this.pathname = null,
  31090. this.path = null,
  31091. this.href = null
  31092. }
  31093. function n(e, t, i) {
  31094. if (e && D.isObject(e) && e instanceof x)
  31095. return e;
  31096. var n = new x;
  31097. return n.parse(e, t, i),
  31098. n
  31099. }
  31100. var L = e("punycode")
  31101. , D = e("./util");
  31102. i.parse = n,
  31103. i.resolve = function(e, t) {
  31104. return n(e, !1, !0).resolve(t)
  31105. }
  31106. ,
  31107. i.resolveObject = function(e, t) {
  31108. return e ? n(e, !1, !0).resolveObject(t) : t
  31109. }
  31110. ,
  31111. i.format = function(e) {
  31112. return D.isString(e) && (e = n(e)),
  31113. e instanceof x ? e.format() : x.prototype.format.call(e)
  31114. }
  31115. ,
  31116. i.Url = x;
  31117. var N = /^([a-z0-9.+-]+:)/i
  31118. , r = /:[0-9]*$/
  31119. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31120. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31121. , B = ["'"].concat(o)
  31122. , V = ["%", "/", "?", ";", "#"].concat(B)
  31123. , k = ["/", "?", "#"]
  31124. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31125. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31126. , z = {
  31127. javascript: !0,
  31128. "javascript:": !0
  31129. }
  31130. , G = {
  31131. javascript: !0,
  31132. "javascript:": !0
  31133. }
  31134. , W = {
  31135. http: !0,
  31136. https: !0,
  31137. ftp: !0,
  31138. gopher: !0,
  31139. file: !0,
  31140. "http:": !0,
  31141. "https:": !0,
  31142. "ftp:": !0,
  31143. "gopher:": !0,
  31144. "file:": !0
  31145. }
  31146. , j = e("querystring");
  31147. x.prototype.parse = function(e, t, i) {
  31148. if (!D.isString(e))
  31149. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31150. var n = e.indexOf("?")
  31151. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31152. , o = e.split(r);
  31153. o[0] = o[0].replace(/\\/g, "/");
  31154. var a = e = o.join(r);
  31155. if (a = a.trim(),
  31156. !i && 1 === e.split("#").length) {
  31157. var s = F.exec(a);
  31158. if (s)
  31159. return this.path = a,
  31160. this.href = a,
  31161. this.pathname = s[1],
  31162. s[2] ? (this.search = s[2],
  31163. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31164. this.query = {}),
  31165. this
  31166. }
  31167. var l = N.exec(a);
  31168. if (l) {
  31169. var c = (l = l[0]).toLowerCase();
  31170. this.protocol = c,
  31171. a = a.substr(l.length)
  31172. }
  31173. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31174. var h = "//" === a.substr(0, 2);
  31175. !h || l && G[l] || (a = a.substr(2),
  31176. this.slashes = !0)
  31177. }
  31178. if (!G[l] && (h || l && !W[l])) {
  31179. for (var u = -1, d = 0; d < k.length; d++) {
  31180. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31181. }
  31182. var p, f;
  31183. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31184. a = a.slice(f + 1),
  31185. this.auth = decodeURIComponent(p)),
  31186. u = -1;
  31187. for (d = 0; d < V.length; d++) {
  31188. var g;
  31189. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31190. }
  31191. -1 === u && (u = a.length),
  31192. this.host = a.slice(0, u),
  31193. a = a.slice(u),
  31194. this.parseHost(),
  31195. this.hostname = this.hostname || "";
  31196. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31197. if (!m)
  31198. for (var v = this.hostname.split(/\./), y = (d = 0,
  31199. v.length); d < y; d++) {
  31200. var A = v[d];
  31201. if (A && !A.match(U)) {
  31202. for (var C = "", I = 0, E = A.length; I < E; I++)
  31203. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31204. if (!C.match(U)) {
  31205. var _ = v.slice(0, d)
  31206. , b = v.slice(d + 1)
  31207. , w = A.match(H);
  31208. w && (_.push(w[1]),
  31209. b.unshift(w[2])),
  31210. b.length && (a = "/" + b.join(".") + a),
  31211. this.hostname = _.join(".");
  31212. break
  31213. }
  31214. }
  31215. }
  31216. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31217. m || (this.hostname = L.toASCII(this.hostname));
  31218. var T = this.port ? ":" + this.port : ""
  31219. , x = this.hostname || "";
  31220. this.host = x + T,
  31221. this.href += this.host,
  31222. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31223. "/" !== a[0] && (a = "/" + a))
  31224. }
  31225. if (!z[c])
  31226. for (d = 0,
  31227. y = B.length; d < y; d++) {
  31228. var S = B[d];
  31229. if (-1 !== a.indexOf(S)) {
  31230. var M = encodeURIComponent(S);
  31231. M === S && (M = escape(S)),
  31232. a = a.split(S).join(M)
  31233. }
  31234. }
  31235. var R = a.indexOf("#");
  31236. -1 !== R && (this.hash = a.substr(R),
  31237. a = a.slice(0, R));
  31238. var P = a.indexOf("?");
  31239. if (-1 !== P ? (this.search = a.substr(P),
  31240. this.query = a.substr(P + 1),
  31241. t && (this.query = j.parse(this.query)),
  31242. a = a.slice(0, P)) : t && (this.search = "",
  31243. this.query = {}),
  31244. a && (this.pathname = a),
  31245. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31246. this.pathname || this.search) {
  31247. T = this.pathname || "";
  31248. var O = this.search || "";
  31249. this.path = T + O
  31250. }
  31251. return this.href = this.format(),
  31252. this
  31253. }
  31254. ,
  31255. x.prototype.format = function() {
  31256. var e = this.auth || "";
  31257. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31258. e += "@");
  31259. var t = this.protocol || ""
  31260. , i = this.pathname || ""
  31261. , n = this.hash || ""
  31262. , r = !1
  31263. , o = "";
  31264. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31265. this.port && (r += ":" + this.port)),
  31266. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31267. var a = this.search || o && "?" + o || "";
  31268. return t && ":" !== t.substr(-1) && (t += ":"),
  31269. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31270. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31271. n && "#" !== n.charAt(0) && (n = "#" + n),
  31272. a && "?" !== a.charAt(0) && (a = "?" + a),
  31273. t + r + (i = i.replace(/[?#]/g, function(e) {
  31274. return encodeURIComponent(e)
  31275. })) + (a = a.replace("#", "%23")) + n
  31276. }
  31277. ,
  31278. x.prototype.resolve = function(e) {
  31279. return this.resolveObject(n(e, !1, !0)).format()
  31280. }
  31281. ,
  31282. x.prototype.resolveObject = function(e) {
  31283. if (D.isString(e)) {
  31284. var t = new x;
  31285. t.parse(e, !1, !0),
  31286. e = t
  31287. }
  31288. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31289. var o = n[r];
  31290. i[o] = this[o]
  31291. }
  31292. if (i.hash = e.hash,
  31293. "" === e.href)
  31294. return i.href = i.format(),
  31295. i;
  31296. if (e.slashes && !e.protocol) {
  31297. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31298. var l = a[s];
  31299. "protocol" !== l && (i[l] = e[l])
  31300. }
  31301. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31302. i.href = i.format(),
  31303. i
  31304. }
  31305. if (e.protocol && e.protocol !== i.protocol) {
  31306. if (!W[e.protocol]) {
  31307. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31308. var u = c[h];
  31309. i[u] = e[u]
  31310. }
  31311. return i.href = i.format(),
  31312. i
  31313. }
  31314. if (i.protocol = e.protocol,
  31315. e.host || G[e.protocol])
  31316. i.pathname = e.pathname;
  31317. else {
  31318. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31319. ;
  31320. e.host || (e.host = ""),
  31321. e.hostname || (e.hostname = ""),
  31322. "" !== d[0] && d.unshift(""),
  31323. d.length < 2 && d.unshift(""),
  31324. i.pathname = d.join("/")
  31325. }
  31326. if (i.search = e.search,
  31327. i.query = e.query,
  31328. i.host = e.host || "",
  31329. i.auth = e.auth,
  31330. i.hostname = e.hostname || e.host,
  31331. i.port = e.port,
  31332. i.pathname || i.search) {
  31333. var p = i.pathname || ""
  31334. , f = i.search || "";
  31335. i.path = p + f
  31336. }
  31337. return i.slashes = i.slashes || e.slashes,
  31338. i.href = i.format(),
  31339. i
  31340. }
  31341. var g = i.pathname && "/" === i.pathname.charAt(0)
  31342. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31343. , v = m || g || i.host && e.pathname
  31344. , y = v
  31345. , A = i.pathname && i.pathname.split("/") || []
  31346. , C = (d = e.pathname && e.pathname.split("/") || [],
  31347. i.protocol && !W[i.protocol]);
  31348. if (C && (i.hostname = "",
  31349. i.port = null,
  31350. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31351. i.host = "",
  31352. e.protocol && (e.hostname = null,
  31353. e.port = null,
  31354. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31355. e.host = null),
  31356. v = v && ("" === d[0] || "" === A[0])),
  31357. m)
  31358. i.host = e.host || "" === e.host ? e.host : i.host,
  31359. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31360. i.search = e.search,
  31361. i.query = e.query,
  31362. A = d;
  31363. else if (d.length)
  31364. (A = A || []).pop(),
  31365. A = A.concat(d),
  31366. i.search = e.search,
  31367. i.query = e.query;
  31368. else if (!D.isNullOrUndefined(e.search)) {
  31369. if (C)
  31370. i.hostname = i.host = A.shift(),
  31371. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31372. i.host = i.hostname = w.shift());
  31373. return i.search = e.search,
  31374. i.query = e.query,
  31375. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31376. i.href = i.format(),
  31377. i
  31378. }
  31379. if (!A.length)
  31380. return i.pathname = null,
  31381. i.search ? i.path = "/" + i.search : i.path = null,
  31382. i.href = i.format(),
  31383. i;
  31384. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31385. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31386. _++) : _ && (A.splice(b, 1),
  31387. _--);
  31388. if (!v && !y)
  31389. for (; _--; )
  31390. A.unshift("..");
  31391. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31392. E && "/" !== A.join("/").substr(-1) && A.push("");
  31393. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31394. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31395. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31396. i.host = i.hostname = w.shift()));
  31397. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31398. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31399. i.path = null),
  31400. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31401. i.auth = e.auth || i.auth,
  31402. i.slashes = i.slashes || e.slashes,
  31403. i.href = i.format(),
  31404. i
  31405. }
  31406. ,
  31407. x.prototype.parseHost = function() {
  31408. var e = this.host
  31409. , t = r.exec(e);
  31410. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31411. e = e.substr(0, e.length - t.length)),
  31412. e && (this.hostname = e)
  31413. }
  31414. }
  31415. , {
  31416. "./util": 209,
  31417. punycode: 204,
  31418. querystring: 207
  31419. }],
  31420. 209: [function(e, t, i) {
  31421. "use strict";
  31422. t.exports = {
  31423. isString: function(e) {
  31424. return "string" == typeof e
  31425. },
  31426. isObject: function(e) {
  31427. return "object" == typeof e && null !== e
  31428. },
  31429. isNull: function(e) {
  31430. return null === e
  31431. },
  31432. isNullOrUndefined: function(e) {
  31433. return null == e
  31434. }
  31435. }
  31436. }
  31437. , {}],
  31438. 210: [function(e, t, i) {
  31439. "use strict";
  31440. function r(e) {
  31441. return c + e
  31442. }
  31443. function s(e) {
  31444. if ("string" != typeof e)
  31445. throw new TypeError("key must be a string.")
  31446. }
  31447. var l = Object.prototype.hasOwnProperty
  31448. , c = "~";
  31449. t.exports = function(t) {
  31450. var o = Object.create(null)
  31451. , n = 0
  31452. , a = {};
  31453. return function(e, t) {
  31454. for (var i in t)
  31455. Object.defineProperty(e, i, {
  31456. value: t[i],
  31457. configurable: !0,
  31458. writable: !0
  31459. })
  31460. }(a, {
  31461. get: function(e, t) {
  31462. s(e);
  31463. var i = r(e);
  31464. return i in o ? o[i] : t
  31465. },
  31466. set: function(e, t) {
  31467. s(e);
  31468. var i = r(e);
  31469. return i in o || ++n,
  31470. o[i] = t
  31471. },
  31472. has: function(e) {
  31473. return s(e),
  31474. r(e)in o
  31475. },
  31476. delete: function(e) {
  31477. s(e);
  31478. var t = r(e);
  31479. return t in o && (--n,
  31480. delete o[t],
  31481. !0)
  31482. },
  31483. clear: function() {
  31484. o = Object.create(null),
  31485. n = 0
  31486. },
  31487. forEach: function(e, t) {
  31488. if ("function" != typeof e)
  31489. throw new TypeError("`callback` must be a function");
  31490. for (var i in o)
  31491. if (l.call(o, i)) {
  31492. var n = i.substring(c.length)
  31493. , r = o[i];
  31494. e.call(t, r, n, a)
  31495. }
  31496. }
  31497. }),
  31498. Object.defineProperty(a, "size", {
  31499. get: function() {
  31500. return n
  31501. },
  31502. configurable: !0
  31503. }),
  31504. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31505. a.set(e, t[e])
  31506. }),
  31507. a
  31508. }
  31509. }
  31510. , {}],
  31511. 211: [function(e, t, i) {
  31512. t.exports = e("./lib/heap")
  31513. }
  31514. , {
  31515. "./lib/heap": 212
  31516. }],
  31517. 212: [function(e, y, A) {
  31518. (function() {
  31519. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31520. function v(e) {
  31521. this.cmp = null != e ? e : d,
  31522. this.nodes = []
  31523. }
  31524. l = Math.floor,
  31525. m = Math.min,
  31526. d = function(e, t) {
  31527. return e < t ? -1 : t < e ? 1 : 0
  31528. }
  31529. ,
  31530. g = function(e, t, i, n, r) {
  31531. var o;
  31532. if (null == i && (i = 0),
  31533. null == r && (r = d),
  31534. i < 0)
  31535. throw new Error("lo must be non-negative");
  31536. for (null == n && (n = e.length); i < n; )
  31537. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31538. return [].splice.apply(e, [i, i - i].concat(t)),
  31539. t
  31540. }
  31541. ,
  31542. t = function(e, t, i) {
  31543. return null == i && (i = d),
  31544. e.push(t),
  31545. h(e, 0, e.length - 1, i)
  31546. }
  31547. ,
  31548. f = function(e, t) {
  31549. var i, n;
  31550. return null == t && (t = d),
  31551. i = e.pop(),
  31552. e.length ? (n = e[0],
  31553. e[0] = i,
  31554. u(e, 0, t)) : n = i,
  31555. n
  31556. }
  31557. ,
  31558. i = function(e, t, i) {
  31559. var n;
  31560. return null == i && (i = d),
  31561. n = e[0],
  31562. e[0] = t,
  31563. u(e, 0, i),
  31564. n
  31565. }
  31566. ,
  31567. c = function(e, t, i) {
  31568. var n;
  31569. return null == i && (i = d),
  31570. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31571. e[0] = n[1],
  31572. u(e, 0, i)),
  31573. t
  31574. }
  31575. ,
  31576. p = function(i, e) {
  31577. var t, n, r, o, a, s;
  31578. for (null == e && (e = d),
  31579. a = [],
  31580. n = 0,
  31581. r = (o = function() {
  31582. s = [];
  31583. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31584. s.push(e);
  31585. return s
  31586. }
  31587. .apply(this).reverse()).length; n < r; n++)
  31588. t = o[n],
  31589. a.push(u(i, t, e));
  31590. return a
  31591. }
  31592. ,
  31593. o = function(e, t, i) {
  31594. var n;
  31595. if (null == i && (i = d),
  31596. -1 !== (n = e.indexOf(t)))
  31597. return h(e, 0, n, i),
  31598. u(e, n, i)
  31599. }
  31600. ,
  31601. n = function(e, t, i) {
  31602. var n, r, o, a, s;
  31603. if (null == i && (i = d),
  31604. !(r = e.slice(0, t)).length)
  31605. return r;
  31606. for (p(r, i),
  31607. o = 0,
  31608. a = (s = e.slice(t)).length; o < a; o++)
  31609. n = s[o],
  31610. c(r, n, i);
  31611. return r.sort(i).reverse()
  31612. }
  31613. ,
  31614. r = function(e, t, i) {
  31615. var n, r, o, a, s, l, c, h, u;
  31616. if (null == i && (i = d),
  31617. 10 * t <= e.length) {
  31618. if (!(o = e.slice(0, t).sort(i)).length)
  31619. return o;
  31620. for (r = o[o.length - 1],
  31621. a = 0,
  31622. l = (c = e.slice(t)).length; a < l; a++)
  31623. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31624. o.pop(),
  31625. r = o[o.length - 1]);
  31626. return o
  31627. }
  31628. for (p(e, i),
  31629. u = [],
  31630. s = 0,
  31631. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31632. u.push(f(e, i));
  31633. return u
  31634. }
  31635. ,
  31636. h = function(e, t, i, n) {
  31637. var r, o, a;
  31638. for (null == n && (n = d),
  31639. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31640. e[i] = o,
  31641. i = a;
  31642. return e[i] = r
  31643. }
  31644. ,
  31645. u = function(e, t, i) {
  31646. var n, r, o, a, s;
  31647. for (null == i && (i = d),
  31648. r = e.length,
  31649. o = e[s = t],
  31650. n = 2 * t + 1; n < r; )
  31651. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31652. e[t] = e[n],
  31653. n = 2 * (t = n) + 1;
  31654. return e[t] = o,
  31655. h(e, s, t, i)
  31656. }
  31657. ,
  31658. v.push = t,
  31659. v.pop = f,
  31660. v.replace = i,
  31661. v.pushpop = c,
  31662. v.heapify = p,
  31663. v.updateItem = o,
  31664. v.nlargest = n,
  31665. v.nsmallest = r,
  31666. v.prototype.push = function(e) {
  31667. return t(this.nodes, e, this.cmp)
  31668. }
  31669. ,
  31670. v.prototype.pop = function() {
  31671. return f(this.nodes, this.cmp)
  31672. }
  31673. ,
  31674. v.prototype.peek = function() {
  31675. return this.nodes[0]
  31676. }
  31677. ,
  31678. v.prototype.contains = function(e) {
  31679. return -1 !== this.nodes.indexOf(e)
  31680. }
  31681. ,
  31682. v.prototype.replace = function(e) {
  31683. return i(this.nodes, e, this.cmp)
  31684. }
  31685. ,
  31686. v.prototype.pushpop = function(e) {
  31687. return c(this.nodes, e, this.cmp)
  31688. }
  31689. ,
  31690. v.prototype.heapify = function() {
  31691. return p(this.nodes, this.cmp)
  31692. }
  31693. ,
  31694. v.prototype.updateItem = function(e) {
  31695. return o(this.nodes, e, this.cmp)
  31696. }
  31697. ,
  31698. v.prototype.clear = function() {
  31699. return this.nodes = []
  31700. }
  31701. ,
  31702. v.prototype.empty = function() {
  31703. return 0 === this.nodes.length
  31704. }
  31705. ,
  31706. v.prototype.size = function() {
  31707. return this.nodes.length
  31708. }
  31709. ,
  31710. v.prototype.clone = function() {
  31711. var e;
  31712. return (e = new v).nodes = this.nodes.slice(0),
  31713. e
  31714. }
  31715. ,
  31716. v.prototype.toArray = function() {
  31717. return this.nodes.slice(0)
  31718. }
  31719. ,
  31720. v.prototype.insert = v.prototype.push,
  31721. v.prototype.top = v.prototype.peek,
  31722. v.prototype.front = v.prototype.peek,
  31723. v.prototype.has = v.prototype.contains,
  31724. v.prototype.copy = v.prototype.clone,
  31725. e = v,
  31726. a = this,
  31727. s = function() {
  31728. return e
  31729. }
  31730. ,
  31731. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31732. }
  31733. ).call(this)
  31734. }
  31735. , {}],
  31736. 213: [function(e, t, i) {
  31737. function n() {}
  31738. function o(e) {
  31739. if ("object" != typeof this)
  31740. throw new TypeError("Promises must be constructed via new");
  31741. if ("function" != typeof e)
  31742. throw new TypeError("not a function");
  31743. this._state = 0,
  31744. this._handled = !1,
  31745. this._value = void 0,
  31746. this._deferreds = [],
  31747. h(e, this)
  31748. }
  31749. function r(i, n) {
  31750. for (; 3 === i._state; )
  31751. i = i._value;
  31752. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31753. void o._immediateFn(function() {
  31754. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31755. if (null !== e) {
  31756. var t;
  31757. try {
  31758. t = e(i._value)
  31759. } catch (e) {
  31760. return void s(n.promise, e)
  31761. }
  31762. a(n.promise, t)
  31763. } else
  31764. (1 === i._state ? a : s)(n.promise, i._value)
  31765. }))
  31766. }
  31767. function a(e, t) {
  31768. try {
  31769. if (t === e)
  31770. throw new TypeError("A promise cannot be resolved with itself.");
  31771. if (t && ("object" == typeof t || "function" == typeof t)) {
  31772. var i = t.then;
  31773. if (t instanceof o)
  31774. return e._state = 3,
  31775. e._value = t,
  31776. void l(e);
  31777. if ("function" == typeof i)
  31778. return void h(function(e, t) {
  31779. return function() {
  31780. e.apply(t, arguments)
  31781. }
  31782. }(i, t), e)
  31783. }
  31784. e._state = 1,
  31785. e._value = t,
  31786. l(e)
  31787. } catch (t) {
  31788. s(e, t)
  31789. }
  31790. }
  31791. function s(e, t) {
  31792. e._state = 2,
  31793. e._value = t,
  31794. l(e)
  31795. }
  31796. function l(e) {
  31797. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31798. e._handled || o._unhandledRejectionFn(e._value)
  31799. });
  31800. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31801. r(e, e._deferreds[t]);
  31802. e._deferreds = null
  31803. }
  31804. function c(e, t, i) {
  31805. this.onFulfilled = "function" == typeof e ? e : null,
  31806. this.onRejected = "function" == typeof t ? t : null,
  31807. this.promise = i
  31808. }
  31809. function h(e, t) {
  31810. var i = !1;
  31811. try {
  31812. e(function(e) {
  31813. i || (i = !0,
  31814. a(t, e))
  31815. }, function(e) {
  31816. i || (i = !0,
  31817. s(t, e))
  31818. })
  31819. } catch (e) {
  31820. if (i)
  31821. return;
  31822. i = !0,
  31823. s(t, e)
  31824. }
  31825. }
  31826. var u, d;
  31827. u = this,
  31828. d = setTimeout,
  31829. o.prototype.catch = function(e) {
  31830. return this.then(null, e)
  31831. }
  31832. ,
  31833. o.prototype.then = function(e, t) {
  31834. var i = new this.constructor(n);
  31835. return r(this, new c(e,t,i)),
  31836. i
  31837. }
  31838. ,
  31839. o.all = function(e) {
  31840. var s = Array.prototype.slice.call(e);
  31841. return new o(function(n, r) {
  31842. function o(t, e) {
  31843. try {
  31844. if (e && ("object" == typeof e || "function" == typeof e)) {
  31845. var i = e.then;
  31846. if ("function" == typeof i)
  31847. return void i.call(e, function(e) {
  31848. o(t, e)
  31849. }, r)
  31850. }
  31851. s[t] = e,
  31852. 0 == --a && n(s)
  31853. } catch (e) {
  31854. r(e)
  31855. }
  31856. }
  31857. if (0 === s.length)
  31858. return n([]);
  31859. for (var a = s.length, e = 0; e < s.length; e++)
  31860. o(e, s[e])
  31861. }
  31862. )
  31863. }
  31864. ,
  31865. o.resolve = function(t) {
  31866. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31867. e(t)
  31868. }
  31869. )
  31870. }
  31871. ,
  31872. o.reject = function(i) {
  31873. return new o(function(e, t) {
  31874. t(i)
  31875. }
  31876. )
  31877. }
  31878. ,
  31879. o.race = function(r) {
  31880. return new o(function(e, t) {
  31881. for (var i = 0, n = r.length; i < n; i++)
  31882. r[i].then(e, t)
  31883. }
  31884. )
  31885. }
  31886. ,
  31887. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31888. setImmediate(e)
  31889. }
  31890. || function(e) {
  31891. d(e, 0)
  31892. }
  31893. ,
  31894. o._unhandledRejectionFn = function(e) {
  31895. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31896. }
  31897. ,
  31898. o._setImmediateFn = function(e) {
  31899. o._immediateFn = e
  31900. }
  31901. ,
  31902. o._setUnhandledRejectionFn = function(e) {
  31903. o._unhandledRejectionFn = e
  31904. }
  31905. ,
  31906. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31907. }
  31908. , {}],
  31909. 214: [function(p, i, e) {
  31910. (function(d) {
  31911. var e, t;
  31912. e = this,
  31913. t = function(I, e) {
  31914. "use strict";
  31915. var a, t, u, i, s, n, r, o = {};
  31916. return o.ByteBuffer = I,
  31917. o.Long = I.Long || null,
  31918. o.VERSION = "5.0.1",
  31919. o.WIRE_TYPES = {},
  31920. o.WIRE_TYPES.VARINT = 0,
  31921. o.WIRE_TYPES.BITS64 = 1,
  31922. o.WIRE_TYPES.LDELIM = 2,
  31923. o.WIRE_TYPES.STARTGROUP = 3,
  31924. o.WIRE_TYPES.ENDGROUP = 4,
  31925. o.WIRE_TYPES.BITS32 = 5,
  31926. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31927. o.TYPES = {
  31928. int32: {
  31929. name: "int32",
  31930. wireType: o.WIRE_TYPES.VARINT,
  31931. defaultValue: 0
  31932. },
  31933. uint32: {
  31934. name: "uint32",
  31935. wireType: o.WIRE_TYPES.VARINT,
  31936. defaultValue: 0
  31937. },
  31938. sint32: {
  31939. name: "sint32",
  31940. wireType: o.WIRE_TYPES.VARINT,
  31941. defaultValue: 0
  31942. },
  31943. int64: {
  31944. name: "int64",
  31945. wireType: o.WIRE_TYPES.VARINT,
  31946. defaultValue: o.Long ? o.Long.ZERO : void 0
  31947. },
  31948. uint64: {
  31949. name: "uint64",
  31950. wireType: o.WIRE_TYPES.VARINT,
  31951. defaultValue: o.Long ? o.Long.UZERO : void 0
  31952. },
  31953. sint64: {
  31954. name: "sint64",
  31955. wireType: o.WIRE_TYPES.VARINT,
  31956. defaultValue: o.Long ? o.Long.ZERO : void 0
  31957. },
  31958. bool: {
  31959. name: "bool",
  31960. wireType: o.WIRE_TYPES.VARINT,
  31961. defaultValue: !1
  31962. },
  31963. double: {
  31964. name: "double",
  31965. wireType: o.WIRE_TYPES.BITS64,
  31966. defaultValue: 0
  31967. },
  31968. string: {
  31969. name: "string",
  31970. wireType: o.WIRE_TYPES.LDELIM,
  31971. defaultValue: ""
  31972. },
  31973. bytes: {
  31974. name: "bytes",
  31975. wireType: o.WIRE_TYPES.LDELIM,
  31976. defaultValue: null
  31977. },
  31978. fixed32: {
  31979. name: "fixed32",
  31980. wireType: o.WIRE_TYPES.BITS32,
  31981. defaultValue: 0
  31982. },
  31983. sfixed32: {
  31984. name: "sfixed32",
  31985. wireType: o.WIRE_TYPES.BITS32,
  31986. defaultValue: 0
  31987. },
  31988. fixed64: {
  31989. name: "fixed64",
  31990. wireType: o.WIRE_TYPES.BITS64,
  31991. defaultValue: o.Long ? o.Long.UZERO : void 0
  31992. },
  31993. sfixed64: {
  31994. name: "sfixed64",
  31995. wireType: o.WIRE_TYPES.BITS64,
  31996. defaultValue: o.Long ? o.Long.ZERO : void 0
  31997. },
  31998. float: {
  31999. name: "float",
  32000. wireType: o.WIRE_TYPES.BITS32,
  32001. defaultValue: 0
  32002. },
  32003. enum: {
  32004. name: "enum",
  32005. wireType: o.WIRE_TYPES.VARINT,
  32006. defaultValue: 0
  32007. },
  32008. message: {
  32009. name: "message",
  32010. wireType: o.WIRE_TYPES.LDELIM,
  32011. defaultValue: null
  32012. },
  32013. group: {
  32014. name: "group",
  32015. wireType: o.WIRE_TYPES.STARTGROUP,
  32016. defaultValue: null
  32017. }
  32018. },
  32019. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  32020. o.ID_MIN = 1,
  32021. o.ID_MAX = 536870911,
  32022. o.convertFieldsToCamelCase = !1,
  32023. o.populateAccessors = !0,
  32024. o.populateDefaults = !0,
  32025. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32026. r.XHR = function() {
  32027. for (var e = [function() {
  32028. return new XMLHttpRequest
  32029. }
  32030. , function() {
  32031. return new ActiveXObject("Msxml2.XMLHTTP")
  32032. }
  32033. , function() {
  32034. return new ActiveXObject("Msxml3.XMLHTTP")
  32035. }
  32036. , function() {
  32037. return new ActiveXObject("Microsoft.XMLHTTP")
  32038. }
  32039. ], t = null, i = 0; i < e.length; i++) {
  32040. try {
  32041. t = e[i]()
  32042. } catch (e) {
  32043. continue
  32044. }
  32045. break
  32046. }
  32047. if (!t)
  32048. throw Error("XMLHttpRequest is not supported");
  32049. return t
  32050. }
  32051. ,
  32052. r.fetch = function(e, i) {
  32053. if (i && "function" != typeof i && (i = null),
  32054. r.IS_NODE) {
  32055. var t = p("fs");
  32056. if (i)
  32057. t.readFile(e, function(e, t) {
  32058. i(e ? null : "" + t)
  32059. });
  32060. else
  32061. try {
  32062. return t.readFileSync(e)
  32063. } catch (e) {
  32064. return null
  32065. }
  32066. } else {
  32067. var n = r.XHR();
  32068. if (n.open("GET", e, !!i),
  32069. n.setRequestHeader("Accept", "text/plain"),
  32070. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32071. !i)
  32072. return n.send(null),
  32073. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32074. if (n.onreadystatechange = function() {
  32075. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32076. }
  32077. ,
  32078. 4 == n.readyState)
  32079. return;
  32080. n.send(null)
  32081. }
  32082. }
  32083. ,
  32084. r.toCamelCase = function(e) {
  32085. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32086. return t.toUpperCase()
  32087. })
  32088. }
  32089. ,
  32090. r),
  32091. o.Lang = {
  32092. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32093. RULE: /^(?:required|optional|repeated|map)$/,
  32094. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32095. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32096. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32097. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32098. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32099. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32100. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32101. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32102. NUMBER_OCT: /^0[0-7]+$/,
  32103. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32104. BOOL: /^(?:true|false)$/i,
  32105. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32106. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32107. WHITESPACE: /\s/,
  32108. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32109. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32110. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32111. },
  32112. o.DotProto = function(r, a) {
  32113. function s(e, t) {
  32114. var i = -1
  32115. , n = 1;
  32116. if ("-" == e.charAt(0) && (n = -1,
  32117. e = e.substring(1)),
  32118. a.NUMBER_DEC.test(e))
  32119. i = parseInt(e);
  32120. else if (a.NUMBER_HEX.test(e))
  32121. i = parseInt(e.substring(2), 16);
  32122. else {
  32123. if (!a.NUMBER_OCT.test(e))
  32124. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32125. i = parseInt(e.substring(1), 8)
  32126. }
  32127. if (i = n * i | 0,
  32128. !t && i < 0)
  32129. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32130. return i
  32131. }
  32132. function o(e) {
  32133. var t = 1;
  32134. if ("-" == e.charAt(0) && (t = -1,
  32135. e = e.substring(1)),
  32136. a.NUMBER_DEC.test(e))
  32137. return t * parseInt(e, 10);
  32138. if (a.NUMBER_HEX.test(e))
  32139. return t * parseInt(e.substring(2), 16);
  32140. if (a.NUMBER_OCT.test(e))
  32141. return t * parseInt(e.substring(1), 8);
  32142. if ("inf" === e)
  32143. return t * (1 / 0);
  32144. if ("nan" === e)
  32145. return NaN;
  32146. if (a.NUMBER_FLT.test(e))
  32147. return t * parseFloat(e);
  32148. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32149. }
  32150. function n(e, t, i) {
  32151. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32152. e[t].push(i))
  32153. }
  32154. function t(e) {
  32155. this.source = e + "",
  32156. this.index = 0,
  32157. this.line = 1,
  32158. this.stack = [],
  32159. this._stringOpen = null
  32160. }
  32161. var e = {}
  32162. , i = t.prototype;
  32163. i._readString = function() {
  32164. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32165. e.lastIndex = this.index - 1;
  32166. var t = e.exec(this.source);
  32167. if (!t)
  32168. throw Error("unterminated string");
  32169. return this.index = e.lastIndex,
  32170. this.stack.push(this._stringOpen),
  32171. this._stringOpen = null,
  32172. t[1]
  32173. }
  32174. ,
  32175. i.next = function() {
  32176. if (0 < this.stack.length)
  32177. return this.stack.shift();
  32178. if (this.index >= this.source.length)
  32179. return null;
  32180. if (null !== this._stringOpen)
  32181. return this._readString();
  32182. var e, t, i;
  32183. do {
  32184. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32185. if ("\n" === i && ++this.line,
  32186. ++this.index === this.source.length)
  32187. return null;
  32188. if ("/" === this.source.charAt(this.index))
  32189. if (++this.index,
  32190. "/" === this.source.charAt(this.index)) {
  32191. for (; "\n" !== this.source.charAt(++this.index); )
  32192. if (this.index == this.source.length)
  32193. return null;
  32194. ++this.index,
  32195. ++this.line,
  32196. e = !0
  32197. } else {
  32198. if ("*" !== (i = this.source.charAt(this.index)))
  32199. return "/";
  32200. do {
  32201. if ("\n" === i && ++this.line,
  32202. ++this.index === this.source.length)
  32203. return null;
  32204. t = i,
  32205. i = this.source.charAt(this.index)
  32206. } while ("*" !== t || "/" !== i);++this.index,
  32207. e = !0
  32208. }
  32209. } while (e);if (this.index === this.source.length)
  32210. return null;
  32211. var n = this.index;
  32212. if (a.DELIM.lastIndex = 0,
  32213. !a.DELIM.test(this.source.charAt(n++)))
  32214. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32215. ++n;
  32216. var r = this.source.substring(this.index, this.index = n);
  32217. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32218. r
  32219. }
  32220. ,
  32221. i.peek = function() {
  32222. if (0 === this.stack.length) {
  32223. var e = this.next();
  32224. if (null === e)
  32225. return null;
  32226. this.stack.push(e)
  32227. }
  32228. return this.stack[0]
  32229. }
  32230. ,
  32231. i.skip = function(e) {
  32232. var t = this.next();
  32233. if (t !== e)
  32234. throw Error("illegal '" + t + "', '" + e + "' expected")
  32235. }
  32236. ,
  32237. i.omit = function(e) {
  32238. return this.peek() === e && (this.next(),
  32239. !0)
  32240. }
  32241. ,
  32242. i.toString = function() {
  32243. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32244. }
  32245. ,
  32246. e.Tokenizer = t;
  32247. function l(e) {
  32248. this.tn = new t(e),
  32249. this.proto3 = !1
  32250. }
  32251. var c = l.prototype;
  32252. return c.parse = function() {
  32253. var e, t, i = {
  32254. name: "[ROOT]",
  32255. package: null,
  32256. messages: [],
  32257. enums: [],
  32258. imports: [],
  32259. options: {},
  32260. services: []
  32261. }, n = !0;
  32262. try {
  32263. for (; e = this.tn.next(); )
  32264. switch (e) {
  32265. case "package":
  32266. if (!n || null !== i.package)
  32267. throw Error("unexpected 'package'");
  32268. if (e = this.tn.next(),
  32269. !a.TYPEREF.test(e))
  32270. throw Error("illegal package name: " + e);
  32271. this.tn.skip(";"),
  32272. i.package = e;
  32273. break;
  32274. case "import":
  32275. if (!n)
  32276. throw Error("unexpected 'import'");
  32277. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32278. e = this._readString(),
  32279. this.tn.skip(";"),
  32280. t || i.imports.push(e);
  32281. break;
  32282. case "syntax":
  32283. if (!n)
  32284. throw Error("unexpected 'syntax'");
  32285. this.tn.skip("="),
  32286. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32287. this.tn.skip(";");
  32288. break;
  32289. case "message":
  32290. this._parseMessage(i, null),
  32291. n = !1;
  32292. break;
  32293. case "enum":
  32294. this._parseEnum(i),
  32295. n = !1;
  32296. break;
  32297. case "option":
  32298. this._parseOption(i);
  32299. break;
  32300. case "service":
  32301. this._parseService(i);
  32302. break;
  32303. case "extend":
  32304. this._parseExtend(i);
  32305. break;
  32306. default:
  32307. throw Error("unexpected '" + e + "'")
  32308. }
  32309. } catch (e) {
  32310. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32311. e
  32312. }
  32313. return delete i.name,
  32314. i
  32315. }
  32316. ,
  32317. l.parse = function(e) {
  32318. return new l(e).parse()
  32319. }
  32320. ,
  32321. c._readString = function() {
  32322. var e, t, i = "";
  32323. do {
  32324. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32325. throw Error("illegal string delimiter: " + t);
  32326. i += this.tn.next(),
  32327. this.tn.skip(t),
  32328. e = this.tn.peek()
  32329. } while ('"' === e || '"' === e);return i
  32330. }
  32331. ,
  32332. c._readValue = function(e) {
  32333. var t = this.tn.peek();
  32334. if ('"' === t || "'" === t)
  32335. return this._readString();
  32336. if (this.tn.next(),
  32337. a.NUMBER.test(t))
  32338. return o(t);
  32339. if (a.BOOL.test(t))
  32340. return "true" === t.toLowerCase();
  32341. if (e && a.TYPEREF.test(t))
  32342. return t;
  32343. throw Error("illegal value: " + t)
  32344. }
  32345. ,
  32346. c._parseOption = function(e, t) {
  32347. var i = this.tn.next()
  32348. , n = !1;
  32349. if ("(" === i && (n = !0,
  32350. i = this.tn.next()),
  32351. !a.TYPEREF.test(i))
  32352. throw Error("illegal option name: " + i);
  32353. var r = i;
  32354. n && (this.tn.skip(")"),
  32355. r = "(" + r + ")",
  32356. i = this.tn.peek(),
  32357. a.FQTYPEREF.test(i) && (r += i,
  32358. this.tn.next())),
  32359. this.tn.skip("="),
  32360. this._parseOptionValue(e, r),
  32361. t || this.tn.skip(";")
  32362. }
  32363. ,
  32364. c._parseOptionValue = function(e, t) {
  32365. var i = this.tn.peek();
  32366. if ("{" !== i)
  32367. n(e.options, t, this._readValue(!0));
  32368. else
  32369. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32370. if (!a.NAME.test(i))
  32371. throw Error("illegal option name: " + t + "." + i);
  32372. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32373. }
  32374. }
  32375. ,
  32376. c._parseService = function(e) {
  32377. var t = this.tn.next();
  32378. if (!a.NAME.test(t))
  32379. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32380. var i = {
  32381. name: t,
  32382. rpc: {},
  32383. options: {}
  32384. };
  32385. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32386. if ("option" === t)
  32387. this._parseOption(i);
  32388. else {
  32389. if ("rpc" !== t)
  32390. throw Error("illegal service token: " + t);
  32391. this._parseServiceRPC(i)
  32392. }
  32393. this.tn.omit(";"),
  32394. e.services.push(i)
  32395. }
  32396. ,
  32397. c._parseServiceRPC = function(e) {
  32398. var t = this.tn.next();
  32399. if (!a.NAME.test(t))
  32400. throw Error("illegal rpc service method name: " + t);
  32401. var i = t
  32402. , n = {
  32403. request: null,
  32404. response: null,
  32405. request_stream: !1,
  32406. response_stream: !1,
  32407. options: {}
  32408. };
  32409. if (this.tn.skip("("),
  32410. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32411. t = this.tn.next()),
  32412. !a.TYPEREF.test(t))
  32413. throw Error("illegal rpc service request type: " + t);
  32414. if (n.request = t,
  32415. this.tn.skip(")"),
  32416. "returns" !== (t = this.tn.next()).toLowerCase())
  32417. throw Error("illegal rpc service request type delimiter: " + t);
  32418. if (this.tn.skip("("),
  32419. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32420. t = this.tn.next()),
  32421. n.response = t,
  32422. this.tn.skip(")"),
  32423. "{" === (t = this.tn.peek())) {
  32424. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32425. if ("option" !== t)
  32426. throw Error("illegal rpc service token: " + t);
  32427. this._parseOption(n)
  32428. }
  32429. this.tn.omit(";")
  32430. } else
  32431. this.tn.skip(";");
  32432. void 0 === e.rpc && (e.rpc = {}),
  32433. e.rpc[i] = n
  32434. }
  32435. ,
  32436. c._parseMessage = function(e, t) {
  32437. var i = !!t
  32438. , n = this.tn.next()
  32439. , r = {
  32440. name: "",
  32441. fields: [],
  32442. enums: [],
  32443. messages: [],
  32444. options: {},
  32445. services: [],
  32446. oneofs: {}
  32447. };
  32448. if (!a.NAME.test(n))
  32449. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32450. for (r.name = n,
  32451. i && (this.tn.skip("="),
  32452. t.id = s(this.tn.next()),
  32453. r.isGroup = !0),
  32454. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32455. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32456. if (a.RULE.test(n))
  32457. this._parseMessageField(r, n);
  32458. else if ("oneof" === n)
  32459. this._parseMessageOneOf(r);
  32460. else if ("enum" === n)
  32461. this._parseEnum(r);
  32462. else if ("message" === n)
  32463. this._parseMessage(r);
  32464. else if ("option" === n)
  32465. this._parseOption(r);
  32466. else if ("service" === n)
  32467. this._parseService(r);
  32468. else if ("extensions" === n)
  32469. r.extensions = this._parseExtensionRanges();
  32470. else if ("reserved" === n)
  32471. this._parseIgnored();
  32472. else if ("extend" === n)
  32473. this._parseExtend(r);
  32474. else {
  32475. if (!a.TYPEREF.test(n))
  32476. throw Error("illegal message token: " + n);
  32477. if (!this.proto3)
  32478. throw Error("illegal field rule: " + n);
  32479. this._parseMessageField(r, "optional", n)
  32480. }
  32481. return this.tn.omit(";"),
  32482. e.messages.push(r),
  32483. r
  32484. }
  32485. ,
  32486. c._parseIgnored = function() {
  32487. for (; ";" !== this.tn.peek(); )
  32488. this.tn.next();
  32489. this.tn.skip(";")
  32490. }
  32491. ,
  32492. c._parseMessageField = function(e, t, i) {
  32493. if (!a.RULE.test(t))
  32494. throw Error("illegal message field rule: " + t);
  32495. var n, r = {
  32496. rule: t,
  32497. type: "",
  32498. name: "",
  32499. options: {},
  32500. id: 0
  32501. };
  32502. if ("map" === t) {
  32503. if (i)
  32504. throw Error("illegal type: " + i);
  32505. if (this.tn.skip("<"),
  32506. n = this.tn.next(),
  32507. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32508. throw Error("illegal message field type: " + n);
  32509. if (r.keytype = n,
  32510. this.tn.skip(","),
  32511. n = this.tn.next(),
  32512. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32513. throw Error("illegal message field: " + n);
  32514. if (r.type = n,
  32515. this.tn.skip(">"),
  32516. n = this.tn.next(),
  32517. !a.NAME.test(n))
  32518. throw Error("illegal message field name: " + n);
  32519. r.name = n,
  32520. this.tn.skip("="),
  32521. r.id = s(this.tn.next()),
  32522. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32523. this.tn.skip(";")
  32524. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32525. var o = this._parseMessage(e, r);
  32526. if (!/^[A-Z]/.test(o.name))
  32527. throw Error("illegal group name: " + o.name);
  32528. r.type = o.name,
  32529. r.name = o.name.toLowerCase(),
  32530. this.tn.omit(";")
  32531. } else {
  32532. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32533. throw Error("illegal message field type: " + i);
  32534. if (r.type = i,
  32535. n = this.tn.next(),
  32536. !a.NAME.test(n))
  32537. throw Error("illegal message field name: " + n);
  32538. r.name = n,
  32539. this.tn.skip("="),
  32540. r.id = s(this.tn.next()),
  32541. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32542. this.tn.skip(";")
  32543. }
  32544. return e.fields.push(r),
  32545. r
  32546. }
  32547. ,
  32548. c._parseMessageOneOf = function(e) {
  32549. var t = this.tn.next();
  32550. if (!a.NAME.test(t))
  32551. throw Error("illegal oneof name: " + t);
  32552. var i, n = t, r = [];
  32553. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32554. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32555. r.push(i.id);
  32556. this.tn.omit(";"),
  32557. e.oneofs[n] = r
  32558. }
  32559. ,
  32560. c._parseFieldOptions = function(e) {
  32561. this.tn.skip("[");
  32562. for (var t = !0; "]" !== this.tn.peek(); )
  32563. t || this.tn.skip(","),
  32564. this._parseOption(e, !0),
  32565. t = !1;
  32566. this.tn.next()
  32567. }
  32568. ,
  32569. c._parseEnum = function(e) {
  32570. var t = {
  32571. name: "",
  32572. values: [],
  32573. options: {}
  32574. }
  32575. , i = this.tn.next();
  32576. if (!a.NAME.test(i))
  32577. throw Error("illegal name: " + i);
  32578. for (t.name = i,
  32579. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32580. if ("option" === i)
  32581. this._parseOption(t);
  32582. else {
  32583. if (!a.NAME.test(i))
  32584. throw Error("illegal name: " + i);
  32585. this.tn.skip("=");
  32586. var n = {
  32587. name: i,
  32588. id: s(this.tn.next(), !0)
  32589. };
  32590. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32591. options: {}
  32592. }),
  32593. this.tn.skip(";"),
  32594. t.values.push(n)
  32595. }
  32596. this.tn.omit(";"),
  32597. e.enums.push(t)
  32598. }
  32599. ,
  32600. c._parseExtensionRanges = function() {
  32601. var e, t, i, n = [];
  32602. do {
  32603. for (t = []; ; ) {
  32604. switch (e = this.tn.next()) {
  32605. case "min":
  32606. i = r.ID_MIN;
  32607. break;
  32608. case "max":
  32609. i = r.ID_MAX;
  32610. break;
  32611. default:
  32612. i = o(e)
  32613. }
  32614. if (t.push(i),
  32615. 2 === t.length)
  32616. break;
  32617. if ("to" !== this.tn.peek()) {
  32618. t.push(i);
  32619. break
  32620. }
  32621. this.tn.next()
  32622. }
  32623. n.push(t)
  32624. } while (this.tn.omit(","));return this.tn.skip(";"),
  32625. n
  32626. }
  32627. ,
  32628. c._parseExtend = function(e) {
  32629. var t = this.tn.next();
  32630. if (!a.TYPEREF.test(t))
  32631. throw Error("illegal extend reference: " + t);
  32632. var i = {
  32633. ref: t,
  32634. fields: []
  32635. };
  32636. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32637. if (a.RULE.test(t))
  32638. this._parseMessageField(i, t);
  32639. else {
  32640. if (!a.TYPEREF.test(t))
  32641. throw Error("illegal extend token: " + t);
  32642. if (!this.proto3)
  32643. throw Error("illegal field rule: " + t);
  32644. this._parseMessageField(i, "optional", t)
  32645. }
  32646. return this.tn.omit(";"),
  32647. e.messages.push(i),
  32648. i
  32649. }
  32650. ,
  32651. c.toString = function() {
  32652. return "Parser at line " + this.tn.line
  32653. }
  32654. ,
  32655. e.Parser = l,
  32656. e
  32657. }(o, o.Lang),
  32658. o.Reflect = function(g) {
  32659. function a(e, t) {
  32660. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32661. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32662. if ("string" == typeof e)
  32663. return g.Long.fromString(e, t || !1, 10);
  32664. if ("number" == typeof e)
  32665. return g.Long.fromNumber(e, t || !1);
  32666. throw Error("not convertible to Long")
  32667. }
  32668. function m(e, t) {
  32669. var i = t.readVarint32()
  32670. , n = 7 & i
  32671. , r = i >>> 3;
  32672. switch (n) {
  32673. case g.WIRE_TYPES.VARINT:
  32674. for (; 128 == (128 & (i = t.readUint8())); )
  32675. ;
  32676. break;
  32677. case g.WIRE_TYPES.BITS64:
  32678. t.offset += 8;
  32679. break;
  32680. case g.WIRE_TYPES.LDELIM:
  32681. i = t.readVarint32(),
  32682. t.offset += i;
  32683. break;
  32684. case g.WIRE_TYPES.STARTGROUP:
  32685. m(r, t);
  32686. break;
  32687. case g.WIRE_TYPES.ENDGROUP:
  32688. if (r === e)
  32689. return !1;
  32690. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32691. case g.WIRE_TYPES.BITS32:
  32692. t.offset += 4;
  32693. break;
  32694. default:
  32695. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32696. }
  32697. return !0
  32698. }
  32699. function h(e, t, i) {
  32700. this.builder = e,
  32701. this.parent = t,
  32702. this.name = i,
  32703. this.className
  32704. }
  32705. var s = {}
  32706. , e = h.prototype;
  32707. e.fqn = function() {
  32708. for (var e = this.name, t = this; null != (t = t.parent); )
  32709. e = t.name + "." + e;
  32710. return e
  32711. }
  32712. ,
  32713. e.toString = function(e) {
  32714. return (e ? this.className + " " : "") + this.fqn()
  32715. }
  32716. ,
  32717. e.build = function() {
  32718. throw Error(this.toString(!0) + " cannot be built directly")
  32719. }
  32720. ,
  32721. s.T = h;
  32722. function l(e, t, i, n, r) {
  32723. h.call(this, e, t, i),
  32724. this.className = "Namespace",
  32725. this.children = [],
  32726. this.options = n || {},
  32727. this.syntax = r || "proto2"
  32728. }
  32729. var t = l.prototype = Object.create(h.prototype);
  32730. t.getChildren = function(e) {
  32731. if (null == (e = e || null))
  32732. return this.children.slice();
  32733. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32734. this.children[i]instanceof e && t.push(this.children[i]);
  32735. return t
  32736. }
  32737. ,
  32738. t.addChild = function(e) {
  32739. var t;
  32740. if (t = this.getChild(e.name))
  32741. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32742. t.name = t.originalName;
  32743. else {
  32744. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32745. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32746. e.name = e.originalName
  32747. }
  32748. this.children.push(e)
  32749. }
  32750. ,
  32751. t.getChild = function(e) {
  32752. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32753. if (this.children[i][t] === e)
  32754. return this.children[i];
  32755. return null
  32756. }
  32757. ,
  32758. t.resolve = function(e, t) {
  32759. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32760. if ("" === n[o]) {
  32761. for (; null !== r.parent; )
  32762. r = r.parent;
  32763. o++
  32764. }
  32765. do {
  32766. do {
  32767. if (!(r instanceof s.Namespace)) {
  32768. r = null;
  32769. break
  32770. }
  32771. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32772. r = null;
  32773. break
  32774. }
  32775. r = i,
  32776. o++
  32777. } while (o < n.length);if (null != r)
  32778. break;
  32779. if (null !== this.parent)
  32780. return this.parent.resolve(e, t)
  32781. } while (null != r);return r
  32782. }
  32783. ,
  32784. t.qn = function(e) {
  32785. for (var t = [], i = e; t.unshift(i.name),
  32786. null !== (i = i.parent); )
  32787. ;
  32788. for (var n = 1; n <= t.length; n++) {
  32789. var r = t.slice(t.length - n);
  32790. if (e === this.resolve(r, e instanceof s.Namespace))
  32791. return r.join(".")
  32792. }
  32793. return e.fqn()
  32794. }
  32795. ,
  32796. t.build = function() {
  32797. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32798. (e = i[n])instanceof l && (t[e.name] = e.build());
  32799. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32800. value: this.buildOpt()
  32801. }),
  32802. t
  32803. }
  32804. ,
  32805. t.buildOpt = function() {
  32806. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32807. var r = t[i]
  32808. , o = this.options[t[i]];
  32809. e[r] = o
  32810. }
  32811. return e
  32812. }
  32813. ,
  32814. t.getOption = function(e) {
  32815. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32816. }
  32817. ,
  32818. s.Namespace = l;
  32819. function u(e, t, i, n) {
  32820. if (this.type = e,
  32821. this.resolvedType = t,
  32822. this.isMapKey = i,
  32823. this.syntax = n,
  32824. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32825. throw Error("Invalid map key type: " + e.name)
  32826. }
  32827. var i = u.prototype;
  32828. u.defaultFieldValue = function(e) {
  32829. if ("string" == typeof e && (e = g.TYPES[e]),
  32830. void 0 === e.defaultValue)
  32831. throw Error("default value for type " + e.name + " is not supported");
  32832. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32833. }
  32834. ,
  32835. i.verifyValue = function(t) {
  32836. function i(e, t) {
  32837. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32838. }
  32839. var n = this;
  32840. switch (this.type) {
  32841. case g.TYPES.int32:
  32842. case g.TYPES.sint32:
  32843. case g.TYPES.sfixed32:
  32844. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32845. 4294967295 < t ? 0 | t : t;
  32846. case g.TYPES.uint32:
  32847. case g.TYPES.fixed32:
  32848. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32849. t < 0 ? t >>> 0 : t;
  32850. case g.TYPES.int64:
  32851. case g.TYPES.sint64:
  32852. case g.TYPES.sfixed64:
  32853. if (g.Long)
  32854. try {
  32855. return a(t, !1)
  32856. } catch (e) {
  32857. i(typeof t, e.message)
  32858. }
  32859. else
  32860. i(typeof t, "requires Long.js");
  32861. case g.TYPES.uint64:
  32862. case g.TYPES.fixed64:
  32863. if (g.Long)
  32864. try {
  32865. return a(t, !0)
  32866. } catch (e) {
  32867. i(typeof t, e.message)
  32868. }
  32869. else
  32870. i(typeof t, "requires Long.js");
  32871. case g.TYPES.bool:
  32872. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32873. t;
  32874. case g.TYPES.float:
  32875. case g.TYPES.double:
  32876. return "number" != typeof t && i(typeof t, "not a number"),
  32877. t;
  32878. case g.TYPES.string:
  32879. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32880. "" + t;
  32881. case g.TYPES.bytes:
  32882. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32883. case g.TYPES.enum:
  32884. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32885. for (o = 0; o < e.length; o++) {
  32886. if (e[o].name == t)
  32887. return e[o].id;
  32888. if (e[o].id == t)
  32889. return e[o].id
  32890. }
  32891. if ("proto3" === this.syntax)
  32892. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32893. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32894. t;
  32895. i(t, "not a valid enum value");
  32896. case g.TYPES.group:
  32897. case g.TYPES.message:
  32898. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32899. t instanceof this.resolvedType.clazz)
  32900. return t;
  32901. if (t instanceof g.Builder.Message) {
  32902. var r = {};
  32903. for (var o in t)
  32904. t.hasOwnProperty(o) && (r[o] = t[o]);
  32905. t = r
  32906. }
  32907. return new this.resolvedType.clazz(t)
  32908. }
  32909. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32910. }
  32911. ,
  32912. i.calculateLength = function(e, t) {
  32913. if (null === t)
  32914. return 0;
  32915. var i;
  32916. switch (this.type) {
  32917. case g.TYPES.int32:
  32918. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32919. case g.TYPES.uint32:
  32920. return I.calculateVarint32(t);
  32921. case g.TYPES.sint32:
  32922. return I.calculateVarint32(I.zigZagEncode32(t));
  32923. case g.TYPES.fixed32:
  32924. case g.TYPES.sfixed32:
  32925. case g.TYPES.float:
  32926. return 4;
  32927. case g.TYPES.int64:
  32928. case g.TYPES.uint64:
  32929. return I.calculateVarint64(t);
  32930. case g.TYPES.sint64:
  32931. return I.calculateVarint64(I.zigZagEncode64(t));
  32932. case g.TYPES.fixed64:
  32933. case g.TYPES.sfixed64:
  32934. return 8;
  32935. case g.TYPES.bool:
  32936. return 1;
  32937. case g.TYPES.enum:
  32938. return I.calculateVarint32(t);
  32939. case g.TYPES.double:
  32940. return 8;
  32941. case g.TYPES.string:
  32942. return i = I.calculateUTF8Bytes(t),
  32943. I.calculateVarint32(i) + i;
  32944. case g.TYPES.bytes:
  32945. if (t.remaining() < 0)
  32946. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32947. return I.calculateVarint32(t.remaining()) + t.remaining();
  32948. case g.TYPES.message:
  32949. return i = this.resolvedType.calculate(t),
  32950. I.calculateVarint32(i) + i;
  32951. case g.TYPES.group:
  32952. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32953. }
  32954. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32955. }
  32956. ,
  32957. i.encodeValue = function(e, t, i) {
  32958. if (null === t)
  32959. return i;
  32960. switch (this.type) {
  32961. case g.TYPES.int32:
  32962. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32963. break;
  32964. case g.TYPES.uint32:
  32965. i.writeVarint32(t);
  32966. break;
  32967. case g.TYPES.sint32:
  32968. i.writeVarint32ZigZag(t);
  32969. break;
  32970. case g.TYPES.fixed32:
  32971. i.writeUint32(t);
  32972. break;
  32973. case g.TYPES.sfixed32:
  32974. i.writeInt32(t);
  32975. break;
  32976. case g.TYPES.int64:
  32977. case g.TYPES.uint64:
  32978. i.writeVarint64(t);
  32979. break;
  32980. case g.TYPES.sint64:
  32981. i.writeVarint64ZigZag(t);
  32982. break;
  32983. case g.TYPES.fixed64:
  32984. i.writeUint64(t);
  32985. break;
  32986. case g.TYPES.sfixed64:
  32987. i.writeInt64(t);
  32988. break;
  32989. case g.TYPES.bool:
  32990. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32991. break;
  32992. case g.TYPES.enum:
  32993. i.writeVarint32(t);
  32994. break;
  32995. case g.TYPES.float:
  32996. i.writeFloat32(t);
  32997. break;
  32998. case g.TYPES.double:
  32999. i.writeFloat64(t);
  33000. break;
  33001. case g.TYPES.string:
  33002. i.writeVString(t);
  33003. break;
  33004. case g.TYPES.bytes:
  33005. if (t.remaining() < 0)
  33006. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33007. var n = t.offset;
  33008. i.writeVarint32(t.remaining()),
  33009. i.append(t),
  33010. t.offset = n;
  33011. break;
  33012. case g.TYPES.message:
  33013. var r = (new I).LE();
  33014. this.resolvedType.encode(t, r),
  33015. i.writeVarint32(r.offset),
  33016. i.append(r.flip());
  33017. break;
  33018. case g.TYPES.group:
  33019. this.resolvedType.encode(t, i),
  33020. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33021. break;
  33022. default:
  33023. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33024. }
  33025. return i
  33026. }
  33027. ,
  33028. i.decode = function(e, t, i) {
  33029. if (t != this.type.wireType)
  33030. throw Error("Unexpected wire type for element");
  33031. var n, r;
  33032. switch (this.type) {
  33033. case g.TYPES.int32:
  33034. return 0 | e.readVarint32();
  33035. case g.TYPES.uint32:
  33036. return e.readVarint32() >>> 0;
  33037. case g.TYPES.sint32:
  33038. return 0 | e.readVarint32ZigZag();
  33039. case g.TYPES.fixed32:
  33040. return e.readUint32() >>> 0;
  33041. case g.TYPES.sfixed32:
  33042. return 0 | e.readInt32();
  33043. case g.TYPES.int64:
  33044. return e.readVarint64();
  33045. case g.TYPES.uint64:
  33046. return e.readVarint64().toUnsigned();
  33047. case g.TYPES.sint64:
  33048. return e.readVarint64ZigZag();
  33049. case g.TYPES.fixed64:
  33050. return e.readUint64();
  33051. case g.TYPES.sfixed64:
  33052. return e.readInt64();
  33053. case g.TYPES.bool:
  33054. return !!e.readVarint32();
  33055. case g.TYPES.enum:
  33056. return e.readVarint32();
  33057. case g.TYPES.float:
  33058. return e.readFloat();
  33059. case g.TYPES.double:
  33060. return e.readDouble();
  33061. case g.TYPES.string:
  33062. return e.readVString();
  33063. case g.TYPES.bytes:
  33064. if (r = e.readVarint32(),
  33065. e.remaining() < r)
  33066. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33067. return (n = e.clone()).limit = n.offset + r,
  33068. e.offset += r,
  33069. n;
  33070. case g.TYPES.message:
  33071. return r = e.readVarint32(),
  33072. this.resolvedType.decode(e, r);
  33073. case g.TYPES.group:
  33074. return this.resolvedType.decode(e, -1, i)
  33075. }
  33076. throw Error("[INTERNAL] Illegal decode type")
  33077. }
  33078. ,
  33079. i.valueFromString = function(e) {
  33080. if (!this.isMapKey)
  33081. throw Error("valueFromString() called on non-map-key element");
  33082. switch (this.type) {
  33083. case g.TYPES.int32:
  33084. case g.TYPES.sint32:
  33085. case g.TYPES.sfixed32:
  33086. case g.TYPES.uint32:
  33087. case g.TYPES.fixed32:
  33088. return this.verifyValue(parseInt(e));
  33089. case g.TYPES.int64:
  33090. case g.TYPES.sint64:
  33091. case g.TYPES.sfixed64:
  33092. case g.TYPES.uint64:
  33093. case g.TYPES.fixed64:
  33094. return this.verifyValue(e);
  33095. case g.TYPES.bool:
  33096. return "true" === e;
  33097. case g.TYPES.string:
  33098. return this.verifyValue(e);
  33099. case g.TYPES.bytes:
  33100. return I.fromBinary(e)
  33101. }
  33102. }
  33103. ,
  33104. i.valueToString = function(e) {
  33105. if (!this.isMapKey)
  33106. throw Error("valueToString() called on non-map-key element");
  33107. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33108. }
  33109. ,
  33110. s.Element = u;
  33111. var d = function(e, t, i, n, r, o) {
  33112. l.call(this, e, t, i, n, o),
  33113. this.className = "Message",
  33114. this.extensions = void 0,
  33115. this.clazz = null,
  33116. this.isGroup = !!r,
  33117. this._fields = null,
  33118. this._fieldsById = null,
  33119. this._fieldsByName = null
  33120. }
  33121. , n = d.prototype = Object.create(l.prototype);
  33122. n.build = function(e) {
  33123. if (this.clazz && !e)
  33124. return this.clazz;
  33125. var t = function(u, a) {
  33126. function d(e, i, n, r) {
  33127. if (null === e || "object" != typeof e) {
  33128. if (r && r instanceof u.Reflect.Enum) {
  33129. var t = u.Reflect.Enum.getName(r.object, e);
  33130. if (null !== t)
  33131. return t
  33132. }
  33133. return e
  33134. }
  33135. if (I.isByteBuffer(e))
  33136. return i ? e.toBase64() : e.toBuffer();
  33137. if (u.Long.isLong(e))
  33138. return n ? e.toString() : u.Long.fromValue(e);
  33139. var o;
  33140. if (Array.isArray(e))
  33141. return o = [],
  33142. e.forEach(function(e, t) {
  33143. o[t] = d(e, i, n, r)
  33144. }),
  33145. o;
  33146. if (o = {},
  33147. e instanceof u.Map) {
  33148. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33149. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33150. return o
  33151. }
  33152. var l = e.$type
  33153. , c = void 0;
  33154. for (var h in e)
  33155. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33156. return o
  33157. }
  33158. var s = a.getChildren(u.Reflect.Message.Field)
  33159. , l = a.getChildren(u.Reflect.Message.OneOf)
  33160. , c = function(e, t) {
  33161. u.Builder.Message.call(this);
  33162. for (var i = 0, n = l.length; i < n; ++i)
  33163. this[l[i].name] = null;
  33164. for (i = 0,
  33165. n = s.length; i < n; ++i) {
  33166. var r = s[i];
  33167. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33168. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33169. }
  33170. var o;
  33171. if (0 < arguments.length)
  33172. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  33173. for (i = 0,
  33174. n = arguments.length; i < n; ++i)
  33175. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33176. else
  33177. this.$set(e)
  33178. }
  33179. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33180. o.add = function(e, t, i) {
  33181. var n = a._fieldsByName[e];
  33182. if (!i) {
  33183. if (!n)
  33184. throw Error(this + "#" + e + " is undefined");
  33185. if (!(n instanceof u.Reflect.Message.Field))
  33186. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33187. if (!n.repeated)
  33188. throw Error(this + "#" + e + " is not a repeated field");
  33189. t = n.verifyValue(t, !0)
  33190. }
  33191. return null === this[e] && (this[e] = []),
  33192. this[e].push(t),
  33193. this
  33194. }
  33195. ,
  33196. o.$add = o.add,
  33197. o.set = function(e, t, i) {
  33198. if (e && "object" == typeof e) {
  33199. for (var n in i = t,
  33200. e)
  33201. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33202. return this
  33203. }
  33204. var r = a._fieldsByName[e];
  33205. if (i)
  33206. this[e] = t;
  33207. else {
  33208. if (!r)
  33209. throw Error(this + "#" + e + " is not a field: undefined");
  33210. if (!(r instanceof u.Reflect.Message.Field))
  33211. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33212. this[r.name] = t = r.verifyValue(t)
  33213. }
  33214. if (r && r.oneof) {
  33215. var o = this[r.oneof.name];
  33216. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33217. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33218. }
  33219. return this
  33220. }
  33221. ,
  33222. o.$set = o.set,
  33223. o.get = function(e, t) {
  33224. if (t)
  33225. return this[e];
  33226. var i = a._fieldsByName[e];
  33227. if (!(i && i instanceof u.Reflect.Message.Field))
  33228. throw Error(this + "#" + e + " is not a field: undefined");
  33229. if (!(i instanceof u.Reflect.Message.Field))
  33230. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33231. return this[i.name]
  33232. }
  33233. ,
  33234. o.$get = o.get;
  33235. for (var e = 0; e < s.length; e++) {
  33236. var t = s[e];
  33237. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33238. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33239. return e.toUpperCase().replace("_", "")
  33240. });
  33241. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33242. function t(e, t) {
  33243. return this[i.name] = t ? e : i.verifyValue(e),
  33244. this
  33245. }
  33246. function n() {
  33247. return this[i.name]
  33248. }
  33249. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33250. return "_" + e
  33251. });
  33252. null === a.getChild("set" + e) && (o["set" + e] = t),
  33253. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33254. null === a.getChild("get" + e) && (o["get" + e] = n),
  33255. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33256. }(t)
  33257. }
  33258. return o.encode = function(t, e) {
  33259. "boolean" == typeof t && (e = t,
  33260. t = void 0);
  33261. var i = !1;
  33262. t || (t = new I,
  33263. i = !0);
  33264. var n = t.littleEndian;
  33265. try {
  33266. return a.encode(this, t.LE(), e),
  33267. (i ? t.flip() : t).LE(n)
  33268. } catch (e) {
  33269. throw t.LE(n),
  33270. e
  33271. }
  33272. }
  33273. ,
  33274. c.encode = function(e, t, i) {
  33275. return new c(e).encode(t, i)
  33276. }
  33277. ,
  33278. o.calculate = function() {
  33279. return a.calculate(this)
  33280. }
  33281. ,
  33282. o.encodeDelimited = function(e, t) {
  33283. var i = !1;
  33284. e || (e = new I,
  33285. i = !0);
  33286. var n = (new I).LE();
  33287. return a.encode(this, n, t).flip(),
  33288. e.writeVarint32(n.remaining()),
  33289. e.append(n),
  33290. i ? e.flip() : e
  33291. }
  33292. ,
  33293. o.encodeAB = function() {
  33294. try {
  33295. return this.encode().toArrayBuffer()
  33296. } catch (e) {
  33297. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33298. e
  33299. }
  33300. }
  33301. ,
  33302. o.toArrayBuffer = o.encodeAB,
  33303. o.encodeNB = function() {
  33304. try {
  33305. return this.encode().toBuffer()
  33306. } catch (e) {
  33307. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33308. e
  33309. }
  33310. }
  33311. ,
  33312. o.toBuffer = o.encodeNB,
  33313. o.encode64 = function() {
  33314. try {
  33315. return this.encode().toBase64()
  33316. } catch (e) {
  33317. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33318. e
  33319. }
  33320. }
  33321. ,
  33322. o.toBase64 = o.encode64,
  33323. o.encodeHex = function() {
  33324. try {
  33325. return this.encode().toHex()
  33326. } catch (e) {
  33327. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33328. e
  33329. }
  33330. }
  33331. ,
  33332. o.toHex = o.encodeHex,
  33333. o.toRaw = function(e, t) {
  33334. return d(this, !!e, !!t, this.$type)
  33335. }
  33336. ,
  33337. o.encodeJSON = function() {
  33338. return JSON.stringify(d(this, !0, !0, this.$type))
  33339. }
  33340. ,
  33341. c.decode = function(t, e, i) {
  33342. "string" == typeof e && (i = e,
  33343. e = -1),
  33344. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33345. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33346. try {
  33347. var r = a.decode(t.LE());
  33348. return t.LE(n),
  33349. r
  33350. } catch (e) {
  33351. throw t.LE(n),
  33352. e
  33353. }
  33354. }
  33355. ,
  33356. c.decodeDelimited = function(t, e) {
  33357. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33358. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33359. return null;
  33360. var i = t.offset
  33361. , n = t.readVarint32();
  33362. if (t.remaining() < n)
  33363. return t.offset = i,
  33364. null;
  33365. try {
  33366. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33367. return t.offset += n,
  33368. r
  33369. } catch (e) {
  33370. throw t.offset += n,
  33371. e
  33372. }
  33373. }
  33374. ,
  33375. c.decode64 = function(e) {
  33376. return c.decode(e, "base64")
  33377. }
  33378. ,
  33379. c.decodeHex = function(e) {
  33380. return c.decode(e, "hex")
  33381. }
  33382. ,
  33383. c.decodeJSON = function(e) {
  33384. return new c(JSON.parse(e))
  33385. }
  33386. ,
  33387. o.toString = function() {
  33388. return a.toString()
  33389. }
  33390. ,
  33391. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33392. value: a.buildOpt()
  33393. }),
  33394. Object.defineProperty(o, "$options", {
  33395. value: c.$options
  33396. }),
  33397. Object.defineProperty(c, "$type", {
  33398. value: a
  33399. }),
  33400. Object.defineProperty(o, "$type", {
  33401. value: a
  33402. })),
  33403. c
  33404. }(g, this);
  33405. this._fields = [],
  33406. this._fieldsById = {},
  33407. this._fieldsByName = {};
  33408. for (var i, n = 0, r = this.children.length; n < r; n++)
  33409. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33410. if (t.hasOwnProperty(i.name))
  33411. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33412. t[i.name] = i.build()
  33413. } else if (i instanceof d.Field)
  33414. i.build(),
  33415. this._fields.push(i),
  33416. this._fieldsById[i.id] = i,
  33417. this._fieldsByName[i.name] = i;
  33418. else if (!(i instanceof d.OneOf || i instanceof v))
  33419. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33420. return this.clazz = t
  33421. }
  33422. ,
  33423. n.encode = function(e, t, i) {
  33424. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33425. r = e[(n = this._fields[a]).name],
  33426. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33427. if (null === o)
  33428. return t;
  33429. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33430. throw l.encoded = t,
  33431. l
  33432. }
  33433. ,
  33434. n.calculate = function(e) {
  33435. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33436. if (i = e[(t = this._fields[r]).name],
  33437. t.required && null === i)
  33438. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33439. n += t.calculate(i, e)
  33440. }
  33441. return n
  33442. }
  33443. ,
  33444. n.decode = function(e, t, i) {
  33445. t = "number" == typeof t ? t : -1;
  33446. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33447. if (o = (n = e.readVarint32()) >>> 3,
  33448. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33449. if (o !== i)
  33450. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33451. break
  33452. }
  33453. if (a = this._fieldsById[o]) {
  33454. if (a.repeated && !a.options.packed)
  33455. l[a.name].push(a.decode(r, e));
  33456. else if (a.map) {
  33457. var c = a.decode(r, e);
  33458. l[a.name].set(c[0], c[1])
  33459. } else if (l[a.name] = a.decode(r, e),
  33460. a.oneof) {
  33461. var h = l[a.oneof.name];
  33462. null !== h && h !== a.name && (l[h] = null),
  33463. l[a.oneof.name] = a.name
  33464. }
  33465. } else
  33466. switch (r) {
  33467. case g.WIRE_TYPES.VARINT:
  33468. e.readVarint32();
  33469. break;
  33470. case g.WIRE_TYPES.BITS32:
  33471. e.offset += 4;
  33472. break;
  33473. case g.WIRE_TYPES.BITS64:
  33474. e.offset += 8;
  33475. break;
  33476. case g.WIRE_TYPES.LDELIM:
  33477. var u = e.readVarint32();
  33478. e.offset += u;
  33479. break;
  33480. case g.WIRE_TYPES.STARTGROUP:
  33481. for (; m(o, e); )
  33482. ;
  33483. break;
  33484. default:
  33485. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33486. }
  33487. }
  33488. for (var d = 0, p = this._fields.length; d < p; ++d)
  33489. if (null === l[(a = this._fields[d]).name])
  33490. if ("proto3" === this.syntax)
  33491. l[a.name] = a.defaultValue;
  33492. else {
  33493. if (a.required) {
  33494. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33495. throw f.decoded = l,
  33496. f
  33497. }
  33498. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33499. }
  33500. return l
  33501. }
  33502. ,
  33503. s.Message = d;
  33504. function c(e, t, i, n, r, o, a, s, l, c) {
  33505. h.call(this, e, t, o),
  33506. this.className = "Message.Field",
  33507. this.required = "required" === i,
  33508. this.repeated = "repeated" === i,
  33509. this.map = "map" === i,
  33510. this.keyType = n || null,
  33511. this.type = r,
  33512. this.resolvedType = null,
  33513. this.id = a,
  33514. this.options = s || {},
  33515. this.defaultValue = null,
  33516. this.oneof = l || null,
  33517. this.syntax = c || "proto2",
  33518. this.originalName = this.name,
  33519. this.element = null,
  33520. this.keyElement = null,
  33521. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33522. }
  33523. var r = c.prototype = Object.create(h.prototype);
  33524. r.build = function() {
  33525. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33526. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33527. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  33528. }
  33529. ,
  33530. r.verifyValue = function(e, t) {
  33531. function i(e, t) {
  33532. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33533. }
  33534. t = t || !1;
  33535. var n, r = this;
  33536. if (null === e)
  33537. return this.required && i(typeof e, "required"),
  33538. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33539. null;
  33540. if (!this.repeated || t)
  33541. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33542. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33543. this.element.verifyValue(e));
  33544. Array.isArray(e) || (e = [e]);
  33545. var o = [];
  33546. for (n = 0; n < e.length; n++)
  33547. o.push(this.element.verifyValue(e[n]));
  33548. return o
  33549. }
  33550. ,
  33551. r.hasWirePresence = function(e, t) {
  33552. if ("proto3" !== this.syntax)
  33553. return null !== e;
  33554. if (this.oneof && t[this.oneof.name] === this.name)
  33555. return !0;
  33556. switch (this.type) {
  33557. case g.TYPES.int32:
  33558. case g.TYPES.sint32:
  33559. case g.TYPES.sfixed32:
  33560. case g.TYPES.uint32:
  33561. case g.TYPES.fixed32:
  33562. return 0 !== e;
  33563. case g.TYPES.int64:
  33564. case g.TYPES.sint64:
  33565. case g.TYPES.sfixed64:
  33566. case g.TYPES.uint64:
  33567. case g.TYPES.fixed64:
  33568. return 0 !== e.low || 0 !== e.high;
  33569. case g.TYPES.bool:
  33570. return e;
  33571. case g.TYPES.float:
  33572. case g.TYPES.double:
  33573. return 0 !== e;
  33574. case g.TYPES.string:
  33575. return 0 < e.length;
  33576. case g.TYPES.bytes:
  33577. return 0 < e.remaining();
  33578. case g.TYPES.enum:
  33579. return 0 !== e;
  33580. case g.TYPES.message:
  33581. return null !== e;
  33582. default:
  33583. return !0
  33584. }
  33585. }
  33586. ,
  33587. r.encode = function(t, r, e) {
  33588. if (null === this.type || "object" != typeof this.type)
  33589. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33590. if (null === t || this.repeated && 0 == t.length)
  33591. return r;
  33592. try {
  33593. var i;
  33594. if (this.repeated)
  33595. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33596. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33597. r.ensureCapacity(r.offset += 1);
  33598. var n = r.offset;
  33599. for (i = 0; i < t.length; i++)
  33600. this.element.encodeValue(this.id, t[i], r);
  33601. var o = r.offset - n
  33602. , a = I.calculateVarint32(o);
  33603. if (1 < a) {
  33604. var s = r.slice(n, r.offset);
  33605. n += a - 1,
  33606. r.offset = n,
  33607. r.append(s)
  33608. }
  33609. r.writeVarint32(o, n - a)
  33610. } else
  33611. for (i = 0; i < t.length; i++)
  33612. r.writeVarint32(this.id << 3 | this.type.wireType),
  33613. this.element.encodeValue(this.id, t[i], r);
  33614. else
  33615. this.map ? t.forEach(function(e, t, i) {
  33616. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33617. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33618. r.writeVarint32(n),
  33619. r.writeVarint32(8 | this.keyType.wireType),
  33620. this.keyElement.encodeValue(1, t, r),
  33621. r.writeVarint32(16 | this.type.wireType),
  33622. this.element.encodeValue(2, e, r)
  33623. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33624. this.element.encodeValue(this.id, t, r))
  33625. } catch (e) {
  33626. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33627. }
  33628. return r
  33629. }
  33630. ,
  33631. r.calculate = function(t, e) {
  33632. if (t = this.verifyValue(t),
  33633. null === this.type || "object" != typeof this.type)
  33634. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33635. if (null === t || this.repeated && 0 == t.length)
  33636. return 0;
  33637. var r = 0;
  33638. try {
  33639. var i, n;
  33640. if (this.repeated)
  33641. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33642. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33643. i = n = 0; i < t.length; i++)
  33644. n += this.element.calculateLength(this.id, t[i]);
  33645. r += I.calculateVarint32(n),
  33646. r += n
  33647. } else
  33648. for (i = 0; i < t.length; i++)
  33649. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33650. r += this.element.calculateLength(this.id, t[i]);
  33651. else
  33652. this.map ? t.forEach(function(e, t, i) {
  33653. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33654. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33655. r += I.calculateVarint32(n),
  33656. r += n
  33657. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33658. r += this.element.calculateLength(this.id, t))
  33659. } catch (e) {
  33660. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33661. }
  33662. return r
  33663. }
  33664. ,
  33665. r.decode = function(e, t, i) {
  33666. var n, r;
  33667. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  33668. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33669. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33670. r = t.readVarint32(),
  33671. r = t.offset + r;
  33672. for (var o = []; t.offset < r; )
  33673. o.push(this.decode(this.type.wireType, t, !0));
  33674. return o
  33675. }
  33676. if (this.map) {
  33677. var a = u.defaultFieldValue(this.keyType);
  33678. if (n = u.defaultFieldValue(this.type),
  33679. r = t.readVarint32(),
  33680. t.remaining() < r)
  33681. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33682. var s = t.clone();
  33683. for (s.limit = s.offset + r,
  33684. t.offset += r; 0 < s.remaining(); ) {
  33685. var l = s.readVarint32();
  33686. e = 7 & l;
  33687. var c = l >>> 3;
  33688. if (1 == c)
  33689. a = this.keyElement.decode(s, e, c);
  33690. else {
  33691. if (2 != c)
  33692. throw Error("Unexpected tag in map field key/value submessage");
  33693. n = this.element.decode(s, e, c)
  33694. }
  33695. }
  33696. return [a, n]
  33697. }
  33698. return this.element.decode(t, e, this.id)
  33699. }
  33700. ,
  33701. s.Message.Field = c;
  33702. function o(e, t, i, n, r, o, a) {
  33703. c.call(this, e, t, i, null, n, r, o, a),
  33704. this.extension
  33705. }
  33706. o.prototype = Object.create(c.prototype),
  33707. s.Message.ExtensionField = o;
  33708. s.Message.OneOf = function(e, t, i) {
  33709. h.call(this, e, t, i),
  33710. this.fields = []
  33711. }
  33712. ;
  33713. var p = function(e, t, i, n, r) {
  33714. l.call(this, e, t, i, n, r),
  33715. this.className = "Enum",
  33716. this.object = null
  33717. };
  33718. p.getName = function(e, t) {
  33719. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33720. if (e[i = n[r]] === t)
  33721. return i;
  33722. return null
  33723. }
  33724. ,
  33725. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33726. if (this.object && !e)
  33727. return this.object;
  33728. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33729. t[i[n].name] = i[n].id;
  33730. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33731. value: this.buildOpt(),
  33732. enumerable: !1
  33733. }),
  33734. this.object = t
  33735. }
  33736. ,
  33737. s.Enum = p;
  33738. function f(e, t, i, n) {
  33739. h.call(this, e, t, i),
  33740. this.className = "Enum.Value",
  33741. this.id = n
  33742. }
  33743. f.prototype = Object.create(h.prototype),
  33744. s.Enum.Value = f;
  33745. var v = function(e, t, i, n) {
  33746. h.call(this, e, t, i),
  33747. this.field = n
  33748. };
  33749. v.prototype = Object.create(h.prototype),
  33750. s.Extension = v;
  33751. var y = function(e, t, i, n) {
  33752. l.call(this, e, t, i, n),
  33753. this.className = "Service",
  33754. this.clazz = null
  33755. };
  33756. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33757. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33758. for (var o = function(e) {
  33759. t.Builder.Service.call(this),
  33760. this.rpcImpl = e || function(e, t, i) {
  33761. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33762. }
  33763. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33764. !function(n) {
  33765. e[n.name] = function(e, i) {
  33766. try {
  33767. try {
  33768. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33769. } catch (e) {
  33770. if (!(e instanceof TypeError))
  33771. throw e
  33772. }
  33773. if (null === e || "object" != typeof e)
  33774. throw Error("Illegal arguments");
  33775. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33776. this.rpcImpl(n.fqn(), e, function(e, t) {
  33777. if (!e) {
  33778. null === t && (t = "");
  33779. try {
  33780. t = n.resolvedResponseType.clazz.decode(t)
  33781. } catch (e) {}
  33782. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  33783. }
  33784. i(e)
  33785. })
  33786. } catch (e) {
  33787. setTimeout(i.bind(this, e), 0)
  33788. }
  33789. }
  33790. ,
  33791. o[n.name] = function(e, t, i) {
  33792. new o(e)[n.name](t, i)
  33793. }
  33794. ,
  33795. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33796. value: n.buildOpt()
  33797. }),
  33798. Object.defineProperty(e[n.name], "$options", {
  33799. value: o[n.name].$options
  33800. }))
  33801. }(i[n]);
  33802. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33803. value: r.buildOpt()
  33804. }),
  33805. Object.defineProperty(e, "$options", {
  33806. value: o.$options
  33807. }),
  33808. Object.defineProperty(o, "$type", {
  33809. value: r
  33810. }),
  33811. Object.defineProperty(e, "$type", {
  33812. value: r
  33813. })),
  33814. o
  33815. }(g, this)
  33816. }
  33817. ,
  33818. s.Service = y;
  33819. function A(e, t, i, n) {
  33820. h.call(this, e, t, i),
  33821. this.className = "Service.Method",
  33822. this.options = n || {}
  33823. }
  33824. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33825. s.Service.Method = A;
  33826. function C(e, t, i, n, r, o, a, s) {
  33827. A.call(this, e, t, i, s),
  33828. this.className = "Service.RPCMethod",
  33829. this.requestName = n,
  33830. this.responseName = r,
  33831. this.requestStream = o,
  33832. this.responseStream = a,
  33833. this.resolvedRequestType = null,
  33834. this.resolvedResponseType = null
  33835. }
  33836. return C.prototype = Object.create(A.prototype),
  33837. s.Service.RPCMethod = C,
  33838. s
  33839. }(o),
  33840. o.Builder = (i = (u = o).Lang,
  33841. s = o.Reflect,
  33842. n = h.prototype,
  33843. h.isMessage = function(e) {
  33844. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33845. }
  33846. ,
  33847. h.isMessageField = function(e) {
  33848. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33849. }
  33850. ,
  33851. h.isEnum = function(e) {
  33852. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33853. }
  33854. ,
  33855. h.isService = function(e) {
  33856. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33857. }
  33858. ,
  33859. h.isExtend = function(e) {
  33860. return "string" == typeof e.ref
  33861. }
  33862. ,
  33863. n.reset = function() {
  33864. return this.ptr = this.ns,
  33865. this
  33866. }
  33867. ,
  33868. n.define = function(e) {
  33869. if ("string" != typeof e || !i.TYPEREF.test(e))
  33870. throw Error("illegal namespace: " + e);
  33871. return e.split(".").forEach(function(e) {
  33872. var t = this.ptr.getChild(e);
  33873. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33874. this.ptr = t
  33875. }, this),
  33876. this
  33877. }
  33878. ,
  33879. n.create = function(e) {
  33880. if (!e)
  33881. return this;
  33882. if (Array.isArray(e)) {
  33883. if (0 === e.length)
  33884. return this;
  33885. e = e.slice()
  33886. } else
  33887. e = [e];
  33888. for (var t = [e]; 0 < t.length; ) {
  33889. if (e = t.pop(),
  33890. !Array.isArray(e))
  33891. throw Error("not a valid namespace: " + JSON.stringify(e));
  33892. for (; 0 < e.length; ) {
  33893. var i = e.shift();
  33894. if (h.isMessage(i)) {
  33895. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33896. , n = {};
  33897. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33898. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33899. }, this),
  33900. i.fields && i.fields.forEach(function(e) {
  33901. if (null !== o.getChild(0 | e.id))
  33902. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33903. if (e.options && "object" != typeof e.options)
  33904. throw Error("illegal field options in " + o.name + "#" + e.name);
  33905. var t = null;
  33906. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33907. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33908. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33909. t && t.fields.push(e),
  33910. o.addChild(e)
  33911. }, this);
  33912. var r = [];
  33913. if (i.enums && i.enums.forEach(function(e) {
  33914. r.push(e)
  33915. }),
  33916. i.messages && i.messages.forEach(function(e) {
  33917. r.push(e)
  33918. }),
  33919. i.services && i.services.forEach(function(e) {
  33920. r.push(e)
  33921. }),
  33922. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33923. this.ptr.addChild(o),
  33924. 0 < r.length) {
  33925. t.push(e),
  33926. e = r,
  33927. r = null,
  33928. this.ptr = o,
  33929. o = null;
  33930. continue
  33931. }
  33932. r = null
  33933. } else if (h.isEnum(i))
  33934. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33935. i.values.forEach(function(e) {
  33936. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33937. }, this),
  33938. this.ptr.addChild(o);
  33939. else if (h.isService(i))
  33940. o = new s.Service(this,this.ptr,i.name,i.options),
  33941. Object.keys(i.rpc).forEach(function(e) {
  33942. var t = i.rpc[e];
  33943. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33944. }, this),
  33945. this.ptr.addChild(o);
  33946. else {
  33947. if (!h.isExtend(i))
  33948. throw Error("not a valid definition: " + JSON.stringify(i));
  33949. if (o = this.ptr.resolve(i.ref, !0))
  33950. i.fields.forEach(function(t) {
  33951. if (null !== o.getChild(0 | t.id))
  33952. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33953. if (o.extensions) {
  33954. var i = !1;
  33955. if (o.extensions.forEach(function(e) {
  33956. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33957. }),
  33958. !i)
  33959. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33960. }
  33961. var e = t.name;
  33962. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33963. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33964. , r = new s.Extension(this,this.ptr,t.name,n);
  33965. n.extension = r,
  33966. this.ptr.addChild(r),
  33967. o.addChild(n)
  33968. }, this);
  33969. else if (!/\.?google\.protobuf\./.test(i.ref))
  33970. throw Error("extended message " + i.ref + " is not defined")
  33971. }
  33972. o = i = null
  33973. }
  33974. e = null,
  33975. this.ptr = this.ptr.parent
  33976. }
  33977. return this.resolved = !1,
  33978. this.result = null,
  33979. this
  33980. }
  33981. ,
  33982. n.import = function(t, e) {
  33983. var i = "/";
  33984. if ("string" == typeof e) {
  33985. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33986. !0 === this.files[e])
  33987. return this.reset();
  33988. this.files[e] = !0
  33989. } else if ("object" == typeof e) {
  33990. var n = e.root;
  33991. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33992. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33993. var r = n + i + e.file;
  33994. if (!0 === this.files[r])
  33995. return this.reset();
  33996. this.files[r] = !0
  33997. }
  33998. if (t.imports && 0 < t.imports.length) {
  33999. var o, a = !1;
  34000. "object" == typeof e ? (this.importRoot = e.root,
  34001. a = !0,
  34002. o = this.importRoot,
  34003. e = e.file,
  34004. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  34005. i = "\\") : o = "." : o = null;
  34006. for (var s = 0; s < t.imports.length; s++)
  34007. if ("string" == typeof t.imports[s]) {
  34008. if (!o)
  34009. throw Error("cannot determine import root");
  34010. var l = t.imports[s];
  34011. if ("google/protobuf/descriptor.proto" === l)
  34012. continue;
  34013. if (l = o + i + l,
  34014. !0 === this.files[l])
  34015. continue;
  34016. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34017. var c = u.Util.fetch(l);
  34018. if (null === c)
  34019. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34020. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34021. } else
  34022. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34023. return t + "_import" + s + "." + i
  34024. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34025. a && (this.importRoot = null)
  34026. }
  34027. t.package && this.define(t.package),
  34028. t.syntax && function t(i) {
  34029. i.messages && i.messages.forEach(function(e) {
  34030. e.syntax = i.syntax,
  34031. t(e)
  34032. }),
  34033. i.enums && i.enums.forEach(function(e) {
  34034. e.syntax = i.syntax
  34035. })
  34036. }(t);
  34037. var h = this.ptr;
  34038. return t.options && Object.keys(t.options).forEach(function(e) {
  34039. h.options[e] = t.options[e]
  34040. }),
  34041. t.messages && (this.create(t.messages),
  34042. this.ptr = h),
  34043. t.enums && (this.create(t.enums),
  34044. this.ptr = h),
  34045. t.services && (this.create(t.services),
  34046. this.ptr = h),
  34047. t.extends && this.create(t.extends),
  34048. this.reset()
  34049. }
  34050. ,
  34051. n.resolveAll = function() {
  34052. var e;
  34053. if (null == this.ptr || "object" == typeof this.ptr.type)
  34054. return this;
  34055. if (this.ptr instanceof s.Namespace)
  34056. this.ptr.children.forEach(function(e) {
  34057. this.ptr = e,
  34058. this.resolveAll()
  34059. }, this);
  34060. else if (this.ptr instanceof s.Message.Field) {
  34061. if (i.TYPE.test(this.ptr.type))
  34062. this.ptr.type = u.TYPES[this.ptr.type];
  34063. else {
  34064. if (!i.TYPEREF.test(this.ptr.type))
  34065. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34066. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34067. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34068. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34069. if (this.ptr.type = u.TYPES.enum,
  34070. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34071. throw Error("proto3 message cannot reference proto2 enum")
  34072. } else {
  34073. if (!(e instanceof s.Message))
  34074. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34075. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34076. }
  34077. }
  34078. if (this.ptr.map) {
  34079. if (!i.TYPE.test(this.ptr.keyType))
  34080. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34081. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34082. }
  34083. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34084. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34085. throw Error("illegal service type in " + this.ptr.toString(!0));
  34086. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34087. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34088. if (this.ptr.resolvedRequestType = e,
  34089. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34090. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34091. this.ptr.resolvedResponseType = e
  34092. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34093. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34094. return this.reset()
  34095. }
  34096. ,
  34097. n.build = function(e) {
  34098. if (this.reset(),
  34099. this.resolved || (this.resolveAll(),
  34100. this.resolved = !0,
  34101. this.result = null),
  34102. null === this.result && (this.result = this.ns.build()),
  34103. !e)
  34104. return this.result;
  34105. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34106. if (!i[t[n]]) {
  34107. i = null;
  34108. break
  34109. }
  34110. i = i[t[n]]
  34111. }
  34112. return i
  34113. }
  34114. ,
  34115. n.lookup = function(e, t) {
  34116. return e ? this.ns.resolve(e, t) : this.ns
  34117. }
  34118. ,
  34119. n.toString = function() {
  34120. return "Builder"
  34121. }
  34122. ,
  34123. h.Message = function() {}
  34124. ,
  34125. h.Enum = function() {}
  34126. ,
  34127. h.Service = function() {}
  34128. ,
  34129. h),
  34130. o.Map = (a = o.Reflect,
  34131. (t = c.prototype).clear = function() {
  34132. this.map = {}
  34133. }
  34134. ,
  34135. t.delete = function(e) {
  34136. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34137. , i = t in this.map;
  34138. return delete this.map[t],
  34139. i
  34140. }
  34141. ,
  34142. t.entries = function() {
  34143. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34144. t.push([(e = this.map[i[n]]).key, e.value]);
  34145. return l(t)
  34146. }
  34147. ,
  34148. t.keys = function() {
  34149. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34150. e.push(this.map[t[i]].key);
  34151. return l(e)
  34152. }
  34153. ,
  34154. t.values = function() {
  34155. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34156. e.push(this.map[t[i]].value);
  34157. return l(e)
  34158. }
  34159. ,
  34160. t.forEach = function(e, t) {
  34161. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34162. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34163. }
  34164. ,
  34165. t.set = function(e, t) {
  34166. var i = this.keyElem.verifyValue(e)
  34167. , n = this.valueElem.verifyValue(t);
  34168. return this.map[this.keyElem.valueToString(i)] = {
  34169. key: i,
  34170. value: n
  34171. },
  34172. this
  34173. }
  34174. ,
  34175. t.get = function(e) {
  34176. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34177. if (t in this.map)
  34178. return this.map[t].value
  34179. }
  34180. ,
  34181. t.has = function(e) {
  34182. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34183. }
  34184. ,
  34185. c),
  34186. o.loadProto = function(e, t, i) {
  34187. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34188. t = void 0),
  34189. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34190. }
  34191. ,
  34192. o.protoFromString = o.loadProto,
  34193. o.loadProtoFile = function(t, i, n) {
  34194. if (i && "object" == typeof i ? (n = i,
  34195. i = null) : i && "function" == typeof i || (i = null),
  34196. i)
  34197. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34198. if (null !== e)
  34199. try {
  34200. i(null, o.loadProto(e, n, t))
  34201. } catch (e) {
  34202. i(e)
  34203. }
  34204. else
  34205. i(Error("Failed to fetch file"))
  34206. });
  34207. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34208. return null === e ? null : o.loadProto(e, n, t)
  34209. }
  34210. ,
  34211. o.protoFromFile = o.loadProtoFile,
  34212. o.newBuilder = function(e) {
  34213. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34214. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34215. new o.Builder(e)
  34216. }
  34217. ,
  34218. o.loadJson = function(e, t, i) {
  34219. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34220. t = null),
  34221. t && "object" == typeof t || (t = o.newBuilder()),
  34222. "string" == typeof e && (e = JSON.parse(e)),
  34223. t.import(e, i),
  34224. t.resolveAll(),
  34225. t
  34226. }
  34227. ,
  34228. o.loadJsonFile = function(t, i, n) {
  34229. if (i && "object" == typeof i ? (n = i,
  34230. i = null) : i && "function" == typeof i || (i = null),
  34231. i)
  34232. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34233. if (null !== e)
  34234. try {
  34235. i(null, o.loadJson(JSON.parse(e), n, t))
  34236. } catch (e) {
  34237. i(e)
  34238. }
  34239. else
  34240. i(Error("Failed to fetch file"))
  34241. });
  34242. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34243. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34244. }
  34245. ,
  34246. o;
  34247. function l(e) {
  34248. var t = 0;
  34249. return {
  34250. next: function() {
  34251. return t < e.length ? {
  34252. done: !1,
  34253. value: e[t++]
  34254. } : {
  34255. done: !0
  34256. }
  34257. }
  34258. }
  34259. }
  34260. function c(e, t) {
  34261. if (!e.map)
  34262. throw Error("field is not a map");
  34263. if (this.field = e,
  34264. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34265. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34266. this.map = {},
  34267. Object.defineProperty(this, "size", {
  34268. get: function() {
  34269. return Object.keys(this.map).length
  34270. }
  34271. }),
  34272. t)
  34273. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34274. var r = this.keyElem.valueFromString(i[n])
  34275. , o = this.valueElem.verifyValue(t[i[n]]);
  34276. this.map[this.keyElem.valueToString(r)] = {
  34277. key: r,
  34278. value: o
  34279. }
  34280. }
  34281. }
  34282. function h(e) {
  34283. this.ns = new s.Namespace(this,null,""),
  34284. this.ptr = this.ns,
  34285. this.resolved = !1,
  34286. this.result = null,
  34287. this.files = {},
  34288. this.importRoot = null,
  34289. this.options = e || {}
  34290. }
  34291. }
  34292. ,
  34293. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  34294. }
  34295. ).call(this, p("_process"))
  34296. }
  34297. , {
  34298. _process: 203,
  34299. bytebuffer: 215,
  34300. fs: 197,
  34301. path: 197
  34302. }],
  34303. 215: [function(t, e, i) {
  34304. var n, r;
  34305. n = this,
  34306. r = function(l) {
  34307. "use strict";
  34308. function s(e) {
  34309. var t = 0;
  34310. return function() {
  34311. return t < e.length ? e.charCodeAt(t++) : null
  34312. }
  34313. }
  34314. function c() {
  34315. var e = []
  34316. , t = [];
  34317. return function() {
  34318. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34319. e.length = 0),
  34320. void Array.prototype.push.apply(e, arguments))
  34321. }
  34322. }
  34323. function n(e, t, i, n, r) {
  34324. 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];
  34325. for (u += d,
  34326. o = p & (1 << -h) - 1,
  34327. p >>= -h,
  34328. h += s; 0 < h; o = 256 * o + e[t + u],
  34329. u += d,
  34330. h -= 8)
  34331. ;
  34332. for (a = o & (1 << -h) - 1,
  34333. o >>= -h,
  34334. h += n; 0 < h; a = 256 * a + e[t + u],
  34335. u += d,
  34336. h -= 8)
  34337. ;
  34338. if (0 === o)
  34339. o = 1 - c;
  34340. else {
  34341. if (o === l)
  34342. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34343. a += Math.pow(2, n),
  34344. o -= c
  34345. }
  34346. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34347. }
  34348. function r(e, t, i, n, r, o) {
  34349. 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;
  34350. for (t = Math.abs(t),
  34351. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34352. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34353. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34354. l *= 2),
  34355. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34356. l /= 2),
  34357. h <= a + u ? (s = 0,
  34358. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34359. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34360. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34361. p += f,
  34362. s /= 256,
  34363. r -= 8)
  34364. ;
  34365. for (a = a << r | s,
  34366. c += r; 0 < c; e[i + p] = 255 & a,
  34367. p += f,
  34368. a /= 256,
  34369. c -= 8)
  34370. ;
  34371. e[i + p - f] |= 128 * g
  34372. }
  34373. var f = function(e, t, i) {
  34374. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34375. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34376. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34377. !i) {
  34378. if ((e |= 0) < 0)
  34379. throw RangeError("Illegal capacity");
  34380. t = !!t,
  34381. i = !!i
  34382. }
  34383. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34384. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34385. this.offset = 0,
  34386. this.markedOffset = -1,
  34387. this.limit = e,
  34388. this.littleEndian = t,
  34389. this.noAssert = i
  34390. };
  34391. f.VERSION = "5.0.1",
  34392. f.LITTLE_ENDIAN = !0,
  34393. f.BIG_ENDIAN = !1,
  34394. f.DEFAULT_CAPACITY = 16,
  34395. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34396. f.DEFAULT_NOASSERT = !1,
  34397. f.Long = l || null;
  34398. var a = f.prototype;
  34399. a.__isByteBuffer__,
  34400. Object.defineProperty(a, "__isByteBuffer__", {
  34401. value: !0,
  34402. enumerable: !1,
  34403. configurable: !1
  34404. });
  34405. var o = new ArrayBuffer(0)
  34406. , i = String.fromCharCode;
  34407. f.accessor = function() {
  34408. return Uint8Array
  34409. }
  34410. ,
  34411. f.allocate = function(e, t, i) {
  34412. return new f(e,t,i)
  34413. }
  34414. ,
  34415. f.concat = function(e, t, i, n) {
  34416. "boolean" != typeof t && "string" == typeof t || (n = i,
  34417. i = t,
  34418. t = void 0);
  34419. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34420. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34421. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34422. if (0 === o)
  34423. return new f(0,i,n);
  34424. var l, c = new f(o,i,n);
  34425. for (a = 0; a < s; )
  34426. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34427. c.offset += r);
  34428. return c.limit = c.offset,
  34429. c.offset = 0,
  34430. c
  34431. }
  34432. ,
  34433. f.isByteBuffer = function(e) {
  34434. return !0 === (e && e.__isByteBuffer__)
  34435. }
  34436. ,
  34437. f.type = function() {
  34438. return ArrayBuffer
  34439. }
  34440. ,
  34441. f.wrap = function(e, t, i, n) {
  34442. if ("string" != typeof t && (n = i,
  34443. i = t,
  34444. t = void 0),
  34445. "string" == typeof e)
  34446. switch (void 0 === t && (t = "utf8"),
  34447. t) {
  34448. case "base64":
  34449. return f.fromBase64(e, i);
  34450. case "hex":
  34451. return f.fromHex(e, i);
  34452. case "binary":
  34453. return f.fromBinary(e, i);
  34454. case "utf8":
  34455. return f.fromUTF8(e, i);
  34456. case "debug":
  34457. return f.fromDebug(e, i);
  34458. default:
  34459. throw Error("Unsupported encoding: " + t)
  34460. }
  34461. if (null === e || "object" != typeof e)
  34462. throw TypeError("Illegal buffer");
  34463. var r;
  34464. if (f.isByteBuffer(e))
  34465. return (r = a.clone.call(e)).markedOffset = -1,
  34466. r;
  34467. if (e instanceof Uint8Array)
  34468. r = new f(0,i,n),
  34469. 0 < e.length && (r.buffer = e.buffer,
  34470. r.offset = e.byteOffset,
  34471. r.limit = e.byteOffset + e.byteLength,
  34472. r.view = new Uint8Array(e.buffer));
  34473. else if (e instanceof ArrayBuffer)
  34474. r = new f(0,i,n),
  34475. 0 < e.byteLength && (r.buffer = e,
  34476. r.offset = 0,
  34477. r.limit = e.byteLength,
  34478. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34479. else {
  34480. if ("[object Array]" !== Object.prototype.toString.call(e))
  34481. throw TypeError("Illegal buffer");
  34482. (r = new f(e.length,i,n)).limit = e.length;
  34483. for (var o = 0; o < e.length; ++o)
  34484. r.view[o] = e[o]
  34485. }
  34486. return r
  34487. }
  34488. ,
  34489. a.writeBitSet = function(e, t) {
  34490. var i = void 0 === t;
  34491. if (i && (t = this.offset),
  34492. !this.noAssert) {
  34493. if (!(e instanceof Array))
  34494. throw TypeError("Illegal BitSet: Not an array");
  34495. if ("number" != typeof t || t % 1 != 0)
  34496. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34497. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34498. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34499. }
  34500. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34501. for (t += this.writeVarint32(o, t); a--; )
  34502. 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,
  34503. this.writeByte(n, t++);
  34504. if (s < o) {
  34505. var l = 0;
  34506. for (n = 0; s < o; )
  34507. n |= (1 & !!e[s++]) << l++;
  34508. this.writeByte(n, t++)
  34509. }
  34510. return i ? (this.offset = t,
  34511. this) : t - r
  34512. }
  34513. ,
  34514. a.readBitSet = function(e) {
  34515. var t = void 0 === e;
  34516. t && (e = this.offset);
  34517. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34518. for (e += n.length; o--; )
  34519. i = this.readByte(e++),
  34520. s[a++] = !!(1 & i),
  34521. s[a++] = !!(2 & i),
  34522. s[a++] = !!(4 & i),
  34523. s[a++] = !!(8 & i),
  34524. s[a++] = !!(16 & i),
  34525. s[a++] = !!(32 & i),
  34526. s[a++] = !!(64 & i),
  34527. s[a++] = !!(128 & i);
  34528. if (a < r) {
  34529. var l = 0;
  34530. for (i = this.readByte(e++); a < r; )
  34531. s[a++] = !!(i >> l++ & 1)
  34532. }
  34533. return t && (this.offset = e),
  34534. s
  34535. }
  34536. ,
  34537. a.readBytes = function(e, t) {
  34538. var i = void 0 === t;
  34539. if (i && (t = this.offset),
  34540. !this.noAssert) {
  34541. if ("number" != typeof t || t % 1 != 0)
  34542. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34543. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34544. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34545. }
  34546. var n = this.slice(t, t + e);
  34547. return i && (this.offset += e),
  34548. n
  34549. }
  34550. ,
  34551. a.writeBytes = a.append,
  34552. a.writeInt8 = function(e, t) {
  34553. var i = void 0 === t;
  34554. if (i && (t = this.offset),
  34555. !this.noAssert) {
  34556. if ("number" != typeof e || e % 1 != 0)
  34557. throw TypeError("Illegal value: " + e + " (not an integer)");
  34558. if (e |= 0,
  34559. "number" != typeof t || t % 1 != 0)
  34560. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34561. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34562. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34563. }
  34564. t += 1;
  34565. var n = this.buffer.byteLength;
  34566. return n < t && this.resize((n *= 2) > t ? n : t),
  34567. t -= 1,
  34568. this.view[t] = e,
  34569. i && (this.offset += 1),
  34570. this
  34571. }
  34572. ,
  34573. a.writeByte = a.writeInt8,
  34574. a.readInt8 = function(e) {
  34575. var t = void 0 === e;
  34576. if (t && (e = this.offset),
  34577. !this.noAssert) {
  34578. if ("number" != typeof e || e % 1 != 0)
  34579. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34580. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34581. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34582. }
  34583. var i = this.view[e];
  34584. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34585. t && (this.offset += 1),
  34586. i
  34587. }
  34588. ,
  34589. a.readByte = a.readInt8,
  34590. a.writeUint8 = function(e, t) {
  34591. var i = void 0 === t;
  34592. if (i && (t = this.offset),
  34593. !this.noAssert) {
  34594. if ("number" != typeof e || e % 1 != 0)
  34595. throw TypeError("Illegal value: " + e + " (not an integer)");
  34596. if (e >>>= 0,
  34597. "number" != typeof t || t % 1 != 0)
  34598. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34599. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34600. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34601. }
  34602. t += 1;
  34603. var n = this.buffer.byteLength;
  34604. return n < t && this.resize((n *= 2) > t ? n : t),
  34605. t -= 1,
  34606. this.view[t] = e,
  34607. i && (this.offset += 1),
  34608. this
  34609. }
  34610. ,
  34611. a.writeUInt8 = a.writeUint8,
  34612. a.readUint8 = function(e) {
  34613. var t = void 0 === e;
  34614. if (t && (e = this.offset),
  34615. !this.noAssert) {
  34616. if ("number" != typeof e || e % 1 != 0)
  34617. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34618. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34619. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34620. }
  34621. var i = this.view[e];
  34622. return t && (this.offset += 1),
  34623. i
  34624. }
  34625. ,
  34626. a.readUInt8 = a.readUint8,
  34627. a.writeInt16 = function(e, t) {
  34628. var i = void 0 === t;
  34629. if (i && (t = this.offset),
  34630. !this.noAssert) {
  34631. if ("number" != typeof e || e % 1 != 0)
  34632. throw TypeError("Illegal value: " + e + " (not an integer)");
  34633. if (e |= 0,
  34634. "number" != typeof t || t % 1 != 0)
  34635. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34636. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34637. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34638. }
  34639. t += 2;
  34640. var n = this.buffer.byteLength;
  34641. return n < t && this.resize((n *= 2) > t ? n : t),
  34642. t -= 2,
  34643. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34644. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34645. this.view[t + 1] = 255 & e),
  34646. i && (this.offset += 2),
  34647. this
  34648. }
  34649. ,
  34650. a.writeShort = a.writeInt16,
  34651. a.readInt16 = function(e) {
  34652. var t = void 0 === e;
  34653. if (t && (e = this.offset),
  34654. !this.noAssert) {
  34655. if ("number" != typeof e || e % 1 != 0)
  34656. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34657. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34658. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34659. }
  34660. var i = 0;
  34661. return this.littleEndian ? (i = this.view[e],
  34662. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34663. i |= this.view[e + 1]),
  34664. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34665. t && (this.offset += 2),
  34666. i
  34667. }
  34668. ,
  34669. a.readShort = a.readInt16,
  34670. a.writeUint16 = function(e, t) {
  34671. var i = void 0 === t;
  34672. if (i && (t = this.offset),
  34673. !this.noAssert) {
  34674. if ("number" != typeof e || e % 1 != 0)
  34675. throw TypeError("Illegal value: " + e + " (not an integer)");
  34676. if (e >>>= 0,
  34677. "number" != typeof t || t % 1 != 0)
  34678. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34679. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34680. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34681. }
  34682. t += 2;
  34683. var n = this.buffer.byteLength;
  34684. return n < t && this.resize((n *= 2) > t ? n : t),
  34685. t -= 2,
  34686. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34687. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34688. this.view[t + 1] = 255 & e),
  34689. i && (this.offset += 2),
  34690. this
  34691. }
  34692. ,
  34693. a.writeUInt16 = a.writeUint16,
  34694. a.readUint16 = function(e) {
  34695. var t = void 0 === e;
  34696. if (t && (e = this.offset),
  34697. !this.noAssert) {
  34698. if ("number" != typeof e || e % 1 != 0)
  34699. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34700. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34701. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34702. }
  34703. var i = 0;
  34704. return this.littleEndian ? (i = this.view[e],
  34705. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34706. i |= this.view[e + 1]),
  34707. t && (this.offset += 2),
  34708. i
  34709. }
  34710. ,
  34711. a.readUInt16 = a.readUint16,
  34712. a.writeInt32 = function(e, t) {
  34713. var i = void 0 === t;
  34714. if (i && (t = this.offset),
  34715. !this.noAssert) {
  34716. if ("number" != typeof e || e % 1 != 0)
  34717. throw TypeError("Illegal value: " + e + " (not an integer)");
  34718. if (e |= 0,
  34719. "number" != typeof t || t % 1 != 0)
  34720. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34721. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34722. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34723. }
  34724. t += 4;
  34725. var n = this.buffer.byteLength;
  34726. return n < t && this.resize((n *= 2) > t ? n : t),
  34727. t -= 4,
  34728. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34729. this.view[t + 2] = e >>> 16 & 255,
  34730. this.view[t + 1] = e >>> 8 & 255,
  34731. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34732. this.view[t + 1] = e >>> 16 & 255,
  34733. this.view[t + 2] = e >>> 8 & 255,
  34734. this.view[t + 3] = 255 & e),
  34735. i && (this.offset += 4),
  34736. this
  34737. }
  34738. ,
  34739. a.writeInt = a.writeInt32,
  34740. a.readInt32 = function(e) {
  34741. var t = void 0 === e;
  34742. if (t && (e = this.offset),
  34743. !this.noAssert) {
  34744. if ("number" != typeof e || e % 1 != 0)
  34745. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34746. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34747. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34748. }
  34749. var i = 0;
  34750. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34751. i |= this.view[e + 1] << 8,
  34752. i |= this.view[e],
  34753. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34754. i |= this.view[e + 2] << 8,
  34755. i |= this.view[e + 3],
  34756. i += this.view[e] << 24 >>> 0),
  34757. i |= 0,
  34758. t && (this.offset += 4),
  34759. i
  34760. }
  34761. ,
  34762. a.readInt = a.readInt32,
  34763. a.writeUint32 = function(e, t) {
  34764. var i = void 0 === t;
  34765. if (i && (t = this.offset),
  34766. !this.noAssert) {
  34767. if ("number" != typeof e || e % 1 != 0)
  34768. throw TypeError("Illegal value: " + e + " (not an integer)");
  34769. if (e >>>= 0,
  34770. "number" != typeof t || t % 1 != 0)
  34771. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34772. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34773. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34774. }
  34775. t += 4;
  34776. var n = this.buffer.byteLength;
  34777. return n < t && this.resize((n *= 2) > t ? n : t),
  34778. t -= 4,
  34779. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34780. this.view[t + 2] = e >>> 16 & 255,
  34781. this.view[t + 1] = e >>> 8 & 255,
  34782. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34783. this.view[t + 1] = e >>> 16 & 255,
  34784. this.view[t + 2] = e >>> 8 & 255,
  34785. this.view[t + 3] = 255 & e),
  34786. i && (this.offset += 4),
  34787. this
  34788. }
  34789. ,
  34790. a.writeUInt32 = a.writeUint32,
  34791. a.readUint32 = function(e) {
  34792. var t = void 0 === e;
  34793. if (t && (e = this.offset),
  34794. !this.noAssert) {
  34795. if ("number" != typeof e || e % 1 != 0)
  34796. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34797. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34798. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34799. }
  34800. var i = 0;
  34801. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34802. i |= this.view[e + 1] << 8,
  34803. i |= this.view[e],
  34804. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34805. i |= this.view[e + 2] << 8,
  34806. i |= this.view[e + 3],
  34807. i += this.view[e] << 24 >>> 0),
  34808. t && (this.offset += 4),
  34809. i
  34810. }
  34811. ,
  34812. a.readUInt32 = a.readUint32,
  34813. l && (a.writeInt64 = function(e, t) {
  34814. var i = void 0 === t;
  34815. if (i && (t = this.offset),
  34816. !this.noAssert) {
  34817. if ("number" == typeof e)
  34818. e = l.fromNumber(e);
  34819. else if ("string" == typeof e)
  34820. e = l.fromString(e);
  34821. else if (!(e && e instanceof l))
  34822. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34823. if ("number" != typeof t || t % 1 != 0)
  34824. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34825. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34826. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34827. }
  34828. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34829. t += 8;
  34830. var n = this.buffer.byteLength;
  34831. n < t && this.resize((n *= 2) > t ? n : t),
  34832. t -= 8;
  34833. var r = e.low
  34834. , o = e.high;
  34835. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34836. this.view[t + 2] = r >>> 16 & 255,
  34837. this.view[t + 1] = r >>> 8 & 255,
  34838. this.view[t] = 255 & r,
  34839. t += 4,
  34840. this.view[t + 3] = o >>> 24 & 255,
  34841. this.view[t + 2] = o >>> 16 & 255,
  34842. this.view[t + 1] = o >>> 8 & 255,
  34843. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34844. this.view[t + 1] = o >>> 16 & 255,
  34845. this.view[t + 2] = o >>> 8 & 255,
  34846. this.view[t + 3] = 255 & o,
  34847. t += 4,
  34848. this.view[t] = r >>> 24 & 255,
  34849. this.view[t + 1] = r >>> 16 & 255,
  34850. this.view[t + 2] = r >>> 8 & 255,
  34851. this.view[t + 3] = 255 & r),
  34852. i && (this.offset += 8),
  34853. this
  34854. }
  34855. ,
  34856. a.writeLong = a.writeInt64,
  34857. a.readInt64 = function(e) {
  34858. var t = void 0 === e;
  34859. if (t && (e = this.offset),
  34860. !this.noAssert) {
  34861. if ("number" != typeof e || e % 1 != 0)
  34862. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34863. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34864. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34865. }
  34866. var i = 0
  34867. , n = 0;
  34868. this.littleEndian ? (i = this.view[e + 2] << 16,
  34869. i |= this.view[e + 1] << 8,
  34870. i |= this.view[e],
  34871. i += this.view[e + 3] << 24 >>> 0,
  34872. e += 4,
  34873. n = this.view[e + 2] << 16,
  34874. n |= this.view[e + 1] << 8,
  34875. n |= this.view[e],
  34876. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34877. n |= this.view[e + 2] << 8,
  34878. n |= this.view[e + 3],
  34879. n += this.view[e] << 24 >>> 0,
  34880. e += 4,
  34881. i = this.view[e + 1] << 16,
  34882. i |= this.view[e + 2] << 8,
  34883. i |= this.view[e + 3],
  34884. i += this.view[e] << 24 >>> 0);
  34885. var r = new l(i,n,!1);
  34886. return t && (this.offset += 8),
  34887. r
  34888. }
  34889. ,
  34890. a.readLong = a.readInt64,
  34891. a.writeUint64 = function(e, t) {
  34892. var i = void 0 === t;
  34893. if (i && (t = this.offset),
  34894. !this.noAssert) {
  34895. if ("number" == typeof e)
  34896. e = l.fromNumber(e);
  34897. else if ("string" == typeof e)
  34898. e = l.fromString(e);
  34899. else if (!(e && e instanceof l))
  34900. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34901. if ("number" != typeof t || t % 1 != 0)
  34902. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34903. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34904. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34905. }
  34906. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34907. t += 8;
  34908. var n = this.buffer.byteLength;
  34909. n < t && this.resize((n *= 2) > t ? n : t),
  34910. t -= 8;
  34911. var r = e.low
  34912. , o = e.high;
  34913. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34914. this.view[t + 2] = r >>> 16 & 255,
  34915. this.view[t + 1] = r >>> 8 & 255,
  34916. this.view[t] = 255 & r,
  34917. t += 4,
  34918. this.view[t + 3] = o >>> 24 & 255,
  34919. this.view[t + 2] = o >>> 16 & 255,
  34920. this.view[t + 1] = o >>> 8 & 255,
  34921. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34922. this.view[t + 1] = o >>> 16 & 255,
  34923. this.view[t + 2] = o >>> 8 & 255,
  34924. this.view[t + 3] = 255 & o,
  34925. t += 4,
  34926. this.view[t] = r >>> 24 & 255,
  34927. this.view[t + 1] = r >>> 16 & 255,
  34928. this.view[t + 2] = r >>> 8 & 255,
  34929. this.view[t + 3] = 255 & r),
  34930. i && (this.offset += 8),
  34931. this
  34932. }
  34933. ,
  34934. a.writeUInt64 = a.writeUint64,
  34935. a.readUint64 = function(e) {
  34936. var t = void 0 === e;
  34937. if (t && (e = this.offset),
  34938. !this.noAssert) {
  34939. if ("number" != typeof e || e % 1 != 0)
  34940. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34941. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34942. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34943. }
  34944. var i = 0
  34945. , n = 0;
  34946. this.littleEndian ? (i = this.view[e + 2] << 16,
  34947. i |= this.view[e + 1] << 8,
  34948. i |= this.view[e],
  34949. i += this.view[e + 3] << 24 >>> 0,
  34950. e += 4,
  34951. n = this.view[e + 2] << 16,
  34952. n |= this.view[e + 1] << 8,
  34953. n |= this.view[e],
  34954. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34955. n |= this.view[e + 2] << 8,
  34956. n |= this.view[e + 3],
  34957. n += this.view[e] << 24 >>> 0,
  34958. e += 4,
  34959. i = this.view[e + 1] << 16,
  34960. i |= this.view[e + 2] << 8,
  34961. i |= this.view[e + 3],
  34962. i += this.view[e] << 24 >>> 0);
  34963. var r = new l(i,n,!0);
  34964. return t && (this.offset += 8),
  34965. r
  34966. }
  34967. ,
  34968. a.readUInt64 = a.readUint64),
  34969. a.writeFloat32 = function(e, t) {
  34970. var i = void 0 === t;
  34971. if (i && (t = this.offset),
  34972. !this.noAssert) {
  34973. if ("number" != typeof e)
  34974. throw TypeError("Illegal value: " + e + " (not a number)");
  34975. if ("number" != typeof t || t % 1 != 0)
  34976. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34977. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34978. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34979. }
  34980. t += 4;
  34981. var n = this.buffer.byteLength;
  34982. return n < t && this.resize((n *= 2) > t ? n : t),
  34983. t -= 4,
  34984. r(this.view, e, t, this.littleEndian, 23, 4),
  34985. i && (this.offset += 4),
  34986. this
  34987. }
  34988. ,
  34989. a.writeFloat = a.writeFloat32,
  34990. a.readFloat32 = function(e) {
  34991. var t = void 0 === e;
  34992. if (t && (e = this.offset),
  34993. !this.noAssert) {
  34994. if ("number" != typeof e || e % 1 != 0)
  34995. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34996. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34997. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34998. }
  34999. var i = n(this.view, e, this.littleEndian, 23, 4);
  35000. return t && (this.offset += 4),
  35001. i
  35002. }
  35003. ,
  35004. a.readFloat = a.readFloat32,
  35005. a.writeFloat64 = function(e, t) {
  35006. var i = void 0 === t;
  35007. if (i && (t = this.offset),
  35008. !this.noAssert) {
  35009. if ("number" != typeof e)
  35010. throw TypeError("Illegal value: " + e + " (not a number)");
  35011. if ("number" != typeof t || t % 1 != 0)
  35012. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35013. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35014. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35015. }
  35016. t += 8;
  35017. var n = this.buffer.byteLength;
  35018. return n < t && this.resize((n *= 2) > t ? n : t),
  35019. t -= 8,
  35020. r(this.view, e, t, this.littleEndian, 52, 8),
  35021. i && (this.offset += 8),
  35022. this
  35023. }
  35024. ,
  35025. a.writeDouble = a.writeFloat64,
  35026. a.readFloat64 = function(e) {
  35027. var t = void 0 === e;
  35028. if (t && (e = this.offset),
  35029. !this.noAssert) {
  35030. if ("number" != typeof e || e % 1 != 0)
  35031. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35032. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35033. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35034. }
  35035. var i = n(this.view, e, this.littleEndian, 52, 8);
  35036. return t && (this.offset += 8),
  35037. i
  35038. }
  35039. ,
  35040. a.readDouble = a.readFloat64,
  35041. f.MAX_VARINT32_BYTES = 5,
  35042. f.calculateVarint32 = function(e) {
  35043. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35044. }
  35045. ,
  35046. f.zigZagEncode32 = function(e) {
  35047. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35048. }
  35049. ,
  35050. f.zigZagDecode32 = function(e) {
  35051. return e >>> 1 ^ -(1 & e) | 0
  35052. }
  35053. ,
  35054. a.writeVarint32 = function(e, t) {
  35055. var i = void 0 === t;
  35056. if (i && (t = this.offset),
  35057. !this.noAssert) {
  35058. if ("number" != typeof e || e % 1 != 0)
  35059. throw TypeError("Illegal value: " + e + " (not an integer)");
  35060. if (e |= 0,
  35061. "number" != typeof t || t % 1 != 0)
  35062. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35063. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35064. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35065. }
  35066. var n, r = f.calculateVarint32(e);
  35067. t += r;
  35068. var o = this.buffer.byteLength;
  35069. for (o < t && this.resize((o *= 2) > t ? o : t),
  35070. t -= r,
  35071. e >>>= 0; 128 <= e; )
  35072. n = 127 & e | 128,
  35073. this.view[t++] = n,
  35074. e >>>= 7;
  35075. return this.view[t++] = e,
  35076. i ? (this.offset = t,
  35077. this) : r
  35078. }
  35079. ,
  35080. a.writeVarint32ZigZag = function(e, t) {
  35081. return this.writeVarint32(f.zigZagEncode32(e), t)
  35082. }
  35083. ,
  35084. a.readVarint32 = function(e) {
  35085. var t = void 0 === e;
  35086. if (t && (e = this.offset),
  35087. !this.noAssert) {
  35088. if ("number" != typeof e || e % 1 != 0)
  35089. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35090. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35091. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35092. }
  35093. var i, n = 0, r = 0;
  35094. do {
  35095. if (!this.noAssert && e > this.limit) {
  35096. var o = Error("Truncated");
  35097. throw o.truncated = !0,
  35098. o
  35099. }
  35100. i = this.view[e++],
  35101. n < 5 && (r |= (127 & i) << 7 * n),
  35102. ++n
  35103. } while (0 != (128 & i));return r |= 0,
  35104. t ? (this.offset = e,
  35105. r) : {
  35106. value: r,
  35107. length: n
  35108. }
  35109. }
  35110. ,
  35111. a.readVarint32ZigZag = function(e) {
  35112. var t = this.readVarint32(e);
  35113. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35114. t
  35115. }
  35116. ,
  35117. l && (f.MAX_VARINT64_BYTES = 10,
  35118. f.calculateVarint64 = function(e) {
  35119. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35120. var t = e.toInt() >>> 0
  35121. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35122. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35123. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  35124. }
  35125. ,
  35126. f.zigZagEncode64 = function(e) {
  35127. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35128. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35129. }
  35130. ,
  35131. f.zigZagDecode64 = function(e) {
  35132. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35133. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35134. }
  35135. ,
  35136. a.writeVarint64 = function(e, t) {
  35137. var i = void 0 === t;
  35138. if (i && (t = this.offset),
  35139. !this.noAssert) {
  35140. if ("number" == typeof e)
  35141. e = l.fromNumber(e);
  35142. else if ("string" == typeof e)
  35143. e = l.fromString(e);
  35144. else if (!(e && e instanceof l))
  35145. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35146. if ("number" != typeof t || t % 1 != 0)
  35147. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35148. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35149. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35150. }
  35151. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35152. var n = f.calculateVarint64(e)
  35153. , r = e.toInt() >>> 0
  35154. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35155. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35156. t += n;
  35157. var s = this.buffer.byteLength;
  35158. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35159. t -= n,
  35160. n) {
  35161. case 10:
  35162. this.view[t + 9] = a >>> 7 & 1;
  35163. case 9:
  35164. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35165. case 8:
  35166. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35167. case 7:
  35168. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35169. case 6:
  35170. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35171. case 5:
  35172. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35173. case 4:
  35174. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35175. case 3:
  35176. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35177. case 2:
  35178. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35179. case 1:
  35180. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35181. }
  35182. return i ? (this.offset += n,
  35183. this) : n
  35184. }
  35185. ,
  35186. a.writeVarint64ZigZag = function(e, t) {
  35187. return this.writeVarint64(f.zigZagEncode64(e), t)
  35188. }
  35189. ,
  35190. a.readVarint64 = function(e) {
  35191. var t = void 0 === e;
  35192. if (t && (e = this.offset),
  35193. !this.noAssert) {
  35194. if ("number" != typeof e || e % 1 != 0)
  35195. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35196. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35197. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35198. }
  35199. var i = e
  35200. , n = 0
  35201. , r = 0
  35202. , o = 0
  35203. , a = 0;
  35204. if (n = 127 & (a = this.view[e++]),
  35205. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35206. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35207. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35208. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35209. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35210. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35211. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35212. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35213. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35214. 128 & a || this.noAssert && void 0 === a))))))))))
  35215. throw Error("Buffer overrun");
  35216. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35217. return t ? (this.offset = e,
  35218. s) : {
  35219. value: s,
  35220. length: e - i
  35221. }
  35222. }
  35223. ,
  35224. a.readVarint64ZigZag = function(e) {
  35225. var t = this.readVarint64(e);
  35226. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35227. t
  35228. }
  35229. ),
  35230. a.writeCString = function(e, t) {
  35231. var i = void 0 === t;
  35232. i && (t = this.offset);
  35233. var n, r = e.length;
  35234. if (!this.noAssert) {
  35235. if ("string" != typeof e)
  35236. throw TypeError("Illegal str: Not a string");
  35237. for (n = 0; n < r; ++n)
  35238. if (0 === e.charCodeAt(n))
  35239. throw RangeError("Illegal str: Contains NULL-characters");
  35240. if ("number" != typeof t || t % 1 != 0)
  35241. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35242. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35243. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35244. }
  35245. r = d.calculateUTF16asUTF8(s(e))[1],
  35246. t += r + 1;
  35247. var o = this.buffer.byteLength;
  35248. return o < t && this.resize((o *= 2) > t ? o : t),
  35249. t -= r + 1,
  35250. d.encodeUTF16toUTF8(s(e), function(e) {
  35251. this.view[t++] = e
  35252. }
  35253. .bind(this)),
  35254. this.view[t++] = 0,
  35255. i ? (this.offset = t,
  35256. this) : r
  35257. }
  35258. ,
  35259. a.readCString = function(e) {
  35260. var t = void 0 === e;
  35261. if (t && (e = this.offset),
  35262. !this.noAssert) {
  35263. if ("number" != typeof e || e % 1 != 0)
  35264. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35265. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35266. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35267. }
  35268. var i, n = e, r = -1;
  35269. return d.decodeUTF8toUTF16(function() {
  35270. if (0 === r)
  35271. return null;
  35272. if (e >= this.limit)
  35273. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35274. return 0 === (r = this.view[e++]) ? null : r
  35275. }
  35276. .bind(this), i = c(), !0),
  35277. t ? (this.offset = e,
  35278. i()) : {
  35279. string: i(),
  35280. length: e - n
  35281. }
  35282. }
  35283. ,
  35284. a.writeIString = function(e, t) {
  35285. var i = void 0 === t;
  35286. if (i && (t = this.offset),
  35287. !this.noAssert) {
  35288. if ("string" != typeof e)
  35289. throw TypeError("Illegal str: Not a string");
  35290. if ("number" != typeof t || t % 1 != 0)
  35291. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35292. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35293. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35294. }
  35295. var n, r = t;
  35296. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35297. t += 4 + n;
  35298. var o = this.buffer.byteLength;
  35299. if (o < t && this.resize((o *= 2) > t ? o : t),
  35300. t -= 4 + n,
  35301. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35302. this.view[t + 2] = n >>> 16 & 255,
  35303. this.view[t + 1] = n >>> 8 & 255,
  35304. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35305. this.view[t + 1] = n >>> 16 & 255,
  35306. this.view[t + 2] = n >>> 8 & 255,
  35307. this.view[t + 3] = 255 & n),
  35308. t += 4,
  35309. d.encodeUTF16toUTF8(s(e), function(e) {
  35310. this.view[t++] = e
  35311. }
  35312. .bind(this)),
  35313. t !== r + 4 + n)
  35314. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35315. return i ? (this.offset = t,
  35316. this) : t - r
  35317. }
  35318. ,
  35319. a.readIString = function(e) {
  35320. var t = void 0 === e;
  35321. if (t && (e = this.offset),
  35322. !this.noAssert) {
  35323. if ("number" != typeof e || e % 1 != 0)
  35324. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35325. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35326. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35327. }
  35328. var i = e
  35329. , n = this.readUint32(e)
  35330. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35331. return e += r.length,
  35332. t ? (this.offset = e,
  35333. r.string) : {
  35334. string: r.string,
  35335. length: e - i
  35336. }
  35337. }
  35338. ,
  35339. f.METRICS_CHARS = "c",
  35340. f.METRICS_BYTES = "b",
  35341. a.writeUTF8String = function(e, t) {
  35342. var i = void 0 === t;
  35343. if (i && (t = this.offset),
  35344. !this.noAssert) {
  35345. if ("number" != typeof t || t % 1 != 0)
  35346. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35347. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35348. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35349. }
  35350. var n, r = t;
  35351. n = d.calculateUTF16asUTF8(s(e))[1],
  35352. t += n;
  35353. var o = this.buffer.byteLength;
  35354. return o < t && this.resize((o *= 2) > t ? o : t),
  35355. t -= n,
  35356. d.encodeUTF16toUTF8(s(e), function(e) {
  35357. this.view[t++] = e
  35358. }
  35359. .bind(this)),
  35360. i ? (this.offset = t,
  35361. this) : t - r
  35362. }
  35363. ,
  35364. a.writeString = a.writeUTF8String,
  35365. f.calculateUTF8Chars = function(e) {
  35366. return d.calculateUTF16asUTF8(s(e))[0]
  35367. }
  35368. ,
  35369. f.calculateUTF8Bytes = function(e) {
  35370. return d.calculateUTF16asUTF8(s(e))[1]
  35371. }
  35372. ,
  35373. f.calculateString = f.calculateUTF8Bytes,
  35374. a.readUTF8String = function(e, t, i) {
  35375. "number" == typeof t && (i = t,
  35376. t = void 0);
  35377. var n = void 0 === i;
  35378. if (n && (i = this.offset),
  35379. void 0 === t && (t = f.METRICS_CHARS),
  35380. !this.noAssert) {
  35381. if ("number" != typeof e || e % 1 != 0)
  35382. throw TypeError("Illegal length: " + e + " (not an integer)");
  35383. if (e |= 0,
  35384. "number" != typeof i || i % 1 != 0)
  35385. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35386. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35387. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35388. }
  35389. var r, o = 0, a = i;
  35390. if (t === f.METRICS_CHARS) {
  35391. if (r = c(),
  35392. d.decodeUTF8(function() {
  35393. return o < e && i < this.limit ? this.view[i++] : null
  35394. }
  35395. .bind(this), function(e) {
  35396. ++o,
  35397. d.UTF8toUTF16(e, r)
  35398. }),
  35399. o !== e)
  35400. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35401. return n ? (this.offset = i,
  35402. r()) : {
  35403. string: r(),
  35404. length: i - a
  35405. }
  35406. }
  35407. if (t !== f.METRICS_BYTES)
  35408. throw TypeError("Unsupported metrics: " + t);
  35409. if (!this.noAssert) {
  35410. if ("number" != typeof i || i % 1 != 0)
  35411. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35412. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35413. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35414. }
  35415. var s = i + e;
  35416. if (d.decodeUTF8toUTF16(function() {
  35417. return i < s ? this.view[i++] : null
  35418. }
  35419. .bind(this), r = c(), this.noAssert),
  35420. i !== s)
  35421. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35422. return n ? (this.offset = i,
  35423. r()) : {
  35424. string: r(),
  35425. length: i - a
  35426. }
  35427. }
  35428. ,
  35429. a.readString = a.readUTF8String,
  35430. a.writeVString = function(e, t) {
  35431. var i = void 0 === t;
  35432. if (i && (t = this.offset),
  35433. !this.noAssert) {
  35434. if ("string" != typeof e)
  35435. throw TypeError("Illegal str: Not a string");
  35436. if ("number" != typeof t || t % 1 != 0)
  35437. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35438. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35439. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35440. }
  35441. var n, r, o = t;
  35442. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35443. r = f.calculateVarint32(n),
  35444. t += r + n;
  35445. var a = this.buffer.byteLength;
  35446. if (a < t && this.resize((a *= 2) > t ? a : t),
  35447. t -= r + n,
  35448. t += this.writeVarint32(n, t),
  35449. d.encodeUTF16toUTF8(s(e), function(e) {
  35450. this.view[t++] = e
  35451. }
  35452. .bind(this)),
  35453. t !== o + n + r)
  35454. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35455. return i ? (this.offset = t,
  35456. this) : t - o
  35457. }
  35458. ,
  35459. a.readVString = function(e) {
  35460. var t = void 0 === e;
  35461. if (t && (e = this.offset),
  35462. !this.noAssert) {
  35463. if ("number" != typeof e || e % 1 != 0)
  35464. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35465. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35466. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35467. }
  35468. var i = e
  35469. , n = this.readVarint32(e)
  35470. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35471. return e += r.length,
  35472. t ? (this.offset = e,
  35473. r.string) : {
  35474. string: r.string,
  35475. length: e - i
  35476. }
  35477. }
  35478. ,
  35479. a.append = function(e, t, i) {
  35480. "number" != typeof t && "string" == typeof t || (i = t,
  35481. t = void 0);
  35482. var n = void 0 === i;
  35483. if (n && (i = this.offset),
  35484. !this.noAssert) {
  35485. if ("number" != typeof i || i % 1 != 0)
  35486. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35487. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35488. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35489. }
  35490. e instanceof f || (e = f.wrap(e, t));
  35491. var r = e.limit - e.offset;
  35492. if (r <= 0)
  35493. return this;
  35494. i += r;
  35495. var o = this.buffer.byteLength;
  35496. return o < i && this.resize((o *= 2) > i ? o : i),
  35497. i -= r,
  35498. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35499. e.offset += r,
  35500. n && (this.offset += r),
  35501. this
  35502. }
  35503. ,
  35504. a.appendTo = function(e, t) {
  35505. return e.append(this, t),
  35506. this
  35507. }
  35508. ,
  35509. a.assert = function(e) {
  35510. return this.noAssert = !e,
  35511. this
  35512. }
  35513. ,
  35514. a.capacity = function() {
  35515. return this.buffer.byteLength
  35516. }
  35517. ,
  35518. a.clear = function() {
  35519. return this.offset = 0,
  35520. this.limit = this.buffer.byteLength,
  35521. this.markedOffset = -1,
  35522. this
  35523. }
  35524. ,
  35525. a.clone = function(e) {
  35526. var t = new f(0,this.littleEndian,this.noAssert);
  35527. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35528. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35529. t.view = this.view),
  35530. t.offset = this.offset,
  35531. t.markedOffset = this.markedOffset,
  35532. t.limit = this.limit,
  35533. t
  35534. }
  35535. ,
  35536. a.compact = function(e, t) {
  35537. if (void 0 === e && (e = this.offset),
  35538. void 0 === t && (t = this.limit),
  35539. !this.noAssert) {
  35540. if ("number" != typeof e || e % 1 != 0)
  35541. throw TypeError("Illegal begin: Not an integer");
  35542. if (e >>>= 0,
  35543. "number" != typeof t || t % 1 != 0)
  35544. throw TypeError("Illegal end: Not an integer");
  35545. if (t >>>= 0,
  35546. e < 0 || t < e || t > this.buffer.byteLength)
  35547. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35548. }
  35549. if (0 === e && t === this.buffer.byteLength)
  35550. return this;
  35551. var i = t - e;
  35552. if (0 == i)
  35553. return this.buffer = o,
  35554. this.view = null,
  35555. 0 <= this.markedOffset && (this.markedOffset -= e),
  35556. this.offset = 0,
  35557. this.limit = 0,
  35558. this;
  35559. var n = new ArrayBuffer(i)
  35560. , r = new Uint8Array(n);
  35561. return r.set(this.view.subarray(e, t)),
  35562. this.buffer = n,
  35563. this.view = r,
  35564. 0 <= this.markedOffset && (this.markedOffset -= e),
  35565. this.offset = 0,
  35566. this.limit = i,
  35567. this
  35568. }
  35569. ,
  35570. a.copy = function(e, t) {
  35571. if (void 0 === e && (e = this.offset),
  35572. void 0 === t && (t = this.limit),
  35573. !this.noAssert) {
  35574. if ("number" != typeof e || e % 1 != 0)
  35575. throw TypeError("Illegal begin: Not an integer");
  35576. if (e >>>= 0,
  35577. "number" != typeof t || t % 1 != 0)
  35578. throw TypeError("Illegal end: Not an integer");
  35579. if (t >>>= 0,
  35580. e < 0 || t < e || t > this.buffer.byteLength)
  35581. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35582. }
  35583. if (e === t)
  35584. return new f(0,this.littleEndian,this.noAssert);
  35585. var i = t - e
  35586. , n = new f(i,this.littleEndian,this.noAssert);
  35587. return n.offset = 0,
  35588. n.limit = i,
  35589. 0 <= n.markedOffset && (n.markedOffset -= e),
  35590. this.copyTo(n, 0, e, t),
  35591. n
  35592. }
  35593. ,
  35594. a.copyTo = function(e, t, i, n) {
  35595. var r, o;
  35596. if (!this.noAssert && !f.isByteBuffer(e))
  35597. throw TypeError("Illegal target: Not a ByteBuffer");
  35598. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35599. i = (r = void 0 === i) ? this.offset : 0 | i,
  35600. n = void 0 === n ? this.limit : 0 | n,
  35601. t < 0 || t > e.buffer.byteLength)
  35602. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35603. if (i < 0 || n > this.buffer.byteLength)
  35604. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35605. var a = n - i;
  35606. return 0 == a ? e : (e.ensureCapacity(t + a),
  35607. e.view.set(this.view.subarray(i, n), t),
  35608. r && (this.offset += a),
  35609. o && (e.offset += a),
  35610. this)
  35611. }
  35612. ,
  35613. a.ensureCapacity = function(e) {
  35614. var t = this.buffer.byteLength;
  35615. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35616. }
  35617. ,
  35618. a.fill = function(e, t, i) {
  35619. var n = void 0 === t;
  35620. if (n && (t = this.offset),
  35621. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35622. void 0 === t && (t = this.offset),
  35623. void 0 === i && (i = this.limit),
  35624. !this.noAssert) {
  35625. if ("number" != typeof e || e % 1 != 0)
  35626. throw TypeError("Illegal value: " + e + " (not an integer)");
  35627. if (e |= 0,
  35628. "number" != typeof t || t % 1 != 0)
  35629. throw TypeError("Illegal begin: Not an integer");
  35630. if (t >>>= 0,
  35631. "number" != typeof i || i % 1 != 0)
  35632. throw TypeError("Illegal end: Not an integer");
  35633. if (i >>>= 0,
  35634. t < 0 || i < t || i > this.buffer.byteLength)
  35635. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35636. }
  35637. if (i <= t)
  35638. return this;
  35639. for (; t < i; )
  35640. this.view[t++] = e;
  35641. return n && (this.offset = t),
  35642. this
  35643. }
  35644. ,
  35645. a.flip = function() {
  35646. return this.limit = this.offset,
  35647. this.offset = 0,
  35648. this
  35649. }
  35650. ,
  35651. a.mark = function(e) {
  35652. if (e = void 0 === e ? this.offset : e,
  35653. !this.noAssert) {
  35654. if ("number" != typeof e || e % 1 != 0)
  35655. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35656. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35657. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35658. }
  35659. return this.markedOffset = e,
  35660. this
  35661. }
  35662. ,
  35663. a.order = function(e) {
  35664. if (!this.noAssert && "boolean" != typeof e)
  35665. throw TypeError("Illegal littleEndian: Not a boolean");
  35666. return this.littleEndian = !!e,
  35667. this
  35668. }
  35669. ,
  35670. a.LE = function(e) {
  35671. return this.littleEndian = void 0 === e || !!e,
  35672. this
  35673. }
  35674. ,
  35675. a.BE = function(e) {
  35676. return this.littleEndian = void 0 !== e && !e,
  35677. this
  35678. }
  35679. ,
  35680. a.prepend = function(e, t, i) {
  35681. "number" != typeof t && "string" == typeof t || (i = t,
  35682. t = void 0);
  35683. var n = void 0 === i;
  35684. if (n && (i = this.offset),
  35685. !this.noAssert) {
  35686. if ("number" != typeof i || i % 1 != 0)
  35687. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35688. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35689. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35690. }
  35691. e instanceof f || (e = f.wrap(e, t));
  35692. var r = e.limit - e.offset;
  35693. if (r <= 0)
  35694. return this;
  35695. var o = r - i;
  35696. if (0 < o) {
  35697. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35698. , s = new Uint8Array(a);
  35699. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35700. this.buffer = a,
  35701. this.view = s,
  35702. this.offset += o,
  35703. 0 <= this.markedOffset && (this.markedOffset += o),
  35704. this.limit += o,
  35705. i += o
  35706. } else
  35707. new Uint8Array(this.buffer);
  35708. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35709. e.offset = e.limit,
  35710. n && (this.offset -= r),
  35711. this
  35712. }
  35713. ,
  35714. a.prependTo = function(e, t) {
  35715. return e.prepend(this, t),
  35716. this
  35717. }
  35718. ,
  35719. a.printDebug = function(e) {
  35720. "function" != typeof e && (e = console.log.bind(console)),
  35721. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35722. }
  35723. ,
  35724. a.remaining = function() {
  35725. return this.limit - this.offset
  35726. }
  35727. ,
  35728. a.reset = function() {
  35729. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35730. this.markedOffset = -1) : this.offset = 0,
  35731. this
  35732. }
  35733. ,
  35734. a.resize = function(e) {
  35735. if (!this.noAssert) {
  35736. if ("number" != typeof e || e % 1 != 0)
  35737. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35738. if ((e |= 0) < 0)
  35739. throw RangeError("Illegal capacity: 0 <= " + e)
  35740. }
  35741. if (this.buffer.byteLength < e) {
  35742. var t = new ArrayBuffer(e)
  35743. , i = new Uint8Array(t);
  35744. i.set(this.view),
  35745. this.buffer = t,
  35746. this.view = i
  35747. }
  35748. return this
  35749. }
  35750. ,
  35751. a.reverse = function(e, t) {
  35752. if (void 0 === e && (e = this.offset),
  35753. void 0 === t && (t = this.limit),
  35754. !this.noAssert) {
  35755. if ("number" != typeof e || e % 1 != 0)
  35756. throw TypeError("Illegal begin: Not an integer");
  35757. if (e >>>= 0,
  35758. "number" != typeof t || t % 1 != 0)
  35759. throw TypeError("Illegal end: Not an integer");
  35760. if (t >>>= 0,
  35761. e < 0 || t < e || t > this.buffer.byteLength)
  35762. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35763. }
  35764. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35765. this
  35766. }
  35767. ,
  35768. a.skip = function(e) {
  35769. if (!this.noAssert) {
  35770. if ("number" != typeof e || e % 1 != 0)
  35771. throw TypeError("Illegal length: " + e + " (not an integer)");
  35772. e |= 0
  35773. }
  35774. var t = this.offset + e;
  35775. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35776. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35777. return this.offset = t,
  35778. this
  35779. }
  35780. ,
  35781. a.slice = function(e, t) {
  35782. if (void 0 === e && (e = this.offset),
  35783. void 0 === t && (t = this.limit),
  35784. !this.noAssert) {
  35785. if ("number" != typeof e || e % 1 != 0)
  35786. throw TypeError("Illegal begin: Not an integer");
  35787. if (e >>>= 0,
  35788. "number" != typeof t || t % 1 != 0)
  35789. throw TypeError("Illegal end: Not an integer");
  35790. if (t >>>= 0,
  35791. e < 0 || t < e || t > this.buffer.byteLength)
  35792. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35793. }
  35794. var i = this.clone();
  35795. return i.offset = e,
  35796. i.limit = t,
  35797. i
  35798. }
  35799. ,
  35800. a.toBuffer = function(e) {
  35801. var t = this.offset
  35802. , i = this.limit;
  35803. if (!this.noAssert) {
  35804. if ("number" != typeof t || t % 1 != 0)
  35805. throw TypeError("Illegal offset: Not an integer");
  35806. if (t >>>= 0,
  35807. "number" != typeof i || i % 1 != 0)
  35808. throw TypeError("Illegal limit: Not an integer");
  35809. if (i >>>= 0,
  35810. t < 0 || i < t || i > this.buffer.byteLength)
  35811. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35812. }
  35813. if (!e && 0 === t && i === this.buffer.byteLength)
  35814. return this.buffer;
  35815. if (t === i)
  35816. return o;
  35817. var n = new ArrayBuffer(i - t);
  35818. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35819. n
  35820. }
  35821. ,
  35822. a.toArrayBuffer = a.toBuffer,
  35823. a.toString = function(e, t, i) {
  35824. if (void 0 === e)
  35825. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35826. switch ("number" == typeof e && (i = t = e = "utf8"),
  35827. e) {
  35828. case "utf8":
  35829. return this.toUTF8(t, i);
  35830. case "base64":
  35831. return this.toBase64(t, i);
  35832. case "hex":
  35833. return this.toHex(t, i);
  35834. case "binary":
  35835. return this.toBinary(t, i);
  35836. case "debug":
  35837. return this.toDebug();
  35838. case "columns":
  35839. return this.toColumns();
  35840. default:
  35841. throw Error("Unsupported encoding: " + e)
  35842. }
  35843. }
  35844. ;
  35845. var h = function() {
  35846. for (var e = {}, r = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], a = [], t = 0, i = r.length; t < i; ++t)
  35847. a[r[t]] = t;
  35848. return e.encode = function(e, t) {
  35849. for (var i, n; null !== (i = e()); )
  35850. t(r[i >> 2 & 63]),
  35851. n = (3 & i) << 4,
  35852. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35853. n = (15 & i) << 2,
  35854. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35855. t(r[63 & i])) : (t(r[63 & n]),
  35856. t(61))) : (t(r[63 & n]),
  35857. t(61),
  35858. t(61))
  35859. }
  35860. ,
  35861. e.decode = function(e, t) {
  35862. function i(e) {
  35863. throw Error("Illegal character code: " + e)
  35864. }
  35865. for (var n, r, o; null !== (n = e()); )
  35866. if (void 0 === (r = a[n]) && i(n),
  35867. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35868. t(r << 2 >>> 0 | (48 & o) >> 4),
  35869. null !== (n = e()))) {
  35870. if (void 0 === (r = a[n])) {
  35871. if (61 === n)
  35872. break;
  35873. i(n)
  35874. }
  35875. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35876. null !== (n = e())) {
  35877. if (void 0 === (o = a[n])) {
  35878. if (61 === n)
  35879. break;
  35880. i(n)
  35881. }
  35882. t((3 & r) << 6 >>> 0 | o)
  35883. }
  35884. }
  35885. }
  35886. ,
  35887. e.test = function(e) {
  35888. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35889. }
  35890. ,
  35891. e
  35892. }();
  35893. a.toBase64 = function(e, t) {
  35894. if (void 0 === e && (e = this.offset),
  35895. void 0 === t && (t = this.limit),
  35896. t |= 0,
  35897. (e |= 0) < 0 || t > this.capacity || t < e)
  35898. throw RangeError("begin, end");
  35899. var i;
  35900. return h.encode(function() {
  35901. return e < t ? this.view[e++] : null
  35902. }
  35903. .bind(this), i = c()),
  35904. i()
  35905. }
  35906. ,
  35907. f.fromBase64 = function(e, t) {
  35908. if ("string" != typeof e)
  35909. throw TypeError("str");
  35910. var i = new f(e.length / 4 * 3,t)
  35911. , n = 0;
  35912. return h.decode(s(e), function(e) {
  35913. i.view[n++] = e
  35914. }),
  35915. i.limit = n,
  35916. i
  35917. }
  35918. ,
  35919. f.btoa = function(e) {
  35920. return f.fromBinary(e).toBase64()
  35921. }
  35922. ,
  35923. f.atob = function(e) {
  35924. return f.fromBase64(e).toBinary()
  35925. }
  35926. ,
  35927. a.toBinary = function(e, t) {
  35928. if (void 0 === e && (e = this.offset),
  35929. void 0 === t && (t = this.limit),
  35930. t |= 0,
  35931. (e |= 0) < 0 || t > this.capacity() || t < e)
  35932. throw RangeError("begin, end");
  35933. if (e === t)
  35934. return "";
  35935. for (var i = [], n = []; e < t; )
  35936. i.push(this.view[e++]),
  35937. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35938. i = []);
  35939. return n.join("") + String.fromCharCode.apply(String, i)
  35940. }
  35941. ,
  35942. f.fromBinary = function(e, t) {
  35943. if ("string" != typeof e)
  35944. throw TypeError("str");
  35945. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35946. if (255 < (i = e.charCodeAt(n)))
  35947. throw RangeError("illegal char code: " + i);
  35948. o.view[n++] = i
  35949. }
  35950. return o.limit = r,
  35951. o
  35952. }
  35953. ,
  35954. a.toDebug = function(e) {
  35955. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35956. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35957. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35958. ++i,
  35959. e && 0 < i && i % 16 == 0 && i !== n) {
  35960. for (; r.length < 51; )
  35961. r += " ";
  35962. a += r + o + "\n",
  35963. r = o = ""
  35964. }
  35965. 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 ? " " : ""
  35966. }
  35967. if (e && " " !== r) {
  35968. for (; r.length < 51; )
  35969. r += " ";
  35970. a += r + o + "\n"
  35971. }
  35972. return e ? a : r
  35973. }
  35974. ,
  35975. f.fromDebug = function(e, t, i) {
  35976. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  35977. switch (n = e.charAt(s++)) {
  35978. case "!":
  35979. if (!i) {
  35980. if (h || u || d) {
  35981. p = !0;
  35982. break
  35983. }
  35984. h = u = d = !0
  35985. }
  35986. a.offset = a.markedOffset = a.limit = l,
  35987. c = !1;
  35988. break;
  35989. case "|":
  35990. if (!i) {
  35991. if (h || d) {
  35992. p = !0;
  35993. break
  35994. }
  35995. h = d = !0
  35996. }
  35997. a.offset = a.limit = l,
  35998. c = !1;
  35999. break;
  36000. case "[":
  36001. if (!i) {
  36002. if (h || u) {
  36003. p = !0;
  36004. break
  36005. }
  36006. h = u = !0
  36007. }
  36008. a.offset = a.markedOffset = l,
  36009. c = !1;
  36010. break;
  36011. case "<":
  36012. if (!i) {
  36013. if (h) {
  36014. p = !0;
  36015. break
  36016. }
  36017. h = !0
  36018. }
  36019. a.offset = l,
  36020. c = !1;
  36021. break;
  36022. case "]":
  36023. if (!i) {
  36024. if (d || u) {
  36025. p = !0;
  36026. break
  36027. }
  36028. d = u = !0
  36029. }
  36030. a.limit = a.markedOffset = l,
  36031. c = !1;
  36032. break;
  36033. case ">":
  36034. if (!i) {
  36035. if (d) {
  36036. p = !0;
  36037. break
  36038. }
  36039. d = !0
  36040. }
  36041. a.limit = l,
  36042. c = !1;
  36043. break;
  36044. case "'":
  36045. if (!i) {
  36046. if (u) {
  36047. p = !0;
  36048. break
  36049. }
  36050. u = !0
  36051. }
  36052. a.markedOffset = l,
  36053. c = !1;
  36054. break;
  36055. case " ":
  36056. c = !1;
  36057. break;
  36058. default:
  36059. if (!i && c) {
  36060. p = !0;
  36061. break
  36062. }
  36063. if (r = parseInt(n + e.charAt(s++), 16),
  36064. !i && (isNaN(r) || r < 0 || 255 < r))
  36065. throw TypeError("Illegal str: Not a debug encoded string");
  36066. a.view[l++] = r,
  36067. c = !0
  36068. }
  36069. if (p)
  36070. throw TypeError("Illegal str: Invalid symbol at " + s)
  36071. }
  36072. if (!i) {
  36073. if (!h || !d)
  36074. throw TypeError("Illegal str: Missing offset or limit");
  36075. if (l < a.buffer.byteLength)
  36076. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36077. }
  36078. return a
  36079. }
  36080. ,
  36081. a.toHex = function(e, t) {
  36082. if (e = void 0 === e ? this.offset : e,
  36083. t = void 0 === t ? this.limit : t,
  36084. !this.noAssert) {
  36085. if ("number" != typeof e || e % 1 != 0)
  36086. throw TypeError("Illegal begin: Not an integer");
  36087. if (e >>>= 0,
  36088. "number" != typeof t || t % 1 != 0)
  36089. throw TypeError("Illegal end: Not an integer");
  36090. if (t >>>= 0,
  36091. e < 0 || t < e || t > this.buffer.byteLength)
  36092. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36093. }
  36094. for (var i, n = new Array(t - e); e < t; )
  36095. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36096. return n.join("")
  36097. }
  36098. ,
  36099. f.fromHex = function(e, t, i) {
  36100. if (!i) {
  36101. if ("string" != typeof e)
  36102. throw TypeError("Illegal str: Not a string");
  36103. if (e.length % 2 != 0)
  36104. throw TypeError("Illegal str: Length not a multiple of 2")
  36105. }
  36106. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36107. if (n = parseInt(e.substring(a, a + 2), 16),
  36108. !i && (!isFinite(n) || n < 0 || 255 < n))
  36109. throw TypeError("Illegal str: Contains non-hex characters");
  36110. o.view[s++] = n
  36111. }
  36112. return o.limit = s,
  36113. o
  36114. }
  36115. ;
  36116. var u, d = u = {
  36117. MAX_CODEPOINT: 1114111,
  36118. encodeUTF8: function(e, t) {
  36119. var i = null;
  36120. for ("number" == typeof e && (i = e,
  36121. e = function() {
  36122. return null
  36123. }
  36124. ); null !== i || null !== (i = e()); )
  36125. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36126. t(i >> 12 & 63 | 128)),
  36127. t(i >> 6 & 63 | 128)),
  36128. t(63 & i | 128)),
  36129. i = null
  36130. },
  36131. decodeUTF8: function(e, t) {
  36132. for (var i, n, r, o, a = function(e) {
  36133. e = e.slice(0, e.indexOf(null));
  36134. var t = Error(e.toString());
  36135. throw t.name = "TruncatedError",
  36136. t.bytes = e,
  36137. t
  36138. }; null !== (i = e()); )
  36139. if (0 == (128 & i))
  36140. t(i);
  36141. else if (192 == (224 & i))
  36142. null === (n = e()) && a([i, n]),
  36143. t((31 & i) << 6 | 63 & n);
  36144. else if (224 == (240 & i))
  36145. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36146. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36147. else {
  36148. if (240 != (248 & i))
  36149. throw RangeError("Illegal starting byte: " + i);
  36150. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36151. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36152. }
  36153. },
  36154. UTF16toUTF8: function(e, t) {
  36155. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36156. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36157. n = null) : t(i);
  36158. null !== n && t(n)
  36159. },
  36160. UTF8toUTF16: function(e, t) {
  36161. var i = null;
  36162. for ("number" == typeof e && (i = e,
  36163. e = function() {
  36164. return null
  36165. }
  36166. ); null !== i || null !== (i = e()); )
  36167. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36168. t(i % 1024 + 56320)),
  36169. i = null
  36170. },
  36171. encodeUTF16toUTF8: function(e, t) {
  36172. u.UTF16toUTF8(e, function(e) {
  36173. u.encodeUTF8(e, t)
  36174. })
  36175. },
  36176. decodeUTF8toUTF16: function(e, t) {
  36177. u.decodeUTF8(e, function(e) {
  36178. u.UTF8toUTF16(e, t)
  36179. })
  36180. },
  36181. calculateCodePoint: function(e) {
  36182. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36183. },
  36184. calculateUTF8: function(e) {
  36185. for (var t, i = 0; null !== (t = e()); )
  36186. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36187. return i
  36188. },
  36189. calculateUTF16asUTF8: function(e) {
  36190. var t = 0
  36191. , i = 0;
  36192. return u.UTF16toUTF8(e, function(e) {
  36193. ++t,
  36194. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36195. }),
  36196. [t, i]
  36197. }
  36198. };
  36199. return a.toUTF8 = function(t, i) {
  36200. if (void 0 === t && (t = this.offset),
  36201. void 0 === i && (i = this.limit),
  36202. !this.noAssert) {
  36203. if ("number" != typeof t || t % 1 != 0)
  36204. throw TypeError("Illegal begin: Not an integer");
  36205. if (t >>>= 0,
  36206. "number" != typeof i || i % 1 != 0)
  36207. throw TypeError("Illegal end: Not an integer");
  36208. if (i >>>= 0,
  36209. t < 0 || i < t || i > this.buffer.byteLength)
  36210. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36211. }
  36212. var e;
  36213. try {
  36214. d.decodeUTF8toUTF16(function() {
  36215. return t < i ? this.view[t++] : null
  36216. }
  36217. .bind(this), e = c())
  36218. } catch (e) {
  36219. if (t !== i)
  36220. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36221. }
  36222. return e()
  36223. }
  36224. ,
  36225. f.fromUTF8 = function(e, t, i) {
  36226. if (!i && "string" != typeof e)
  36227. throw TypeError("Illegal str: Not a string");
  36228. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36229. , r = 0;
  36230. return d.encodeUTF16toUTF8(s(e), function(e) {
  36231. n.view[r++] = e
  36232. }),
  36233. n.limit = r,
  36234. n
  36235. }
  36236. ,
  36237. f
  36238. }
  36239. ,
  36240. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36241. var e;
  36242. try {
  36243. e = t("long")
  36244. } catch (e) {}
  36245. return r(e)
  36246. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36247. }
  36248. , {
  36249. long: 216
  36250. }],
  36251. 216: [function(e, t, i) {
  36252. var n, r;
  36253. n = this,
  36254. r = function() {
  36255. "use strict";
  36256. function n(e, t, i) {
  36257. this.low = 0 | e,
  36258. this.high = 0 | t,
  36259. this.unsigned = !!i
  36260. }
  36261. function p(e) {
  36262. return !0 === (e && e.__isLong__)
  36263. }
  36264. function e(e, t) {
  36265. var i, n, r;
  36266. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36267. r && (a[e] = i),
  36268. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36269. r && (o[e] = i),
  36270. i)
  36271. }
  36272. function f(e, t) {
  36273. if (isNaN(e) || !isFinite(e))
  36274. return t ? l : y;
  36275. if (t) {
  36276. if (e < 0)
  36277. return l;
  36278. if (r <= e)
  36279. return I
  36280. } else {
  36281. if (e <= -s)
  36282. return E;
  36283. if (s <= e + 1)
  36284. return C
  36285. }
  36286. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36287. }
  36288. function g(e, t, i) {
  36289. return new n(e,t,i)
  36290. }
  36291. function h(e, t, i) {
  36292. if (0 === e.length)
  36293. throw Error("empty string");
  36294. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36295. return y;
  36296. if (t = "number" == typeof t ? (i = t,
  36297. !1) : !!t,
  36298. (i = i || 10) < 2 || 36 < i)
  36299. throw RangeError("radix");
  36300. var n;
  36301. if (0 < (n = e.indexOf("-")))
  36302. throw Error("interior hyphen");
  36303. if (0 === n)
  36304. return h(e.substring(1), t, i).neg();
  36305. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36306. var s = Math.min(8, e.length - a)
  36307. , l = parseInt(e.substring(a, a + s), i);
  36308. if (s < 8) {
  36309. var c = f(u(i, s));
  36310. o = o.mul(c).add(f(l))
  36311. } else
  36312. o = (o = o.mul(r)).add(f(l))
  36313. }
  36314. return o.unsigned = t,
  36315. o
  36316. }
  36317. function m(e) {
  36318. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36319. }
  36320. Object.defineProperty(n.prototype, "__isLong__", {
  36321. value: !0,
  36322. enumerable: !1,
  36323. configurable: !1
  36324. }),
  36325. n.isLong = p;
  36326. var o = {}
  36327. , a = {};
  36328. n.fromInt = e,
  36329. n.fromNumber = f,
  36330. n.fromBits = g;
  36331. var u = Math.pow;
  36332. n.fromString = h,
  36333. n.fromValue = m;
  36334. var i = 4294967296
  36335. , r = 0x10000000000000000
  36336. , s = r / 2
  36337. , v = e(1 << 24)
  36338. , y = e(0);
  36339. n.ZERO = y;
  36340. var l = e(0, !0);
  36341. n.UZERO = l;
  36342. var c = e(1);
  36343. n.ONE = c;
  36344. var d = e(1, !0);
  36345. n.UONE = d;
  36346. var A = e(-1);
  36347. n.NEG_ONE = A;
  36348. var C = g(-1, 2147483647, !1);
  36349. n.MAX_VALUE = C;
  36350. var I = g(-1, -1, !0);
  36351. n.MAX_UNSIGNED_VALUE = I;
  36352. var E = g(0, -2147483648, !1);
  36353. n.MIN_VALUE = E;
  36354. var t = n.prototype;
  36355. return t.toInt = function() {
  36356. return this.unsigned ? this.low >>> 0 : this.low
  36357. }
  36358. ,
  36359. t.toNumber = function() {
  36360. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36361. }
  36362. ,
  36363. t.toString = function(e) {
  36364. if ((e = e || 10) < 2 || 36 < e)
  36365. throw RangeError("radix");
  36366. if (this.isZero())
  36367. return "0";
  36368. if (this.isNegative()) {
  36369. if (this.eq(E)) {
  36370. var t = f(e)
  36371. , i = this.div(t)
  36372. , n = i.mul(t).sub(this);
  36373. return i.toString(e) + n.toInt().toString(e)
  36374. }
  36375. return "-" + this.neg().toString(e)
  36376. }
  36377. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36378. var s = o.div(r)
  36379. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36380. if ((o = s).isZero())
  36381. return l + a;
  36382. for (; l.length < 6; )
  36383. l = "0" + l;
  36384. a = "" + l + a
  36385. }
  36386. }
  36387. ,
  36388. t.getHighBits = function() {
  36389. return this.high
  36390. }
  36391. ,
  36392. t.getHighBitsUnsigned = function() {
  36393. return this.high >>> 0
  36394. }
  36395. ,
  36396. t.getLowBits = function() {
  36397. return this.low
  36398. }
  36399. ,
  36400. t.getLowBitsUnsigned = function() {
  36401. return this.low >>> 0
  36402. }
  36403. ,
  36404. t.getNumBitsAbs = function() {
  36405. if (this.isNegative())
  36406. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36407. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36408. ;
  36409. return 0 != this.high ? t + 33 : t + 1
  36410. }
  36411. ,
  36412. t.isZero = function() {
  36413. return 0 === this.high && 0 === this.low
  36414. }
  36415. ,
  36416. t.isNegative = function() {
  36417. return !this.unsigned && this.high < 0
  36418. }
  36419. ,
  36420. t.isPositive = function() {
  36421. return this.unsigned || 0 <= this.high
  36422. }
  36423. ,
  36424. t.isOdd = function() {
  36425. return 1 == (1 & this.low)
  36426. }
  36427. ,
  36428. t.isEven = function() {
  36429. return 0 == (1 & this.low)
  36430. }
  36431. ,
  36432. t.equals = function(e) {
  36433. return p(e) || (e = m(e)),
  36434. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36435. }
  36436. ,
  36437. t.eq = t.equals,
  36438. t.notEquals = function(e) {
  36439. return !this.eq(e)
  36440. }
  36441. ,
  36442. t.neq = t.notEquals,
  36443. t.lessThan = function(e) {
  36444. return this.comp(e) < 0
  36445. }
  36446. ,
  36447. t.lt = t.lessThan,
  36448. t.lessThanOrEqual = function(e) {
  36449. return this.comp(e) <= 0
  36450. }
  36451. ,
  36452. t.lte = t.lessThanOrEqual,
  36453. t.greaterThan = function(e) {
  36454. return 0 < this.comp(e)
  36455. }
  36456. ,
  36457. t.gt = t.greaterThan,
  36458. t.greaterThanOrEqual = function(e) {
  36459. return 0 <= this.comp(e)
  36460. }
  36461. ,
  36462. t.gte = t.greaterThanOrEqual,
  36463. t.compare = function(e) {
  36464. if (p(e) || (e = m(e)),
  36465. this.eq(e))
  36466. return 0;
  36467. var t = this.isNegative()
  36468. , i = e.isNegative();
  36469. return t && !i ? -1 : !t && i ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36470. }
  36471. ,
  36472. t.comp = t.compare,
  36473. t.negate = function() {
  36474. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36475. }
  36476. ,
  36477. t.neg = t.negate,
  36478. t.add = function(e) {
  36479. p(e) || (e = m(e));
  36480. var t = this.high >>> 16
  36481. , i = 65535 & this.high
  36482. , n = this.low >>> 16
  36483. , r = 65535 & this.low
  36484. , o = e.high >>> 16
  36485. , a = 65535 & e.high
  36486. , s = e.low >>> 16
  36487. , l = 0
  36488. , c = 0
  36489. , h = 0
  36490. , u = 0;
  36491. return h += (u += r + (65535 & e.low)) >>> 16,
  36492. c += (h += n + s) >>> 16,
  36493. l += (c += i + a) >>> 16,
  36494. l += t + o,
  36495. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36496. }
  36497. ,
  36498. t.subtract = function(e) {
  36499. return p(e) || (e = m(e)),
  36500. this.add(e.neg())
  36501. }
  36502. ,
  36503. t.sub = t.subtract,
  36504. t.multiply = function(e) {
  36505. if (this.isZero())
  36506. return y;
  36507. if (p(e) || (e = m(e)),
  36508. e.isZero())
  36509. return y;
  36510. if (this.eq(E))
  36511. return e.isOdd() ? E : y;
  36512. if (e.eq(E))
  36513. return this.isOdd() ? E : y;
  36514. if (this.isNegative())
  36515. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36516. if (e.isNegative())
  36517. return this.mul(e.neg()).neg();
  36518. if (this.lt(v) && e.lt(v))
  36519. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36520. var t = this.high >>> 16
  36521. , i = 65535 & this.high
  36522. , n = this.low >>> 16
  36523. , r = 65535 & this.low
  36524. , o = e.high >>> 16
  36525. , a = 65535 & e.high
  36526. , s = e.low >>> 16
  36527. , l = 65535 & e.low
  36528. , c = 0
  36529. , h = 0
  36530. , u = 0
  36531. , d = 0;
  36532. return u += (d += r * l) >>> 16,
  36533. h += (u += n * l) >>> 16,
  36534. u &= 65535,
  36535. h += (u += r * s) >>> 16,
  36536. c += (h += i * l) >>> 16,
  36537. h &= 65535,
  36538. c += (h += n * s) >>> 16,
  36539. h &= 65535,
  36540. c += (h += r * a) >>> 16,
  36541. c += t * l + i * s + n * a + r * o,
  36542. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36543. }
  36544. ,
  36545. t.mul = t.multiply,
  36546. t.divide = function(e) {
  36547. if (p(e) || (e = m(e)),
  36548. e.isZero())
  36549. throw Error("division by zero");
  36550. if (this.isZero())
  36551. return this.unsigned ? l : y;
  36552. var t, i, n;
  36553. if (this.unsigned) {
  36554. if (e.unsigned || (e = e.toUnsigned()),
  36555. e.gt(this))
  36556. return l;
  36557. if (e.gt(this.shru(1)))
  36558. return d;
  36559. n = l
  36560. } else {
  36561. if (this.eq(E))
  36562. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  36563. n = t.add(i.div(e)));
  36564. if (e.eq(E))
  36565. return this.unsigned ? l : y;
  36566. if (this.isNegative())
  36567. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36568. if (e.isNegative())
  36569. return this.div(e.neg()).neg();
  36570. n = y
  36571. }
  36572. for (i = this; i.gte(e); ) {
  36573. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36574. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  36575. s = (a = f(t -= o, this.unsigned)).mul(e);
  36576. a.isZero() && (a = c),
  36577. n = n.add(a),
  36578. i = i.sub(s)
  36579. }
  36580. return n
  36581. }
  36582. ,
  36583. t.div = t.divide,
  36584. t.modulo = function(e) {
  36585. return p(e) || (e = m(e)),
  36586. this.sub(this.div(e).mul(e))
  36587. }
  36588. ,
  36589. t.mod = t.modulo,
  36590. t.not = function() {
  36591. return g(~this.low, ~this.high, this.unsigned)
  36592. }
  36593. ,
  36594. t.and = function(e) {
  36595. return p(e) || (e = m(e)),
  36596. g(this.low & e.low, this.high & e.high, this.unsigned)
  36597. }
  36598. ,
  36599. t.or = function(e) {
  36600. return p(e) || (e = m(e)),
  36601. g(this.low | e.low, this.high | e.high, this.unsigned)
  36602. }
  36603. ,
  36604. t.xor = function(e) {
  36605. return p(e) || (e = m(e)),
  36606. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36607. }
  36608. ,
  36609. t.shiftLeft = function(e) {
  36610. return p(e) && (e = e.toInt()),
  36611. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  36612. }
  36613. ,
  36614. t.shl = t.shiftLeft,
  36615. t.shiftRight = function(e) {
  36616. return p(e) && (e = e.toInt()),
  36617. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  36618. }
  36619. ,
  36620. t.shr = t.shiftRight,
  36621. t.shiftRightUnsigned = function(e) {
  36622. if (p(e) && (e = e.toInt()),
  36623. 0 === (e &= 63))
  36624. return this;
  36625. var t = this.high;
  36626. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36627. }
  36628. ,
  36629. t.shru = t.shiftRightUnsigned,
  36630. t.toSigned = function() {
  36631. return this.unsigned ? g(this.low, this.high, !1) : this
  36632. }
  36633. ,
  36634. t.toUnsigned = function() {
  36635. return this.unsigned ? this : g(this.low, this.high, !0)
  36636. }
  36637. ,
  36638. t.toBytes = function(e) {
  36639. return e ? this.toBytesLE() : this.toBytesBE()
  36640. }
  36641. ,
  36642. t.toBytesLE = function() {
  36643. var e = this.high
  36644. , t = this.low;
  36645. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36646. }
  36647. ,
  36648. t.toBytesBE = function() {
  36649. var e = this.high
  36650. , t = this.low;
  36651. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36652. }
  36653. ,
  36654. n
  36655. }
  36656. ,
  36657. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  36658. }
  36659. , {}],
  36660. 217: [function(e, t, i) {
  36661. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  36662. REVISION: "75"
  36663. };
  36664. function Ii(e, t) {
  36665. return e.distance - t.distance
  36666. }
  36667. function Ei(e, t, i, n) {
  36668. if (!1 !== e.visible && (e.raycast(t, i),
  36669. !0 === n))
  36670. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36671. Ei(r[o], t, i, !0)
  36672. }
  36673. function _i(e, t, i) {
  36674. return i < 0 && (i += 1),
  36675. 1 < i && (i -= 1),
  36676. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36677. }
  36678. function bi(e, t, i, n, r, o, a) {
  36679. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36680. r.multiplyScalar(Vt.x),
  36681. o.multiplyScalar(Vt.y),
  36682. a.multiplyScalar(Vt.z),
  36683. r.add(o).add(a),
  36684. r.clone()
  36685. }
  36686. function wi(e, t, i, n, r, o, a) {
  36687. var s = e.material;
  36688. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36689. return null;
  36690. Ut.copy(a),
  36691. Ut.applyMatrix4(e.matrixWorld);
  36692. var l = t.ray.origin.distanceTo(Ut);
  36693. return l < t.near || l > t.far ? null : {
  36694. distance: l,
  36695. point: Ut.clone(),
  36696. object: e
  36697. }
  36698. }
  36699. function Ti(e, t, i, n, r, o, a, s) {
  36700. Mt.fromArray(n, 3 * o),
  36701. Rt.fromArray(n, 3 * a),
  36702. Pt.fromArray(n, 3 * s);
  36703. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36704. return l && (r && (Nt.fromArray(r, 2 * o),
  36705. Ft.fromArray(r, 2 * a),
  36706. Bt.fromArray(r, 2 * s),
  36707. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36708. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36709. l.faceIndex = o),
  36710. l
  36711. }
  36712. function xi() {}
  36713. function Si(e, t, i, n, r, o) {
  36714. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36715. if (s = e[o[t]].x,
  36716. l = e[o[t]].y,
  36717. c = e[o[i]].x,
  36718. h = e[o[i]].y,
  36719. u = e[o[n]].x,
  36720. d = e[o[n]].y,
  36721. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36722. return !1;
  36723. for (g = u - c,
  36724. m = d - h,
  36725. v = s - u,
  36726. y = l - d,
  36727. A = c - s,
  36728. C = h - l,
  36729. a = 0; a < r; a++)
  36730. if (p = e[o[a]].x,
  36731. f = e[o[a]].y,
  36732. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36733. E = v * (f - d) - y * (p - u),
  36734. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36735. return !1;
  36736. return !0
  36737. }
  36738. function Mi(e) {
  36739. switch (e) {
  36740. case Ci.LinearEncoding:
  36741. return ["Linear", "( value )"];
  36742. case Ci.sRGBEncoding:
  36743. return ["sRGB", "( value )"];
  36744. case Ci.RGBEEncoding:
  36745. return ["RGBE", "( value )"];
  36746. case Ci.RGBM7Encoding:
  36747. return ["RGBM", "( value, 7.0 )"];
  36748. case Ci.RGBM16Encoding:
  36749. return ["RGBM", "( value, 16.0 )"];
  36750. case Ci.RGBDEncoding:
  36751. return ["RGBD", "( value, 256.0 )"];
  36752. case Ci.GammaEncoding:
  36753. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36754. default:
  36755. throw new Error("unsupported encoding: " + e)
  36756. }
  36757. }
  36758. function Ri(e, t) {
  36759. var i = Mi(t);
  36760. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36761. }
  36762. function Pi(e) {
  36763. return "" !== e
  36764. }
  36765. function Oi(e, t) {
  36766. 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)
  36767. }
  36768. function Li(e) {
  36769. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36770. var i = Ci.ShaderChunk[t];
  36771. if (void 0 === i)
  36772. throw new Error("Can not resolve #include <" + t + ">");
  36773. return Li(i)
  36774. })
  36775. }
  36776. function Di(e) {
  36777. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36778. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36779. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36780. return r
  36781. })
  36782. }
  36783. function Ni(e, t, i, n) {
  36784. gi.set(t, i, n).unproject(mi);
  36785. var r = fi[e];
  36786. if (void 0 !== r)
  36787. for (var o = 0, a = r.length; o < a; o++)
  36788. pi.vertices[r[o]].copy(gi)
  36789. }
  36790. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36791. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36792. void 0 === Math.sign && (Math.sign = function(e) {
  36793. return e < 0 ? -1 : 0 < e ? 1 : +e
  36794. }
  36795. ),
  36796. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36797. get: function() {
  36798. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36799. }
  36800. }),
  36801. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36802. writable: !0,
  36803. configurable: !0,
  36804. value: function(e) {
  36805. "use strict";
  36806. if (null == e)
  36807. throw new TypeError("Cannot convert first argument to object");
  36808. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36809. var r = arguments[i];
  36810. if (null != r) {
  36811. r = Object(r);
  36812. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36813. var l = o[a]
  36814. , c = Object.getOwnPropertyDescriptor(r, l);
  36815. void 0 !== c && c.enumerable && (t[l] = r[l])
  36816. }
  36817. }
  36818. }
  36819. return t
  36820. }
  36821. }),
  36822. Ci.MOUSE = {
  36823. LEFT: 0,
  36824. MIDDLE: 1,
  36825. RIGHT: 2
  36826. },
  36827. Ci.CullFaceNone = 0,
  36828. Ci.CullFaceBack = 1,
  36829. Ci.CullFaceFront = 2,
  36830. Ci.CullFaceFrontBack = 3,
  36831. Ci.FrontFaceDirectionCW = 0,
  36832. Ci.FrontFaceDirectionCCW = 1,
  36833. Ci.BasicShadowMap = 0,
  36834. Ci.PCFShadowMap = 1,
  36835. Ci.PCFSoftShadowMap = 2,
  36836. Ci.FrontSide = 0,
  36837. Ci.BackSide = 1,
  36838. Ci.DoubleSide = 2,
  36839. Ci.FlatShading = 1,
  36840. Ci.SmoothShading = 2,
  36841. Ci.NoColors = 0,
  36842. Ci.FaceColors = 1,
  36843. Ci.VertexColors = 2,
  36844. Ci.NoBlending = 0,
  36845. Ci.NormalBlending = 1,
  36846. Ci.AdditiveBlending = 2,
  36847. Ci.SubtractiveBlending = 3,
  36848. Ci.MultiplyBlending = 4,
  36849. Ci.CustomBlending = 5,
  36850. Ci.AddEquation = 100,
  36851. Ci.SubtractEquation = 101,
  36852. Ci.ReverseSubtractEquation = 102,
  36853. Ci.MinEquation = 103,
  36854. Ci.MaxEquation = 104,
  36855. Ci.ZeroFactor = 200,
  36856. Ci.OneFactor = 201,
  36857. Ci.SrcColorFactor = 202,
  36858. Ci.OneMinusSrcColorFactor = 203,
  36859. Ci.SrcAlphaFactor = 204,
  36860. Ci.OneMinusSrcAlphaFactor = 205,
  36861. Ci.DstAlphaFactor = 206,
  36862. Ci.OneMinusDstAlphaFactor = 207,
  36863. Ci.DstColorFactor = 208,
  36864. Ci.OneMinusDstColorFactor = 209,
  36865. Ci.SrcAlphaSaturateFactor = 210,
  36866. Ci.NeverDepth = 0,
  36867. Ci.AlwaysDepth = 1,
  36868. Ci.LessDepth = 2,
  36869. Ci.LessEqualDepth = 3,
  36870. Ci.EqualDepth = 4,
  36871. Ci.GreaterEqualDepth = 5,
  36872. Ci.GreaterDepth = 6,
  36873. Ci.NotEqualDepth = 7,
  36874. Ci.MultiplyOperation = 0,
  36875. Ci.MixOperation = 1,
  36876. Ci.AddOperation = 2,
  36877. Ci.NoToneMapping = 0,
  36878. Ci.LinearToneMapping = 1,
  36879. Ci.ReinhardToneMapping = 2,
  36880. Ci.Uncharted2ToneMapping = 3,
  36881. Ci.CineonToneMapping = 4,
  36882. Ci.UVMapping = 300,
  36883. Ci.CubeReflectionMapping = 301,
  36884. Ci.CubeRefractionMapping = 302,
  36885. Ci.EquirectangularReflectionMapping = 303,
  36886. Ci.EquirectangularRefractionMapping = 304,
  36887. Ci.SphericalReflectionMapping = 305,
  36888. Ci.CubeUVReflectionMapping = 306,
  36889. Ci.CubeUVRefractionMapping = 307,
  36890. Ci.RepeatWrapping = 1e3,
  36891. Ci.ClampToEdgeWrapping = 1001,
  36892. Ci.MirroredRepeatWrapping = 1002,
  36893. Ci.NearestFilter = 1003,
  36894. Ci.NearestMipMapNearestFilter = 1004,
  36895. Ci.NearestMipMapLinearFilter = 1005,
  36896. Ci.LinearFilter = 1006,
  36897. Ci.LinearMipMapNearestFilter = 1007,
  36898. Ci.LinearMipMapLinearFilter = 1008,
  36899. Ci.UnsignedByteType = 1009,
  36900. Ci.ByteType = 1010,
  36901. Ci.ShortType = 1011,
  36902. Ci.UnsignedShortType = 1012,
  36903. Ci.IntType = 1013,
  36904. Ci.UnsignedIntType = 1014,
  36905. Ci.FloatType = 1015,
  36906. Ci.HalfFloatType = 1025,
  36907. Ci.UnsignedShort4444Type = 1016,
  36908. Ci.UnsignedShort5551Type = 1017,
  36909. Ci.UnsignedShort565Type = 1018,
  36910. Ci.AlphaFormat = 1019,
  36911. Ci.RGBFormat = 1020,
  36912. Ci.RGBAFormat = 1021,
  36913. Ci.LuminanceFormat = 1022,
  36914. Ci.LuminanceAlphaFormat = 1023,
  36915. Ci.RGBEFormat = Ci.RGBAFormat,
  36916. Ci.RGB_S3TC_DXT1_Format = 2001,
  36917. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36918. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36919. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36920. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36921. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36922. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36923. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36924. Ci.RGB_ETC1_Format = 2151,
  36925. Ci.LoopOnce = 2200,
  36926. Ci.LoopRepeat = 2201,
  36927. Ci.LoopPingPong = 2202,
  36928. Ci.InterpolateDiscrete = 2300,
  36929. Ci.InterpolateLinear = 2301,
  36930. Ci.InterpolateSmooth = 2302,
  36931. Ci.ZeroCurvatureEnding = 2400,
  36932. Ci.ZeroSlopeEnding = 2401,
  36933. Ci.WrapAroundEnding = 2402,
  36934. Ci.TrianglesDrawMode = 0,
  36935. Ci.TriangleStripDrawMode = 1,
  36936. Ci.TriangleFanDrawMode = 2,
  36937. Ci.LinearEncoding = 3e3,
  36938. Ci.sRGBEncoding = 3001,
  36939. Ci.GammaEncoding = 3007,
  36940. Ci.RGBEEncoding = 3002,
  36941. Ci.LogLuvEncoding = 3003,
  36942. Ci.RGBM7Encoding = 3004,
  36943. Ci.RGBM16Encoding = 3005,
  36944. Ci.RGBDEncoding = 3006,
  36945. Ci.Color = function(e) {
  36946. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36947. }
  36948. ,
  36949. Ci.Color.prototype = {
  36950. constructor: Ci.Color,
  36951. r: 1,
  36952. g: 1,
  36953. b: 1,
  36954. set: function(e) {
  36955. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36956. this
  36957. },
  36958. setScalar: function(e) {
  36959. this.r = e,
  36960. this.g = e,
  36961. this.b = e
  36962. },
  36963. setHex: function(e) {
  36964. return e = Math.floor(e),
  36965. this.r = (e >> 16 & 255) / 255,
  36966. this.g = (e >> 8 & 255) / 255,
  36967. this.b = (255 & e) / 255,
  36968. this
  36969. },
  36970. setRGB: function(e, t, i) {
  36971. return this.r = e,
  36972. this.g = t,
  36973. this.b = i,
  36974. this
  36975. },
  36976. setHSL: function(e, t, i) {
  36977. if (e = Ci.Math.euclideanModulo(e, 1),
  36978. t = Ci.Math.clamp(t, 0, 1),
  36979. i = Ci.Math.clamp(i, 0, 1),
  36980. 0 === t)
  36981. this.r = this.g = this.b = i;
  36982. else {
  36983. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36984. , r = 2 * i - n;
  36985. this.r = _i(r, n, e + 1 / 3),
  36986. this.g = _i(r, n, e),
  36987. this.b = _i(r, n, e - 1 / 3)
  36988. }
  36989. return this
  36990. },
  36991. setStyle: function(t) {
  36992. function e(e) {
  36993. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36994. }
  36995. var i;
  36996. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36997. var n, r = i[1], o = i[2];
  36998. switch (r) {
  36999. case "rgb":
  37000. case "rgba":
  37001. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37002. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37003. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37004. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37005. e(n[5]),
  37006. this;
  37007. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37008. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37009. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37010. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37011. e(n[5]),
  37012. this;
  37013. break;
  37014. case "hsl":
  37015. case "hsla":
  37016. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37017. var a = parseFloat(n[1]) / 360
  37018. , s = parseInt(n[2], 10) / 100
  37019. , l = parseInt(n[3], 10) / 100;
  37020. return e(n[5]),
  37021. this.setHSL(a, s, l)
  37022. }
  37023. }
  37024. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37025. var c, h = (c = i[1]).length;
  37026. if (3 === h)
  37027. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37028. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37029. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37030. this;
  37031. if (6 === h)
  37032. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37033. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37034. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37035. this
  37036. }
  37037. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37038. return this
  37039. },
  37040. clone: function() {
  37041. return new this.constructor(this.r,this.g,this.b)
  37042. },
  37043. copy: function(e) {
  37044. return this.r = e.r,
  37045. this.g = e.g,
  37046. this.b = e.b,
  37047. this
  37048. },
  37049. copyGammaToLinear: function(e, t) {
  37050. return void 0 === t && (t = 2),
  37051. this.r = Math.pow(e.r, t),
  37052. this.g = Math.pow(e.g, t),
  37053. this.b = Math.pow(e.b, t),
  37054. this
  37055. },
  37056. copyLinearToGamma: function(e, t) {
  37057. void 0 === t && (t = 2);
  37058. var i = 0 < t ? 1 / t : 1;
  37059. return this.r = Math.pow(e.r, i),
  37060. this.g = Math.pow(e.g, i),
  37061. this.b = Math.pow(e.b, i),
  37062. this
  37063. },
  37064. convertGammaToLinear: function() {
  37065. var e = this.r
  37066. , t = this.g
  37067. , i = this.b;
  37068. return this.r = e * e,
  37069. this.g = t * t,
  37070. this.b = i * i,
  37071. this
  37072. },
  37073. convertLinearToGamma: function() {
  37074. return this.r = Math.sqrt(this.r),
  37075. this.g = Math.sqrt(this.g),
  37076. this.b = Math.sqrt(this.b),
  37077. this
  37078. },
  37079. getHex: function() {
  37080. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37081. },
  37082. getHexString: function() {
  37083. return ("000000" + this.getHex().toString(16)).slice(-6)
  37084. },
  37085. getHSL: function(e) {
  37086. var t, i, n = e || {
  37087. h: 0,
  37088. s: 0,
  37089. l: 0
  37090. }, 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;
  37091. if (l === s)
  37092. i = t = 0;
  37093. else {
  37094. var h = s - l;
  37095. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37096. s) {
  37097. case r:
  37098. t = (o - a) / h + (o < a ? 6 : 0);
  37099. break;
  37100. case o:
  37101. t = (a - r) / h + 2;
  37102. break;
  37103. case a:
  37104. t = (r - o) / h + 4
  37105. }
  37106. t /= 6
  37107. }
  37108. return n.h = t,
  37109. n.s = i,
  37110. n.l = c,
  37111. n
  37112. },
  37113. getStyle: function() {
  37114. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37115. },
  37116. offsetHSL: function(e, t, i) {
  37117. var n = this.getHSL();
  37118. return n.h += e,
  37119. n.s += t,
  37120. n.l += i,
  37121. this.setHSL(n.h, n.s, n.l),
  37122. this
  37123. },
  37124. add: function(e) {
  37125. return this.r += e.r,
  37126. this.g += e.g,
  37127. this.b += e.b,
  37128. this
  37129. },
  37130. addColors: function(e, t) {
  37131. return this.r = e.r + t.r,
  37132. this.g = e.g + t.g,
  37133. this.b = e.b + t.b,
  37134. this
  37135. },
  37136. addScalar: function(e) {
  37137. return this.r += e,
  37138. this.g += e,
  37139. this.b += e,
  37140. this
  37141. },
  37142. multiply: function(e) {
  37143. return this.r *= e.r,
  37144. this.g *= e.g,
  37145. this.b *= e.b,
  37146. this
  37147. },
  37148. multiplyScalar: function(e) {
  37149. return this.r *= e,
  37150. this.g *= e,
  37151. this.b *= e,
  37152. this
  37153. },
  37154. lerp: function(e, t) {
  37155. return this.r += (e.r - this.r) * t,
  37156. this.g += (e.g - this.g) * t,
  37157. this.b += (e.b - this.b) * t,
  37158. this
  37159. },
  37160. equals: function(e) {
  37161. return e.r === this.r && e.g === this.g && e.b === this.b
  37162. },
  37163. fromArray: function(e, t) {
  37164. return void 0 === t && (t = 0),
  37165. this.r = e[t],
  37166. this.g = e[t + 1],
  37167. this.b = e[t + 2],
  37168. this
  37169. },
  37170. toArray: function(e, t) {
  37171. return void 0 === e && (e = []),
  37172. void 0 === t && (t = 0),
  37173. e[t] = this.r,
  37174. e[t + 1] = this.g,
  37175. e[t + 2] = this.b,
  37176. e
  37177. }
  37178. },
  37179. Ci.ColorKeywords = {
  37180. aliceblue: 15792383,
  37181. antiquewhite: 16444375,
  37182. aqua: 65535,
  37183. aquamarine: 8388564,
  37184. azure: 15794175,
  37185. beige: 16119260,
  37186. bisque: 16770244,
  37187. black: 0,
  37188. blanchedalmond: 16772045,
  37189. blue: 255,
  37190. blueviolet: 9055202,
  37191. brown: 10824234,
  37192. burlywood: 14596231,
  37193. cadetblue: 6266528,
  37194. chartreuse: 8388352,
  37195. chocolate: 13789470,
  37196. coral: 16744272,
  37197. cornflowerblue: 6591981,
  37198. cornsilk: 16775388,
  37199. crimson: 14423100,
  37200. cyan: 65535,
  37201. darkblue: 139,
  37202. darkcyan: 35723,
  37203. darkgoldenrod: 12092939,
  37204. darkgray: 11119017,
  37205. darkgreen: 25600,
  37206. darkgrey: 11119017,
  37207. darkkhaki: 12433259,
  37208. darkmagenta: 9109643,
  37209. darkolivegreen: 5597999,
  37210. darkorange: 16747520,
  37211. darkorchid: 10040012,
  37212. darkred: 9109504,
  37213. darksalmon: 15308410,
  37214. darkseagreen: 9419919,
  37215. darkslateblue: 4734347,
  37216. darkslategray: 3100495,
  37217. darkslategrey: 3100495,
  37218. darkturquoise: 52945,
  37219. darkviolet: 9699539,
  37220. deeppink: 16716947,
  37221. deepskyblue: 49151,
  37222. dimgray: 6908265,
  37223. dimgrey: 6908265,
  37224. dodgerblue: 2003199,
  37225. firebrick: 11674146,
  37226. floralwhite: 16775920,
  37227. forestgreen: 2263842,
  37228. fuchsia: 16711935,
  37229. gainsboro: 14474460,
  37230. ghostwhite: 16316671,
  37231. gold: 16766720,
  37232. goldenrod: 14329120,
  37233. gray: 8421504,
  37234. green: 32768,
  37235. greenyellow: 11403055,
  37236. grey: 8421504,
  37237. honeydew: 15794160,
  37238. hotpink: 16738740,
  37239. indianred: 13458524,
  37240. indigo: 4915330,
  37241. ivory: 16777200,
  37242. khaki: 15787660,
  37243. lavender: 15132410,
  37244. lavenderblush: 16773365,
  37245. lawngreen: 8190976,
  37246. lemonchiffon: 16775885,
  37247. lightblue: 11393254,
  37248. lightcoral: 15761536,
  37249. lightcyan: 14745599,
  37250. lightgoldenrodyellow: 16448210,
  37251. lightgray: 13882323,
  37252. lightgreen: 9498256,
  37253. lightgrey: 13882323,
  37254. lightpink: 16758465,
  37255. lightsalmon: 16752762,
  37256. lightseagreen: 2142890,
  37257. lightskyblue: 8900346,
  37258. lightslategray: 7833753,
  37259. lightslategrey: 7833753,
  37260. lightsteelblue: 11584734,
  37261. lightyellow: 16777184,
  37262. lime: 65280,
  37263. limegreen: 3329330,
  37264. linen: 16445670,
  37265. magenta: 16711935,
  37266. maroon: 8388608,
  37267. mediumaquamarine: 6737322,
  37268. mediumblue: 205,
  37269. mediumorchid: 12211667,
  37270. mediumpurple: 9662683,
  37271. mediumseagreen: 3978097,
  37272. mediumslateblue: 8087790,
  37273. mediumspringgreen: 64154,
  37274. mediumturquoise: 4772300,
  37275. mediumvioletred: 13047173,
  37276. midnightblue: 1644912,
  37277. mintcream: 16121850,
  37278. mistyrose: 16770273,
  37279. moccasin: 16770229,
  37280. navajowhite: 16768685,
  37281. navy: 128,
  37282. oldlace: 16643558,
  37283. olive: 8421376,
  37284. olivedrab: 7048739,
  37285. orange: 16753920,
  37286. orangered: 16729344,
  37287. orchid: 14315734,
  37288. palegoldenrod: 15657130,
  37289. palegreen: 10025880,
  37290. paleturquoise: 11529966,
  37291. palevioletred: 14381203,
  37292. papayawhip: 16773077,
  37293. peachpuff: 16767673,
  37294. peru: 13468991,
  37295. pink: 16761035,
  37296. plum: 14524637,
  37297. powderblue: 11591910,
  37298. purple: 8388736,
  37299. red: 16711680,
  37300. rosybrown: 12357519,
  37301. royalblue: 4286945,
  37302. saddlebrown: 9127187,
  37303. salmon: 16416882,
  37304. sandybrown: 16032864,
  37305. seagreen: 3050327,
  37306. seashell: 16774638,
  37307. sienna: 10506797,
  37308. silver: 12632256,
  37309. skyblue: 8900331,
  37310. slateblue: 6970061,
  37311. slategray: 7372944,
  37312. slategrey: 7372944,
  37313. snow: 16775930,
  37314. springgreen: 65407,
  37315. steelblue: 4620980,
  37316. tan: 13808780,
  37317. teal: 32896,
  37318. thistle: 14204888,
  37319. tomato: 16737095,
  37320. turquoise: 4251856,
  37321. violet: 15631086,
  37322. wheat: 16113331,
  37323. white: 16777215,
  37324. whitesmoke: 16119285,
  37325. yellow: 16776960,
  37326. yellowgreen: 10145074
  37327. },
  37328. Ci.Quaternion = function(e, t, i, n) {
  37329. this._x = e || 0,
  37330. this._y = t || 0,
  37331. this._z = i || 0,
  37332. this._w = void 0 !== n ? n : 1
  37333. }
  37334. ,
  37335. Ci.Quaternion.prototype = {
  37336. constructor: Ci.Quaternion,
  37337. get x() {
  37338. return this._x
  37339. },
  37340. set x(e) {
  37341. this._x = e,
  37342. this.onChangeCallback()
  37343. },
  37344. get y() {
  37345. return this._y
  37346. },
  37347. set y(e) {
  37348. this._y = e,
  37349. this.onChangeCallback()
  37350. },
  37351. get z() {
  37352. return this._z
  37353. },
  37354. set z(e) {
  37355. this._z = e,
  37356. this.onChangeCallback()
  37357. },
  37358. get w() {
  37359. return this._w
  37360. },
  37361. set w(e) {
  37362. this._w = e,
  37363. this.onChangeCallback()
  37364. },
  37365. set: function(e, t, i, n) {
  37366. return this._x = e,
  37367. this._y = t,
  37368. this._z = i,
  37369. this._w = n,
  37370. this.onChangeCallback(),
  37371. this
  37372. },
  37373. clone: function() {
  37374. return new this.constructor(this._x,this._y,this._z,this._w)
  37375. },
  37376. toObject:function(){//add
  37377. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37378. },
  37379. copy: function(e) {
  37380. return this._x = e.x,
  37381. this._y = e.y,
  37382. this._z = e.z,
  37383. this._w = e.w,
  37384. this.onChangeCallback(),
  37385. this
  37386. },
  37387. setFromEuler: function(e, t) {
  37388. if (e instanceof Ci.Euler == 0)
  37389. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37390. var i = Math.cos(e._x / 2)
  37391. , n = Math.cos(e._y / 2)
  37392. , r = Math.cos(e._z / 2)
  37393. , o = Math.sin(e._x / 2)
  37394. , a = Math.sin(e._y / 2)
  37395. , s = Math.sin(e._z / 2)
  37396. , l = e.order;
  37397. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37398. this._y = i * a * r - o * n * s,
  37399. this._z = i * n * s + o * a * r,
  37400. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37401. this._y = i * a * r - o * n * s,
  37402. this._z = i * n * s - o * a * r,
  37403. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37404. this._y = i * a * r + o * n * s,
  37405. this._z = i * n * s + o * a * r,
  37406. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37407. this._y = i * a * r + o * n * s,
  37408. this._z = i * n * s - o * a * r,
  37409. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37410. this._y = i * a * r + o * n * s,
  37411. this._z = i * n * s - o * a * r,
  37412. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37413. this._y = i * a * r - o * n * s,
  37414. this._z = i * n * s + o * a * r,
  37415. this._w = i * n * r + o * a * s),
  37416. !1 !== t && this.onChangeCallback(),
  37417. this
  37418. },
  37419. setFromAxisAngle: function(e, t) {
  37420. var i = t / 2
  37421. , n = Math.sin(i);
  37422. return this._x = e.x * n,
  37423. this._y = e.y * n,
  37424. this._z = e.z * n,
  37425. this._w = Math.cos(i),
  37426. this.onChangeCallback(),
  37427. this
  37428. },
  37429. setFromRotationMatrix: function(e) {
  37430. 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;
  37431. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37432. this._w = .25 / t,
  37433. this._x = (h - l) * t,
  37434. this._y = (o - c) * t,
  37435. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37436. this._w = (h - l) / t,
  37437. this._x = .25 * t,
  37438. this._y = (r + a) / t,
  37439. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37440. this._w = (o - c) / t,
  37441. this._x = (r + a) / t,
  37442. this._y = .25 * t,
  37443. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37444. this._w = (a - r) / t,
  37445. this._x = (o + c) / t,
  37446. this._y = (l + h) / t,
  37447. this._z = .25 * t),
  37448. this.onChangeCallback(),
  37449. this
  37450. },
  37451. setFromUnitVectors: function(e, t) {
  37452. return void 0 === Be && (Be = new Ci.Vector3),
  37453. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37454. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  37455. this._x = Be.x,
  37456. this._y = Be.y,
  37457. this._z = Be.z,
  37458. this._w = Ve,
  37459. this.normalize(),
  37460. this
  37461. },
  37462. inverse: function() {
  37463. return this.conjugate().normalize(),
  37464. this
  37465. },
  37466. conjugate: function() {
  37467. return this._x *= -1,
  37468. this._y *= -1,
  37469. this._z *= -1,
  37470. this.onChangeCallback(),
  37471. this
  37472. },
  37473. dot: function(e) {
  37474. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37475. },
  37476. lengthSq: function() {
  37477. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37478. },
  37479. length: function() {
  37480. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37481. },
  37482. normalize: function() {
  37483. var e = this.length();
  37484. return 0 === e ? (this._x = 0,
  37485. this._y = 0,
  37486. this._z = 0,
  37487. this._w = 1) : (e = 1 / e,
  37488. this._x = this._x * e,
  37489. this._y = this._y * e,
  37490. this._z = this._z * e,
  37491. this._w = this._w * e),
  37492. this.onChangeCallback(),
  37493. this
  37494. },
  37495. multiply: function(e, t) {
  37496. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37497. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37498. },
  37499. multiplyQuaternions: function(e, t) {
  37500. var i = e._x
  37501. , n = e._y
  37502. , r = e._z
  37503. , o = e._w
  37504. , a = t._x
  37505. , s = t._y
  37506. , l = t._z
  37507. , c = t._w;
  37508. return this._x = i * c + o * a + n * l - r * s,
  37509. this._y = n * c + o * s + r * a - i * l,
  37510. this._z = r * c + o * l + i * s - n * a,
  37511. this._w = o * c - i * a - n * s - r * l,
  37512. this.onChangeCallback(),
  37513. this
  37514. },
  37515. slerp: function(e, t) {
  37516. if (0 === t)
  37517. return this;
  37518. if (1 === t)
  37519. return this.copy(e);
  37520. var i = this._x
  37521. , n = this._y
  37522. , r = this._z
  37523. , o = this._w
  37524. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37525. if (a < 0 ? (this._w = -e._w,
  37526. this._x = -e._x,
  37527. this._y = -e._y,
  37528. this._z = -e._z,
  37529. a = -a) : this.copy(e),
  37530. 1 <= a)
  37531. return this._w = o,
  37532. this._x = i,
  37533. this._y = n,
  37534. this._z = r,
  37535. this;
  37536. var s = Math.sqrt(1 - a * a);
  37537. if (Math.abs(s) < .001)
  37538. return this._w = .5 * (o + this._w),
  37539. this._x = .5 * (i + this._x),
  37540. this._y = .5 * (n + this._y),
  37541. this._z = .5 * (r + this._z),
  37542. this;
  37543. var l = Math.atan2(s, a)
  37544. , c = Math.sin((1 - t) * l) / s
  37545. , h = Math.sin(t * l) / s;
  37546. return this._w = o * c + this._w * h,
  37547. this._x = i * c + this._x * h,
  37548. this._y = n * c + this._y * h,
  37549. this._z = r * c + this._z * h,
  37550. this.onChangeCallback(),
  37551. this
  37552. },
  37553. equals: function(e) {
  37554. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37555. },
  37556. fromArray: function(e, t) {
  37557. return void 0 === t && (t = 0),
  37558. this._x = e[t],
  37559. this._y = e[t + 1],
  37560. this._z = e[t + 2],
  37561. this._w = e[t + 3],
  37562. this.onChangeCallback(),
  37563. this
  37564. },
  37565. toArray: function(e, t) {
  37566. return void 0 === e && (e = []),
  37567. void 0 === t && (t = 0),
  37568. e[t] = this._x,
  37569. e[t + 1] = this._y,
  37570. e[t + 2] = this._z,
  37571. e[t + 3] = this._w,
  37572. e
  37573. },
  37574. onChange: function(e) {
  37575. return this.onChangeCallback = e,
  37576. this
  37577. },
  37578. onChangeCallback: function() {}
  37579. },
  37580. Object.assign(Ci.Quaternion, {
  37581. slerp: function(e, t, i, n) {
  37582. return i.copy(e).slerp(t, n)
  37583. },
  37584. slerpFlat: function(e, t, i, n, r, o, a) {
  37585. var s = i[n + 0]
  37586. , l = i[n + 1]
  37587. , c = i[n + 2]
  37588. , h = i[n + 3]
  37589. , u = r[o + 0]
  37590. , d = r[o + 1]
  37591. , p = r[o + 2]
  37592. , f = r[o + 3];
  37593. if (h !== f || s !== u || l !== d || c !== p) {
  37594. var g = 1 - a
  37595. , m = s * u + l * d + c * p + h * f
  37596. , v = 0 <= m ? 1 : -1
  37597. , y = 1 - m * m;
  37598. if (y > Number.EPSILON) {
  37599. var A = Math.sqrt(y)
  37600. , C = Math.atan2(A, m * v);
  37601. g = Math.sin(g * C) / A,
  37602. a = Math.sin(a * C) / A
  37603. }
  37604. var I = a * v;
  37605. if (s = s * g + u * I,
  37606. l = l * g + d * I,
  37607. c = c * g + p * I,
  37608. h = h * g + f * I,
  37609. g === 1 - a) {
  37610. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37611. s *= E,
  37612. l *= E,
  37613. c *= E,
  37614. h *= E
  37615. }
  37616. }
  37617. e[t] = s,
  37618. e[t + 1] = l,
  37619. e[t + 2] = c,
  37620. e[t + 3] = h
  37621. }
  37622. }),
  37623. Ci.Vector2 = function(e, t) {
  37624. this.x = e || 0,
  37625. this.y = t || 0
  37626. }
  37627. ,
  37628. Ci.Vector2.prototype = {
  37629. constructor: Ci.Vector2,
  37630. get width() {
  37631. return this.x
  37632. },
  37633. set width(e) {
  37634. this.x = e
  37635. },
  37636. get height() {
  37637. return this.y
  37638. },
  37639. set height(e) {
  37640. this.y = e
  37641. },
  37642. set: function(e, t) {
  37643. return this.x = e,
  37644. this.y = t,
  37645. this
  37646. },
  37647. setScalar: function(e) {
  37648. return this.x = e,
  37649. this.y = e,
  37650. this
  37651. },
  37652. setX: function(e) {
  37653. return this.x = e,
  37654. this
  37655. },
  37656. setY: function(e) {
  37657. return this.y = e,
  37658. this
  37659. },
  37660. setComponent: function(e, t) {
  37661. switch (e) {
  37662. case 0:
  37663. this.x = t;
  37664. break;
  37665. case 1:
  37666. this.y = t;
  37667. break;
  37668. default:
  37669. throw new Error("index is out of range: " + e)
  37670. }
  37671. },
  37672. getComponent: function(e) {
  37673. switch (e) {
  37674. case 0:
  37675. return this.x;
  37676. case 1:
  37677. return this.y;
  37678. default:
  37679. throw new Error("index is out of range: " + e)
  37680. }
  37681. },
  37682. clone: function() {
  37683. return new this.constructor(this.x,this.y)
  37684. },
  37685. copy: function(e) {
  37686. return this.x = e.x,
  37687. this.y = e.y,
  37688. this
  37689. },
  37690. add: function(e, t) {
  37691. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37692. this.addVectors(e, t)) : (this.x += e.x,
  37693. this.y += e.y,
  37694. this)
  37695. },
  37696. addScalar: function(e) {
  37697. return this.x += e,
  37698. this.y += e,
  37699. this
  37700. },
  37701. addVectors: function(e, t) {
  37702. return this.x = e.x + t.x,
  37703. this.y = e.y + t.y,
  37704. this
  37705. },
  37706. addScaledVector: function(e, t) {
  37707. return this.x += e.x * t,
  37708. this.y += e.y * t,
  37709. this
  37710. },
  37711. sub: function(e, t) {
  37712. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37713. this.subVectors(e, t)) : (this.x -= e.x,
  37714. this.y -= e.y,
  37715. this)
  37716. },
  37717. subScalar: function(e) {
  37718. return this.x -= e,
  37719. this.y -= e,
  37720. this
  37721. },
  37722. subVectors: function(e, t) {
  37723. return this.x = e.x - t.x,
  37724. this.y = e.y - t.y,
  37725. this
  37726. },
  37727. multiply: function(e) {
  37728. return this.x *= e.x,
  37729. this.y *= e.y,
  37730. this
  37731. },
  37732. multiplyScalar: function(e) {
  37733. return isFinite(e) ? (this.x *= e,
  37734. this.y *= e) : (this.x = 0,
  37735. this.y = 0),
  37736. this
  37737. },
  37738. divide: function(e) {
  37739. return this.x /= e.x,
  37740. this.y /= e.y,
  37741. this
  37742. },
  37743. divideScalar: function(e) {
  37744. return this.multiplyScalar(1 / e)
  37745. },
  37746. min: function(e) {
  37747. return this.x = Math.min(this.x, e.x),
  37748. this.y = Math.min(this.y, e.y),
  37749. this
  37750. },
  37751. max: function(e) {
  37752. return this.x = Math.max(this.x, e.x),
  37753. this.y = Math.max(this.y, e.y),
  37754. this
  37755. },
  37756. clamp: function(e, t) {
  37757. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37758. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37759. this
  37760. },
  37761. clampScalar: function(e, t) {
  37762. return void 0 === Ne && (Ne = new Ci.Vector2,
  37763. Fe = new Ci.Vector2),
  37764. Ne.set(e, e),
  37765. Fe.set(t, t),
  37766. this.clamp(Ne, Fe)
  37767. },
  37768. clampLength: function(e, t) {
  37769. var i = this.length();
  37770. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37771. this
  37772. },
  37773. floor: function() {
  37774. return this.x = Math.floor(this.x),
  37775. this.y = Math.floor(this.y),
  37776. this
  37777. },
  37778. ceil: function() {
  37779. return this.x = Math.ceil(this.x),
  37780. this.y = Math.ceil(this.y),
  37781. this
  37782. },
  37783. round: function() {
  37784. return this.x = Math.round(this.x),
  37785. this.y = Math.round(this.y),
  37786. this
  37787. },
  37788. roundToZero: function() {
  37789. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37790. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37791. this
  37792. },
  37793. negate: function() {
  37794. return this.x = -this.x,
  37795. this.y = -this.y,
  37796. this
  37797. },
  37798. dot: function(e) {
  37799. return this.x * e.x + this.y * e.y
  37800. },
  37801. lengthSq: function() {
  37802. return this.x * this.x + this.y * this.y
  37803. },
  37804. length: function() {
  37805. return Math.sqrt(this.x * this.x + this.y * this.y)
  37806. },
  37807. lengthManhattan: function() {
  37808. return Math.abs(this.x) + Math.abs(this.y)
  37809. },
  37810. normalize: function() {
  37811. return this.divideScalar(this.length())
  37812. },
  37813. angle: function() {
  37814. var e = Math.atan2(this.y, this.x);
  37815. return e < 0 && (e += 2 * Math.PI),
  37816. e
  37817. },
  37818. distanceTo: function(e) {
  37819. return Math.sqrt(this.distanceToSquared(e))
  37820. },
  37821. distanceToSquared: function(e) {
  37822. var t = this.x - e.x
  37823. , i = this.y - e.y;
  37824. return t * t + i * i
  37825. },
  37826. setLength: function(e) {
  37827. return this.multiplyScalar(e / this.length())
  37828. },
  37829. lerp: function(e, t) {
  37830. return this.x += (e.x - this.x) * t,
  37831. this.y += (e.y - this.y) * t,
  37832. this
  37833. },
  37834. lerpVectors: function(e, t, i) {
  37835. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37836. this
  37837. },
  37838. equals: function(e) {
  37839. return e.x === this.x && e.y === this.y
  37840. },
  37841. fromArray: function(e, t) {
  37842. return void 0 === t && (t = 0),
  37843. this.x = e[t],
  37844. this.y = e[t + 1],
  37845. this
  37846. },
  37847. toArray: function(e, t) {
  37848. return void 0 === e && (e = []),
  37849. void 0 === t && (t = 0),
  37850. e[t] = this.x,
  37851. e[t + 1] = this.y,
  37852. e
  37853. },
  37854. fromAttribute: function(e, t, i) {
  37855. return void 0 === i && (i = 0),
  37856. t = t * e.itemSize + i,
  37857. this.x = e.array[t],
  37858. this.y = e.array[t + 1],
  37859. this
  37860. },
  37861. rotateAround: function(e, t) {
  37862. var i = Math.cos(t)
  37863. , n = Math.sin(t)
  37864. , r = this.x - e.x
  37865. , o = this.y - e.y;
  37866. return this.x = r * i - o * n + e.x,
  37867. this.y = r * n + o * i + e.y,
  37868. this
  37869. }
  37870. },
  37871. Ci.Vector3 = function(e, t, i) {
  37872. this.x = e || 0,
  37873. this.y = t || 0,
  37874. this.z = i || 0
  37875. }
  37876. ,
  37877. Ci.Vector3.prototype = {
  37878. constructor: Ci.Vector3,
  37879. set: function(e, t, i) {
  37880. return this.x = e,
  37881. this.y = t,
  37882. this.z = i,
  37883. this
  37884. },
  37885. setScalar: function(e) {
  37886. return this.x = e,
  37887. this.y = e,
  37888. this.z = e,
  37889. this
  37890. },
  37891. setX: function(e) {
  37892. return this.x = e,
  37893. this
  37894. },
  37895. setY: function(e) {
  37896. return this.y = e,
  37897. this
  37898. },
  37899. setZ: function(e) {
  37900. return this.z = e,
  37901. this
  37902. },
  37903. setComponent: function(e, t) {
  37904. switch (e) {
  37905. case 0:
  37906. this.x = t;
  37907. break;
  37908. case 1:
  37909. this.y = t;
  37910. break;
  37911. case 2:
  37912. this.z = t;
  37913. break;
  37914. default:
  37915. throw new Error("index is out of range: " + e)
  37916. }
  37917. },
  37918. getComponent: function(e) {
  37919. switch (e) {
  37920. case 0:
  37921. return this.x;
  37922. case 1:
  37923. return this.y;
  37924. case 2:
  37925. return this.z;
  37926. default:
  37927. throw new Error("index is out of range: " + e)
  37928. }
  37929. },
  37930. clone: function() {
  37931. return new this.constructor(this.x,this.y,this.z)
  37932. },
  37933. copy: function(e) {
  37934. return this.x = e.x,
  37935. this.y = e.y,
  37936. this.z = e.z,
  37937. this
  37938. },
  37939. add: function(e, t) {
  37940. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37941. this.addVectors(e, t)) : (this.x += e.x,
  37942. this.y += e.y,
  37943. this.z += e.z,
  37944. this)
  37945. },
  37946. addScalar: function(e) {
  37947. return this.x += e,
  37948. this.y += e,
  37949. this.z += e,
  37950. this
  37951. },
  37952. addVectors: function(e, t) {
  37953. return this.x = e.x + t.x,
  37954. this.y = e.y + t.y,
  37955. this.z = e.z + t.z,
  37956. this
  37957. },
  37958. addScaledVector: function(e, t) {
  37959. return this.x += e.x * t,
  37960. this.y += e.y * t,
  37961. this.z += e.z * t,
  37962. this
  37963. },
  37964. sub: function(e, t) {
  37965. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37966. this.subVectors(e, t)) : (this.x -= e.x,
  37967. this.y -= e.y,
  37968. this.z -= e.z,
  37969. this)
  37970. },
  37971. subScalar: function(e) {
  37972. return this.x -= e,
  37973. this.y -= e,
  37974. this.z -= e,
  37975. this
  37976. },
  37977. subVectors: function(e, t) {
  37978. return this.x = e.x - t.x,
  37979. this.y = e.y - t.y,
  37980. this.z = e.z - t.z,
  37981. this
  37982. },
  37983. multiply: function(e, t) {
  37984. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37985. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37986. this.y *= e.y,
  37987. this.z *= e.z,
  37988. this)
  37989. },
  37990. multiplyScalar: function(e) {
  37991. return isFinite(e) ? (this.x *= e,
  37992. this.y *= e,
  37993. this.z *= e) : (this.x = 0,
  37994. this.y = 0,
  37995. this.z = 0),
  37996. this
  37997. },
  37998. multiplyVectors: function(e, t) {
  37999. return this.x = e.x * t.x,
  38000. this.y = e.y * t.y,
  38001. this.z = e.z * t.z,
  38002. this
  38003. },
  38004. applyEuler: function(e) {
  38005. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38006. void 0 === De && (De = new Ci.Quaternion),
  38007. this.applyQuaternion(De.setFromEuler(e)),
  38008. this
  38009. },
  38010. applyAxisAngle: function(e, t) {
  38011. return void 0 === Le && (Le = new Ci.Quaternion),
  38012. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38013. this
  38014. },
  38015. applyMatrix3: function(e) {
  38016. var t = this.x
  38017. , i = this.y
  38018. , n = this.z
  38019. , r = e.elements;
  38020. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38021. this.y = r[1] * t + r[4] * i + r[7] * n,
  38022. this.z = r[2] * t + r[5] * i + r[8] * n,
  38023. this
  38024. },
  38025. applyMatrix4: function(e) {
  38026. var t = this.x
  38027. , i = this.y
  38028. , n = this.z
  38029. , r = e.elements;
  38030. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38031. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38032. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38033. this
  38034. },
  38035. applyProjection: function(e) {
  38036. var t = this.x
  38037. , i = this.y
  38038. , n = this.z
  38039. , r = e.elements
  38040. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38041. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38042. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38043. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38044. this
  38045. },
  38046. applyQuaternion: function(e) {
  38047. var t = this.x
  38048. , i = this.y
  38049. , n = this.z
  38050. , r = e.x
  38051. , o = e.y
  38052. , a = e.z
  38053. , s = e.w
  38054. , l = s * t + o * n - a * i
  38055. , c = s * i + a * t - r * n
  38056. , h = s * n + r * i - o * t
  38057. , u = -r * t - o * i - a * n;
  38058. return this.x = l * s + u * -r + c * -a - h * -o,
  38059. this.y = c * s + u * -o + h * -r - l * -a,
  38060. this.z = h * s + u * -a + l * -o - c * -r,
  38061. this
  38062. },
  38063. project: function(e) {
  38064. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38065. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38066. this.applyProjection(Oe)
  38067. },
  38068. unproject: function(e) {
  38069. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38070. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38071. this.applyProjection(Pe)
  38072. },
  38073. transformDirection: function(e) {
  38074. var t = this.x
  38075. , i = this.y
  38076. , n = this.z
  38077. , r = e.elements;
  38078. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38079. this.y = r[1] * t + r[5] * i + r[9] * n,
  38080. this.z = r[2] * t + r[6] * i + r[10] * n,
  38081. this.normalize(),
  38082. this
  38083. },
  38084. divide: function(e) {
  38085. return this.x /= e.x,
  38086. this.y /= e.y,
  38087. this.z /= e.z,
  38088. this
  38089. },
  38090. divideScalar: function(e) {
  38091. return this.multiplyScalar(1 / e)
  38092. },
  38093. min: function(e) {
  38094. return this.x = Math.min(this.x, e.x),
  38095. this.y = Math.min(this.y, e.y),
  38096. this.z = Math.min(this.z, e.z),
  38097. this
  38098. },
  38099. max: function(e) {
  38100. return this.x = Math.max(this.x, e.x),
  38101. this.y = Math.max(this.y, e.y),
  38102. this.z = Math.max(this.z, e.z),
  38103. this
  38104. },
  38105. clamp: function(e, t) {
  38106. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38107. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38108. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38109. this
  38110. },
  38111. clampScalar: function(e, t) {
  38112. return void 0 === Me && (Me = new Ci.Vector3,
  38113. Re = new Ci.Vector3),
  38114. Me.set(e, e, e),
  38115. Re.set(t, t, t),
  38116. this.clamp(Me, Re)
  38117. },
  38118. clampLength: function(e, t) {
  38119. var i = this.length();
  38120. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38121. this
  38122. },
  38123. floor: function() {
  38124. return this.x = Math.floor(this.x),
  38125. this.y = Math.floor(this.y),
  38126. this.z = Math.floor(this.z),
  38127. this
  38128. },
  38129. ceil: function() {
  38130. return this.x = Math.ceil(this.x),
  38131. this.y = Math.ceil(this.y),
  38132. this.z = Math.ceil(this.z),
  38133. this
  38134. },
  38135. round: function() {
  38136. return this.x = Math.round(this.x),
  38137. this.y = Math.round(this.y),
  38138. this.z = Math.round(this.z),
  38139. this
  38140. },
  38141. roundToZero: function() {
  38142. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38143. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38144. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38145. this
  38146. },
  38147. negate: function() {
  38148. return this.x = -this.x,
  38149. this.y = -this.y,
  38150. this.z = -this.z,
  38151. this
  38152. },
  38153. dot: function(e) {
  38154. return this.x * e.x + this.y * e.y + this.z * e.z
  38155. },
  38156. lengthSq: function() {
  38157. return this.x * this.x + this.y * this.y + this.z * this.z
  38158. },
  38159. length: function() {
  38160. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38161. },
  38162. lengthManhattan: function() {
  38163. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38164. },
  38165. normalize: function() {
  38166. return this.divideScalar(this.length())
  38167. },
  38168. setLength: function(e) {
  38169. return this.multiplyScalar(e / this.length())
  38170. },
  38171. lerp: function(e, t) {
  38172. return this.x += (e.x - this.x) * t,
  38173. this.y += (e.y - this.y) * t,
  38174. this.z += (e.z - this.z) * t,
  38175. this
  38176. },
  38177. lerpVectors: function(e, t, i) {
  38178. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38179. this
  38180. },
  38181. cross: function(e, t) {
  38182. if (void 0 !== t)
  38183. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38184. this.crossVectors(e, t);
  38185. var i = this.x
  38186. , n = this.y
  38187. , r = this.z;
  38188. return this.x = n * e.z - r * e.y,
  38189. this.y = r * e.x - i * e.z,
  38190. this.z = i * e.y - n * e.x,
  38191. this
  38192. },
  38193. crossVectors: function(e, t) {
  38194. var i = e.x
  38195. , n = e.y
  38196. , r = e.z
  38197. , o = t.x
  38198. , a = t.y
  38199. , s = t.z;
  38200. return this.x = n * s - r * a,
  38201. this.y = r * o - i * s,
  38202. this.z = i * a - n * o,
  38203. this
  38204. },
  38205. projectOnVector: function(e) {
  38206. return void 0 === xe && (xe = new Ci.Vector3),
  38207. xe.copy(e).normalize(),
  38208. Se = this.dot(xe),
  38209. this.copy(xe).multiplyScalar(Se)
  38210. },
  38211. projectOnPlane: function(e) {
  38212. return void 0 === Te && (Te = new Ci.Vector3),
  38213. Te.copy(this).projectOnVector(e),
  38214. this.sub(Te)
  38215. },
  38216. reflect: function(e) {
  38217. return void 0 === we && (we = new Ci.Vector3),
  38218. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38219. },
  38220. angleTo: function(e) {
  38221. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38222. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38223. },
  38224. distanceTo: function(e) {
  38225. return Math.sqrt(this.distanceToSquared(e))
  38226. },
  38227. distanceToSquared: function(e) {
  38228. var t = this.x - e.x
  38229. , i = this.y - e.y
  38230. , n = this.z - e.z;
  38231. return t * t + i * i + n * n
  38232. },
  38233. setFromSpherical: function(e) {
  38234. var t = Math.sin(e.phi) * e.radius;
  38235. return this.x = t * Math.sin(e.theta),
  38236. this.y = Math.cos(e.phi) * e.radius,
  38237. this.z = t * Math.cos(e.theta),
  38238. this
  38239. },
  38240. setFromMatrixPosition: function(e) {
  38241. return this.setFromMatrixColumn(e, 3)
  38242. },
  38243. setFromMatrixScale: function(e) {
  38244. var t = this.setFromMatrixColumn(e, 0).length()
  38245. , i = this.setFromMatrixColumn(e, 1).length()
  38246. , n = this.setFromMatrixColumn(e, 2).length();
  38247. return this.x = t,
  38248. this.y = i,
  38249. this.z = n,
  38250. this
  38251. },
  38252. setFromMatrixColumn: function(e, t) {
  38253. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38254. t = e = t),
  38255. this.fromArray(e.elements, 4 * t)
  38256. },
  38257. equals: function(e) {
  38258. return e.x === this.x && e.y === this.y && e.z === this.z
  38259. },
  38260. fromArray: function(e, t) {
  38261. return void 0 === t && (t = 0),
  38262. this.x = e[t],
  38263. this.y = e[t + 1],
  38264. this.z = e[t + 2],
  38265. this
  38266. },
  38267. toArray: function(e, t) {
  38268. return void 0 === e && (e = []),
  38269. void 0 === t && (t = 0),
  38270. e[t] = this.x,
  38271. e[t + 1] = this.y,
  38272. e[t + 2] = this.z,
  38273. e
  38274. },
  38275. fromAttribute: function(e, t, i) {
  38276. return void 0 === i && (i = 0),
  38277. t = t * e.itemSize + i,
  38278. this.x = e.array[t],
  38279. this.y = e.array[t + 1],
  38280. this.z = e.array[t + 2],
  38281. this
  38282. }
  38283. },
  38284. Ci.Vector4 = function(e, t, i, n) {
  38285. this.x = e || 0,
  38286. this.y = t || 0,
  38287. this.z = i || 0,
  38288. this.w = void 0 !== n ? n : 1
  38289. }
  38290. ,
  38291. Ci.Vector4.prototype = {
  38292. constructor: Ci.Vector4,
  38293. set: function(e, t, i, n) {
  38294. return this.x = e,
  38295. this.y = t,
  38296. this.z = i,
  38297. this.w = n,
  38298. this
  38299. },
  38300. setScalar: function(e) {
  38301. return this.x = e,
  38302. this.y = e,
  38303. this.z = e,
  38304. this.w = e,
  38305. this
  38306. },
  38307. setX: function(e) {
  38308. return this.x = e,
  38309. this
  38310. },
  38311. setY: function(e) {
  38312. return this.y = e,
  38313. this
  38314. },
  38315. setZ: function(e) {
  38316. return this.z = e,
  38317. this
  38318. },
  38319. setW: function(e) {
  38320. return this.w = e,
  38321. this
  38322. },
  38323. setComponent: function(e, t) {
  38324. switch (e) {
  38325. case 0:
  38326. this.x = t;
  38327. break;
  38328. case 1:
  38329. this.y = t;
  38330. break;
  38331. case 2:
  38332. this.z = t;
  38333. break;
  38334. case 3:
  38335. this.w = t;
  38336. break;
  38337. default:
  38338. throw new Error("index is out of range: " + e)
  38339. }
  38340. },
  38341. getComponent: function(e) {
  38342. switch (e) {
  38343. case 0:
  38344. return this.x;
  38345. case 1:
  38346. return this.y;
  38347. case 2:
  38348. return this.z;
  38349. case 3:
  38350. return this.w;
  38351. default:
  38352. throw new Error("index is out of range: " + e)
  38353. }
  38354. },
  38355. clone: function() {
  38356. return new this.constructor(this.x,this.y,this.z,this.w)
  38357. },
  38358. copy: function(e) {
  38359. return this.x = e.x,
  38360. this.y = e.y,
  38361. this.z = e.z,
  38362. this.w = void 0 !== e.w ? e.w : 1,
  38363. this
  38364. },
  38365. add: function(e, t) {
  38366. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38367. this.addVectors(e, t)) : (this.x += e.x,
  38368. this.y += e.y,
  38369. this.z += e.z,
  38370. this.w += e.w,
  38371. this)
  38372. },
  38373. addScalar: function(e) {
  38374. return this.x += e,
  38375. this.y += e,
  38376. this.z += e,
  38377. this.w += e,
  38378. this
  38379. },
  38380. addVectors: function(e, t) {
  38381. return this.x = e.x + t.x,
  38382. this.y = e.y + t.y,
  38383. this.z = e.z + t.z,
  38384. this.w = e.w + t.w,
  38385. this
  38386. },
  38387. addScaledVector: function(e, t) {
  38388. return this.x += e.x * t,
  38389. this.y += e.y * t,
  38390. this.z += e.z * t,
  38391. this.w += e.w * t,
  38392. this
  38393. },
  38394. sub: function(e, t) {
  38395. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38396. this.subVectors(e, t)) : (this.x -= e.x,
  38397. this.y -= e.y,
  38398. this.z -= e.z,
  38399. this.w -= e.w,
  38400. this)
  38401. },
  38402. subScalar: function(e) {
  38403. return this.x -= e,
  38404. this.y -= e,
  38405. this.z -= e,
  38406. this.w -= e,
  38407. this
  38408. },
  38409. subVectors: function(e, t) {
  38410. return this.x = e.x - t.x,
  38411. this.y = e.y - t.y,
  38412. this.z = e.z - t.z,
  38413. this.w = e.w - t.w,
  38414. this
  38415. },
  38416. multiplyScalar: function(e) {
  38417. return isFinite(e) ? (this.x *= e,
  38418. this.y *= e,
  38419. this.z *= e,
  38420. this.w *= e) : (this.x = 0,
  38421. this.y = 0,
  38422. this.z = 0,
  38423. this.w = 0),
  38424. this
  38425. },
  38426. applyMatrix4: function(e) {
  38427. var t = this.x
  38428. , i = this.y
  38429. , n = this.z
  38430. , r = this.w
  38431. , o = e.elements;
  38432. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38433. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38434. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38435. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38436. this
  38437. },
  38438. divideScalar: function(e) {
  38439. return this.multiplyScalar(1 / e)
  38440. },
  38441. setAxisAngleFromQuaternion: function(e) {
  38442. this.w = 2 * Math.acos(e.w);
  38443. var t = Math.sqrt(1 - e.w * e.w);
  38444. return t < 1e-4 ? (this.x = 1,
  38445. this.y = 0,
  38446. this.z = 0) : (this.x = e.x / t,
  38447. this.y = e.y / t,
  38448. this.z = e.z / t),
  38449. this
  38450. },
  38451. setAxisAngleFromRotationMatrix: function(e) {
  38452. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  38453. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38454. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38455. return this.set(1, 0, 0, 0),
  38456. this;
  38457. t = Math.PI;
  38458. var g = (a + 1) / 2
  38459. , m = (h + 1) / 2
  38460. , v = (f + 1) / 2
  38461. , y = (s + c) / 4
  38462. , A = (l + d) / 4
  38463. , C = (u + p) / 4;
  38464. return m < g && v < g ? r = g < .01 ? (i = 0,
  38465. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38466. A / i) : v < m ? r = m < .01 ? (n = 0,
  38467. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38468. C / n) : v < .01 ? (n = i = .707106781,
  38469. r = 0) : (i = A / (r = Math.sqrt(v)),
  38470. n = C / r),
  38471. this.set(i, n, r, t),
  38472. this
  38473. }
  38474. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38475. return Math.abs(I) < .001 && (I = 1),
  38476. this.x = (p - u) / I,
  38477. this.y = (l - d) / I,
  38478. this.z = (c - s) / I,
  38479. this.w = Math.acos((a + h + f - 1) / 2),
  38480. this
  38481. },
  38482. min: function(e) {
  38483. return this.x = Math.min(this.x, e.x),
  38484. this.y = Math.min(this.y, e.y),
  38485. this.z = Math.min(this.z, e.z),
  38486. this.w = Math.min(this.w, e.w),
  38487. this
  38488. },
  38489. max: function(e) {
  38490. return this.x = Math.max(this.x, e.x),
  38491. this.y = Math.max(this.y, e.y),
  38492. this.z = Math.max(this.z, e.z),
  38493. this.w = Math.max(this.w, e.w),
  38494. this
  38495. },
  38496. clamp: function(e, t) {
  38497. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38498. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38499. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38500. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38501. this
  38502. },
  38503. clampScalar: function(e, t) {
  38504. return void 0 === _e && (_e = new Ci.Vector4,
  38505. be = new Ci.Vector4),
  38506. _e.set(e, e, e, e),
  38507. be.set(t, t, t, t),
  38508. this.clamp(_e, be)
  38509. },
  38510. floor: function() {
  38511. return this.x = Math.floor(this.x),
  38512. this.y = Math.floor(this.y),
  38513. this.z = Math.floor(this.z),
  38514. this.w = Math.floor(this.w),
  38515. this
  38516. },
  38517. ceil: function() {
  38518. return this.x = Math.ceil(this.x),
  38519. this.y = Math.ceil(this.y),
  38520. this.z = Math.ceil(this.z),
  38521. this.w = Math.ceil(this.w),
  38522. this
  38523. },
  38524. round: function() {
  38525. return this.x = Math.round(this.x),
  38526. this.y = Math.round(this.y),
  38527. this.z = Math.round(this.z),
  38528. this.w = Math.round(this.w),
  38529. this
  38530. },
  38531. roundToZero: function() {
  38532. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38533. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38534. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38535. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38536. this
  38537. },
  38538. negate: function() {
  38539. return this.x = -this.x,
  38540. this.y = -this.y,
  38541. this.z = -this.z,
  38542. this.w = -this.w,
  38543. this
  38544. },
  38545. dot: function(e) {
  38546. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38547. },
  38548. lengthSq: function() {
  38549. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38550. },
  38551. length: function() {
  38552. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38553. },
  38554. lengthManhattan: function() {
  38555. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38556. },
  38557. normalize: function() {
  38558. return this.divideScalar(this.length())
  38559. },
  38560. setLength: function(e) {
  38561. return this.multiplyScalar(e / this.length())
  38562. },
  38563. lerp: function(e, t) {
  38564. return this.x += (e.x - this.x) * t,
  38565. this.y += (e.y - this.y) * t,
  38566. this.z += (e.z - this.z) * t,
  38567. this.w += (e.w - this.w) * t,
  38568. this
  38569. },
  38570. lerpVectors: function(e, t, i) {
  38571. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38572. this
  38573. },
  38574. equals: function(e) {
  38575. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38576. },
  38577. fromArray: function(e, t) {
  38578. return void 0 === t && (t = 0),
  38579. this.x = e[t],
  38580. this.y = e[t + 1],
  38581. this.z = e[t + 2],
  38582. this.w = e[t + 3],
  38583. this
  38584. },
  38585. toArray: function(e, t) {
  38586. return void 0 === e && (e = []),
  38587. void 0 === t && (t = 0),
  38588. e[t] = this.x,
  38589. e[t + 1] = this.y,
  38590. e[t + 2] = this.z,
  38591. e[t + 3] = this.w,
  38592. e
  38593. },
  38594. fromAttribute: function(e, t, i) {
  38595. return void 0 === i && (i = 0),
  38596. t = t * e.itemSize + i,
  38597. this.x = e.array[t],
  38598. this.y = e.array[t + 1],
  38599. this.z = e.array[t + 2],
  38600. this.w = e.array[t + 3],
  38601. this
  38602. }
  38603. },
  38604. Ci.Euler = function(e, t, i, n) {
  38605. this._x = e || 0,
  38606. this._y = t || 0,
  38607. this._z = i || 0,
  38608. this._order = n || Ci.Euler.DefaultOrder
  38609. }
  38610. ,
  38611. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38612. Ci.Euler.DefaultOrder = "XYZ",
  38613. Ci.Euler.prototype = {
  38614. constructor: Ci.Euler,
  38615. get x() {
  38616. return this._x
  38617. },
  38618. set x(e) {
  38619. this._x = e,
  38620. this.onChangeCallback()
  38621. },
  38622. get y() {
  38623. return this._y
  38624. },
  38625. set y(e) {
  38626. this._y = e,
  38627. this.onChangeCallback()
  38628. },
  38629. get z() {
  38630. return this._z
  38631. },
  38632. set z(e) {
  38633. this._z = e,
  38634. this.onChangeCallback()
  38635. },
  38636. get order() {
  38637. return this._order
  38638. },
  38639. set order(e) {
  38640. this._order = e,
  38641. this.onChangeCallback()
  38642. },
  38643. set: function(e, t, i, n) {
  38644. return this._x = e,
  38645. this._y = t,
  38646. this._z = i,
  38647. this._order = n || this._order,
  38648. this.onChangeCallback(),
  38649. this
  38650. },
  38651. clone: function() {
  38652. return new this.constructor(this._x,this._y,this._z,this._order)
  38653. },
  38654. copy: function(e) {
  38655. return this._x = e._x,
  38656. this._y = e._y,
  38657. this._z = e._z,
  38658. this._order = e._order,
  38659. this.onChangeCallback(),
  38660. this
  38661. },
  38662. toObject: function() {//xzw
  38663. return {x:this.x,y:this.y,z:this.z}
  38664. },
  38665. setFromRotationMatrix: function(e, t, i) {
  38666. var n = Ci.Math.clamp
  38667. , r = e.elements
  38668. , o = r[0]
  38669. , a = r[4]
  38670. , s = r[8]
  38671. , l = r[1]
  38672. , c = r[5]
  38673. , h = r[9]
  38674. , u = r[2]
  38675. , d = r[6]
  38676. , p = r[10];
  38677. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38678. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38679. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38680. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38681. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38682. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38683. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38684. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38685. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38686. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38687. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38688. this._z = Math.atan2(l, o)) : (this._x = 0,
  38689. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38690. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38691. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38692. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38693. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38694. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38695. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38696. this._order = t,
  38697. !1 !== i && this.onChangeCallback(),
  38698. this
  38699. },
  38700. setFromQuaternion: function(e, t, i) {
  38701. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38702. Ee.makeRotationFromQuaternion(e),
  38703. this.setFromRotationMatrix(Ee, t, i),
  38704. this
  38705. },
  38706. setFromVector3: function(e, t) {
  38707. return this.set(e.x, e.y, e.z, t || this._order)
  38708. },
  38709. reorder: (Ie = new Ci.Quaternion,
  38710. function(e) {
  38711. Ie.setFromEuler(this),
  38712. this.setFromQuaternion(Ie, e)
  38713. }
  38714. ),
  38715. equals: function(e) {
  38716. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38717. },
  38718. fromArray: function(e) {
  38719. return this._x = e[0],
  38720. this._y = e[1],
  38721. this._z = e[2],
  38722. void 0 !== e[3] && (this._order = e[3]),
  38723. this.onChangeCallback(),
  38724. this
  38725. },
  38726. toArray: function(e, t) {
  38727. return void 0 === e && (e = []),
  38728. void 0 === t && (t = 0),
  38729. e[t] = this._x,
  38730. e[t + 1] = this._y,
  38731. e[t + 2] = this._z,
  38732. e[t + 3] = this._order,
  38733. e
  38734. },
  38735. toVector3: function(e) {
  38736. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38737. },
  38738. onChange: function(e) {
  38739. return this.onChangeCallback = e,
  38740. this
  38741. },
  38742. onChangeCallback: function() {}
  38743. },
  38744. Ci.Line3 = function(e, t) {
  38745. this.start = void 0 !== e ? e : new Ci.Vector3,
  38746. this.end = void 0 !== t ? t : new Ci.Vector3
  38747. }
  38748. ,
  38749. Ci.Line3.prototype = {
  38750. constructor: Ci.Line3,
  38751. set: function(e, t) {
  38752. return this.start.copy(e),
  38753. this.end.copy(t),
  38754. this
  38755. },
  38756. clone: function() {
  38757. return (new this.constructor).copy(this)
  38758. },
  38759. copy: function(e) {
  38760. return this.start.copy(e.start),
  38761. this.end.copy(e.end),
  38762. this
  38763. },
  38764. center: function(e) {
  38765. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38766. },
  38767. delta: function(e) {
  38768. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38769. },
  38770. distanceSq: function() {
  38771. return this.start.distanceToSquared(this.end)
  38772. },
  38773. distance: function() {
  38774. return this.start.distanceTo(this.end)
  38775. },
  38776. at: function(e, t) {
  38777. var i = t || new Ci.Vector3;
  38778. return this.delta(i).multiplyScalar(e).add(this.start)
  38779. },
  38780. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38781. Ce = new Ci.Vector3,
  38782. function(e, t) {
  38783. Ae.subVectors(e, this.start),
  38784. Ce.subVectors(this.end, this.start);
  38785. var i = Ce.dot(Ce)
  38786. , n = Ce.dot(Ae) / i;
  38787. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38788. n
  38789. }
  38790. ),
  38791. closestPointToPoint: function(e, t, i) {
  38792. var n = this.closestPointToPointParameter(e, t)
  38793. , r = i || new Ci.Vector3;
  38794. return this.delta(r).multiplyScalar(n).add(this.start)
  38795. },
  38796. applyMatrix4: function(e) {
  38797. return this.start.applyMatrix4(e),
  38798. this.end.applyMatrix4(e),
  38799. this
  38800. },
  38801. equals: function(e) {
  38802. return e.start.equals(this.start) && e.end.equals(this.end)
  38803. }
  38804. },
  38805. Ci.Box2 = function(e, t) {
  38806. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38807. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38808. }
  38809. ,
  38810. Ci.Box2.prototype = {
  38811. constructor: Ci.Box2,
  38812. set: function(e, t) {
  38813. return this.min.copy(e),
  38814. this.max.copy(t),
  38815. this
  38816. },
  38817. setFromPoints: function(e) {
  38818. this.makeEmpty();
  38819. for (var t = 0, i = e.length; t < i; t++)
  38820. this.expandByPoint(e[t]);
  38821. return this
  38822. },
  38823. setFromCenterAndSize: (ye = new Ci.Vector2,
  38824. function(e, t) {
  38825. var i = ye.copy(t).multiplyScalar(.5);
  38826. return this.min.copy(e).sub(i),
  38827. this.max.copy(e).add(i),
  38828. this
  38829. }
  38830. ),
  38831. clone: function() {
  38832. return (new this.constructor).copy(this)
  38833. },
  38834. copy: function(e) {
  38835. return this.min.copy(e.min),
  38836. this.max.copy(e.max),
  38837. this
  38838. },
  38839. makeEmpty: function() {
  38840. return this.min.x = this.min.y = 1 / 0,
  38841. this.max.x = this.max.y = -1 / 0,
  38842. this
  38843. },
  38844. isEmpty: function() {
  38845. return this.max.x < this.min.x || this.max.y < this.min.y
  38846. },
  38847. center: function(e) {
  38848. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38849. },
  38850. size: function(e) {
  38851. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38852. },
  38853. expandByPoint: function(e) {
  38854. return this.min.min(e),
  38855. this.max.max(e),
  38856. this
  38857. },
  38858. expandByVector: function(e) {
  38859. return this.min.sub(e),
  38860. this.max.add(e),
  38861. this
  38862. },
  38863. expandByScalar: function(e) {
  38864. return this.min.addScalar(-e),
  38865. this.max.addScalar(e),
  38866. this
  38867. },
  38868. containsPoint: function(e) {
  38869. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38870. },
  38871. containsBox: function(e) {
  38872. 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
  38873. },
  38874. getParameter: function(e, t) {
  38875. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  38876. },
  38877. intersectsBox: function(e) {
  38878. 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)
  38879. },
  38880. clampPoint: function(e, t) {
  38881. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38882. },
  38883. distanceToPoint: (ve = new Ci.Vector2,
  38884. function(e) {
  38885. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38886. }
  38887. ),
  38888. intersect: function(e) {
  38889. return this.min.max(e.min),
  38890. this.max.min(e.max),
  38891. this
  38892. },
  38893. union: function(e) {
  38894. return this.min.min(e.min),
  38895. this.max.max(e.max),
  38896. this
  38897. },
  38898. translate: function(e) {
  38899. return this.min.add(e),
  38900. this.max.add(e),
  38901. this
  38902. },
  38903. equals: function(e) {
  38904. return e.min.equals(this.min) && e.max.equals(this.max)
  38905. }
  38906. },
  38907. Ci.Box3 = function(e, t) {
  38908. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38909. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38910. }
  38911. ,
  38912. Ci.Box3.prototype = {
  38913. constructor: Ci.Box3,
  38914. set: function(e, t) {
  38915. return this.min.copy(e),
  38916. this.max.copy(t),
  38917. this
  38918. },
  38919. setFromArray: function(e) {
  38920. this.makeEmpty();
  38921. 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) {
  38922. var c = e[s]
  38923. , h = e[s + 1]
  38924. , u = e[s + 2];
  38925. c < t && (t = c),
  38926. h < i && (i = h),
  38927. u < n && (n = u),
  38928. r < c && (r = c),
  38929. o < h && (o = h),
  38930. a < u && (a = u)
  38931. }
  38932. this.min.set(t, i, n),
  38933. this.max.set(r, o, a)
  38934. },
  38935. setFromPoints: function(e) {
  38936. this.makeEmpty();
  38937. for (var t = 0, i = e.length; t < i; t++)
  38938. this.expandByPoint(e[t]);
  38939. return this
  38940. },
  38941. setFromCenterAndSize: (me = new Ci.Vector3,
  38942. function(e, t) {
  38943. var i = me.copy(t).multiplyScalar(.5);
  38944. return this.min.copy(e).sub(i),
  38945. this.max.copy(e).add(i),
  38946. this
  38947. }
  38948. ),
  38949. setFromObject: function(e) {
  38950. void 0 === ge && (ge = new Ci.Box3);
  38951. var i = this;
  38952. return this.makeEmpty(),
  38953. e.updateMatrixWorld(!0),
  38954. e.traverse(function(e) {
  38955. var t = e.geometry;
  38956. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38957. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38958. ge.applyMatrix4(e.matrixWorld),
  38959. i.union(ge)))
  38960. }),
  38961. this
  38962. },
  38963. clone: function() {
  38964. return (new this.constructor).copy(this)
  38965. },
  38966. copy: function(e) {
  38967. return this.min.copy(e.min),
  38968. this.max.copy(e.max),
  38969. this
  38970. },
  38971. makeEmpty: function() {
  38972. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38973. this.max.x = this.max.y = this.max.z = -1 / 0,
  38974. this
  38975. },
  38976. isEmpty: function() {
  38977. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38978. },
  38979. center: function(e) {
  38980. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38981. },
  38982. size: function(e) {
  38983. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38984. },
  38985. expandByPoint: function(e) {
  38986. return this.min.min(e),
  38987. this.max.max(e),
  38988. this
  38989. },
  38990. expandByVector: function(e) {
  38991. return this.min.sub(e),
  38992. this.max.add(e),
  38993. this
  38994. },
  38995. expandByScalar: function(e) {
  38996. return this.min.addScalar(-e),
  38997. this.max.addScalar(e),
  38998. this
  38999. },
  39000. containsPoint: function(e) {
  39001. 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)
  39002. },
  39003. containsBox: function(e) {
  39004. 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
  39005. },
  39006. getParameter: function(e, t) {
  39007. return (t || new Ci.Vector3).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  39008. },
  39009. intersectsBox: function(e) {
  39010. 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)
  39011. },
  39012. intersectsSphere: function(e) {
  39013. return void 0 === fe && (fe = new Ci.Vector3),
  39014. this.clampPoint(e.center, fe),
  39015. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39016. },
  39017. intersectsPlane: function(e) {
  39018. var t, i;
  39019. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39020. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39021. e.normal.x * this.min.x),
  39022. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39023. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39024. i += e.normal.y * this.min.y),
  39025. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39026. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39027. i += e.normal.z * this.min.z),
  39028. t <= e.constant && i >= e.constant
  39029. },
  39030. clampPoint: function(e, t) {
  39031. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39032. },
  39033. distanceToPoint: (pe = new Ci.Vector3,
  39034. function(e) {
  39035. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39036. }
  39037. ),
  39038. getBoundingSphere: (de = new Ci.Vector3,
  39039. function(e) {
  39040. var t = e || new Ci.Sphere;
  39041. return t.center = this.center(),
  39042. t.radius = .5 * this.size(de).length(),
  39043. t
  39044. }
  39045. ),
  39046. intersect: function(e) {
  39047. return this.min.max(e.min),
  39048. this.max.min(e.max),
  39049. this
  39050. },
  39051. union: function(e) {
  39052. return this.min.min(e.min),
  39053. this.max.max(e.max),
  39054. this
  39055. },
  39056. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  39057. function(e) {
  39058. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39059. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39060. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39061. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39062. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39063. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39064. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39065. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39066. this.makeEmpty(),
  39067. this.setFromPoints(ue),
  39068. this
  39069. }
  39070. ),
  39071. translate: function(e) {
  39072. return this.min.add(e),
  39073. this.max.add(e),
  39074. this
  39075. },
  39076. equals: function(e) {
  39077. return e.min.equals(this.min) && e.max.equals(this.max)
  39078. }
  39079. },
  39080. Ci.Matrix3 = function() {
  39081. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39082. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39083. }
  39084. ,
  39085. Ci.Matrix3.prototype = {
  39086. constructor: Ci.Matrix3,
  39087. set: function(e, t, i, n, r, o, a, s, l) {
  39088. var c = this.elements;
  39089. return c[0] = e,
  39090. c[1] = n,
  39091. c[2] = a,
  39092. c[3] = t,
  39093. c[4] = r,
  39094. c[5] = s,
  39095. c[6] = i,
  39096. c[7] = o,
  39097. c[8] = l,
  39098. this
  39099. },
  39100. identity: function() {
  39101. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39102. this
  39103. },
  39104. clone: function() {
  39105. return (new this.constructor).fromArray(this.elements)
  39106. },
  39107. copy: function(e) {
  39108. var t = e.elements;
  39109. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39110. this
  39111. },
  39112. setFromMatrix4: function(e) {
  39113. var t = e.elements;
  39114. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39115. this
  39116. },
  39117. applyToVector3Array: function(e, t, i) {
  39118. void 0 === he && (he = new Ci.Vector3),
  39119. void 0 === t && (t = 0),
  39120. void 0 === i && (i = e.length);
  39121. for (var n = 0, r = t; n < i; n += 3,
  39122. r += 3)
  39123. he.fromArray(e, r),
  39124. he.applyMatrix3(this),
  39125. he.toArray(e, r);
  39126. return e
  39127. },
  39128. applyToBuffer: function(e, t, i) {
  39129. void 0 === ce && (ce = new Ci.Vector3),
  39130. void 0 === t && (t = 0),
  39131. void 0 === i && (i = e.length / e.itemSize);
  39132. for (var n = 0, r = t; n < i; n++,
  39133. r++)
  39134. ce.x = e.getX(r),
  39135. ce.y = e.getY(r),
  39136. ce.z = e.getZ(r),
  39137. ce.applyMatrix3(this),
  39138. e.setXYZ(ce.x, ce.y, ce.z);
  39139. return e
  39140. },
  39141. multiplyScalar: function(e) {
  39142. var t = this.elements;
  39143. return t[0] *= e,
  39144. t[3] *= e,
  39145. t[6] *= e,
  39146. t[1] *= e,
  39147. t[4] *= e,
  39148. t[7] *= e,
  39149. t[2] *= e,
  39150. t[5] *= e,
  39151. t[8] *= e,
  39152. this
  39153. },
  39154. determinant: function() {
  39155. var e = this.elements
  39156. , t = e[0]
  39157. , i = e[1]
  39158. , n = e[2]
  39159. , r = e[3]
  39160. , o = e[4]
  39161. , a = e[5]
  39162. , s = e[6]
  39163. , l = e[7]
  39164. , c = e[8];
  39165. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39166. },
  39167. getInverse: function(e, t) {
  39168. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39169. var i = e.elements
  39170. , n = this.elements
  39171. , r = i[0]
  39172. , o = i[1]
  39173. , a = i[2]
  39174. , s = i[3]
  39175. , l = i[4]
  39176. , c = i[5]
  39177. , h = i[6]
  39178. , u = i[7]
  39179. , d = i[8]
  39180. , p = d * l - c * u
  39181. , f = c * h - d * s
  39182. , g = u * s - l * h
  39183. , m = r * p + o * f + a * g;
  39184. if (0 != m)
  39185. return n[0] = p,
  39186. n[1] = a * u - d * o,
  39187. n[2] = c * o - a * l,
  39188. n[3] = f,
  39189. n[4] = d * r - a * h,
  39190. n[5] = a * s - c * r,
  39191. n[6] = g,
  39192. n[7] = o * h - u * r,
  39193. n[8] = l * r - o * s,
  39194. this.multiplyScalar(1 / m);
  39195. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39196. if (t)
  39197. throw new Error(v);
  39198. return console.warn(v),
  39199. this.identity()
  39200. },
  39201. transpose: function() {
  39202. var e, t = this.elements;
  39203. return e = t[1],
  39204. t[1] = t[3],
  39205. t[3] = e,
  39206. e = t[2],
  39207. t[2] = t[6],
  39208. t[6] = e,
  39209. e = t[5],
  39210. t[5] = t[7],
  39211. t[7] = e,
  39212. this
  39213. },
  39214. flattenToArrayOffset: function(e, t) {
  39215. var i = this.elements;
  39216. return e[t] = i[0],
  39217. e[t + 1] = i[1],
  39218. e[t + 2] = i[2],
  39219. e[t + 3] = i[3],
  39220. e[t + 4] = i[4],
  39221. e[t + 5] = i[5],
  39222. e[t + 6] = i[6],
  39223. e[t + 7] = i[7],
  39224. e[t + 8] = i[8],
  39225. e
  39226. },
  39227. getNormalMatrix: function(e) {
  39228. return this.setFromMatrix4(e).getInverse(this).transpose()
  39229. },
  39230. transposeIntoArray: function(e) {
  39231. var t = this.elements;
  39232. return e[0] = t[0],
  39233. e[1] = t[3],
  39234. e[2] = t[6],
  39235. e[3] = t[1],
  39236. e[4] = t[4],
  39237. e[5] = t[7],
  39238. e[6] = t[2],
  39239. e[7] = t[5],
  39240. e[8] = t[8],
  39241. this
  39242. },
  39243. fromArray: function(e) {
  39244. return this.elements.set(e),
  39245. this
  39246. },
  39247. toArray: function() {
  39248. var e = this.elements;
  39249. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39250. }
  39251. },
  39252. Ci.Matrix4 = function() {
  39253. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39254. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39255. }
  39256. ,
  39257. Ci.Matrix4.prototype = {
  39258. constructor: Ci.Matrix4,
  39259. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39260. var m = this.elements;
  39261. return m[0] = e,
  39262. m[4] = t,
  39263. m[8] = i,
  39264. m[12] = n,
  39265. m[1] = r,
  39266. m[5] = o,
  39267. m[9] = a,
  39268. m[13] = s,
  39269. m[2] = l,
  39270. m[6] = c,
  39271. m[10] = h,
  39272. m[14] = u,
  39273. m[3] = d,
  39274. m[7] = p,
  39275. m[11] = f,
  39276. m[15] = g,
  39277. this
  39278. },
  39279. identity: function() {
  39280. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39281. this
  39282. },
  39283. clone: function() {
  39284. return (new Ci.Matrix4).fromArray(this.elements)
  39285. },
  39286. copy: function(e) {
  39287. return this.elements.set(e.elements),
  39288. this
  39289. },
  39290. copyPosition: function(e) {
  39291. var t = this.elements
  39292. , i = e.elements;
  39293. return t[12] = i[12],
  39294. t[13] = i[13],
  39295. t[14] = i[14],
  39296. this
  39297. },
  39298. extractBasis: function(e, t, i) {
  39299. return e.setFromMatrixColumn(this, 0),
  39300. t.setFromMatrixColumn(this, 1),
  39301. i.setFromMatrixColumn(this, 2),
  39302. this
  39303. },
  39304. makeBasis: function(e, t, i) {
  39305. 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),
  39306. this
  39307. },
  39308. extractRotation: function(e) {
  39309. void 0 === le && (le = new Ci.Vector3);
  39310. var t = this.elements
  39311. , i = e.elements
  39312. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39313. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39314. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39315. return t[0] = i[0] * n,
  39316. t[1] = i[1] * n,
  39317. t[2] = i[2] * n,
  39318. t[4] = i[4] * r,
  39319. t[5] = i[5] * r,
  39320. t[6] = i[6] * r,
  39321. t[8] = i[8] * o,
  39322. t[9] = i[9] * o,
  39323. t[10] = i[10] * o,
  39324. this
  39325. },
  39326. makeRotationFromEuler: function(e) {
  39327. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39328. var t = this.elements
  39329. , i = e.x
  39330. , n = e.y
  39331. , r = e.z
  39332. , o = Math.cos(i)
  39333. , a = Math.sin(i)
  39334. , s = Math.cos(n)
  39335. , l = Math.sin(n)
  39336. , c = Math.cos(r)
  39337. , h = Math.sin(r);
  39338. if ("XYZ" === e.order) {
  39339. var u = o * c
  39340. , d = o * h
  39341. , p = a * c
  39342. , f = a * h;
  39343. t[0] = s * c,
  39344. t[4] = -s * h,
  39345. t[8] = l,
  39346. t[1] = d + p * l,
  39347. t[5] = u - f * l,
  39348. t[9] = -a * s,
  39349. t[2] = f - u * l,
  39350. t[6] = p + d * l,
  39351. t[10] = o * s
  39352. } else if ("YXZ" === e.order) {
  39353. var g = s * c
  39354. , m = s * h
  39355. , v = l * c
  39356. , y = l * h;
  39357. t[0] = g + y * a,
  39358. t[4] = v * a - m,
  39359. t[8] = o * l,
  39360. t[1] = o * h,
  39361. t[5] = o * c,
  39362. t[9] = -a,
  39363. t[2] = m * a - v,
  39364. t[6] = y + g * a,
  39365. t[10] = o * s
  39366. } else if ("ZXY" === e.order) {
  39367. g = s * c,
  39368. m = s * h,
  39369. v = l * c,
  39370. y = l * h;
  39371. t[0] = g - y * a,
  39372. t[4] = -o * h,
  39373. t[8] = v + m * a,
  39374. t[1] = m + v * a,
  39375. t[5] = o * c,
  39376. t[9] = y - g * a,
  39377. t[2] = -o * l,
  39378. t[6] = a,
  39379. t[10] = o * s
  39380. } else if ("ZYX" === e.order) {
  39381. u = o * c,
  39382. d = o * h,
  39383. p = a * c,
  39384. f = a * h;
  39385. t[0] = s * c,
  39386. t[4] = p * l - d,
  39387. t[8] = u * l + f,
  39388. t[1] = s * h,
  39389. t[5] = f * l + u,
  39390. t[9] = d * l - p,
  39391. t[2] = -l,
  39392. t[6] = a * s,
  39393. t[10] = o * s
  39394. } else if ("YZX" === e.order) {
  39395. var A = o * s
  39396. , C = o * l
  39397. , I = a * s
  39398. , E = a * l;
  39399. t[0] = s * c,
  39400. t[4] = E - A * h,
  39401. t[8] = I * h + C,
  39402. t[1] = h,
  39403. t[5] = o * c,
  39404. t[9] = -a * c,
  39405. t[2] = -l * c,
  39406. t[6] = C * h + I,
  39407. t[10] = A - E * h
  39408. } else if ("XZY" === e.order) {
  39409. A = o * s,
  39410. C = o * l,
  39411. I = a * s,
  39412. E = a * l;
  39413. t[0] = s * c,
  39414. t[4] = -h,
  39415. t[8] = l * c,
  39416. t[1] = A * h + E,
  39417. t[5] = o * c,
  39418. t[9] = C * h - I,
  39419. t[2] = I * h - C,
  39420. t[6] = a * c,
  39421. t[10] = E * h + A
  39422. }
  39423. return t[3] = 0,
  39424. t[7] = 0,
  39425. t[11] = 0,
  39426. t[12] = 0,
  39427. t[13] = 0,
  39428. t[14] = 0,
  39429. t[15] = 1,
  39430. this
  39431. },
  39432. makeRotationFromQuaternion: function(e) {
  39433. var t = this.elements
  39434. , i = e.x
  39435. , n = e.y
  39436. , r = e.z
  39437. , o = e.w
  39438. , a = i + i
  39439. , s = n + n
  39440. , l = r + r
  39441. , c = i * a
  39442. , h = i * s
  39443. , u = i * l
  39444. , d = n * s
  39445. , p = n * l
  39446. , f = r * l
  39447. , g = o * a
  39448. , m = o * s
  39449. , v = o * l;
  39450. return t[0] = 1 - (d + f),
  39451. t[4] = h - v,
  39452. t[8] = u + m,
  39453. t[1] = h + v,
  39454. t[5] = 1 - (c + f),
  39455. t[9] = p - g,
  39456. t[2] = u - m,
  39457. t[6] = p + g,
  39458. t[10] = 1 - (c + d),
  39459. t[3] = 0,
  39460. t[7] = 0,
  39461. t[11] = 0,
  39462. t[12] = 0,
  39463. t[13] = 0,
  39464. t[14] = 0,
  39465. t[15] = 1,
  39466. this
  39467. },
  39468. lookAt: function(e, t, i) {
  39469. void 0 === oe && (oe = new Ci.Vector3),
  39470. void 0 === ae && (ae = new Ci.Vector3),
  39471. void 0 === se && (se = new Ci.Vector3);
  39472. var n = this.elements;
  39473. return se.subVectors(e, t).normalize(),
  39474. 0 === se.lengthSq() && (se.z = 1),
  39475. oe.crossVectors(i, se).normalize(),
  39476. 0 === oe.lengthSq() && (se.x += 1e-4,
  39477. oe.crossVectors(i, se).normalize()),
  39478. ae.crossVectors(se, oe),
  39479. n[0] = oe.x,
  39480. n[4] = ae.x,
  39481. n[8] = se.x,
  39482. n[1] = oe.y,
  39483. n[5] = ae.y,
  39484. n[9] = se.y,
  39485. n[2] = oe.z,
  39486. n[6] = ae.z,
  39487. n[10] = se.z,
  39488. this
  39489. },
  39490. multiply: function(e, t) {
  39491. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39492. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39493. },
  39494. multiplyMatrices: function(e, t) {
  39495. var i = e.elements
  39496. , n = t.elements
  39497. , r = this.elements
  39498. , o = i[0]
  39499. , a = i[4]
  39500. , s = i[8]
  39501. , l = i[12]
  39502. , c = i[1]
  39503. , h = i[5]
  39504. , u = i[9]
  39505. , d = i[13]
  39506. , p = i[2]
  39507. , f = i[6]
  39508. , g = i[10]
  39509. , m = i[14]
  39510. , v = i[3]
  39511. , y = i[7]
  39512. , A = i[11]
  39513. , C = i[15]
  39514. , I = n[0]
  39515. , E = n[4]
  39516. , _ = n[8]
  39517. , b = n[12]
  39518. , w = n[1]
  39519. , T = n[5]
  39520. , x = n[9]
  39521. , S = n[13]
  39522. , M = n[2]
  39523. , R = n[6]
  39524. , P = n[10]
  39525. , O = n[14]
  39526. , L = n[3]
  39527. , D = n[7]
  39528. , N = n[11]
  39529. , F = n[15];
  39530. return r[0] = o * I + a * w + s * M + l * L,
  39531. r[4] = o * E + a * T + s * R + l * D,
  39532. r[8] = o * _ + a * x + s * P + l * N,
  39533. r[12] = o * b + a * S + s * O + l * F,
  39534. r[1] = c * I + h * w + u * M + d * L,
  39535. r[5] = c * E + h * T + u * R + d * D,
  39536. r[9] = c * _ + h * x + u * P + d * N,
  39537. r[13] = c * b + h * S + u * O + d * F,
  39538. r[2] = p * I + f * w + g * M + m * L,
  39539. r[6] = p * E + f * T + g * R + m * D,
  39540. r[10] = p * _ + f * x + g * P + m * N,
  39541. r[14] = p * b + f * S + g * O + m * F,
  39542. r[3] = v * I + y * w + A * M + C * L,
  39543. r[7] = v * E + y * T + A * R + C * D,
  39544. r[11] = v * _ + y * x + A * P + C * N,
  39545. r[15] = v * b + y * S + A * O + C * F,
  39546. this
  39547. },
  39548. multiplyToArray: function(e, t, i) {
  39549. var n = this.elements;
  39550. return this.multiplyMatrices(e, t),
  39551. i[0] = n[0],
  39552. i[1] = n[1],
  39553. i[2] = n[2],
  39554. i[3] = n[3],
  39555. i[4] = n[4],
  39556. i[5] = n[5],
  39557. i[6] = n[6],
  39558. i[7] = n[7],
  39559. i[8] = n[8],
  39560. i[9] = n[9],
  39561. i[10] = n[10],
  39562. i[11] = n[11],
  39563. i[12] = n[12],
  39564. i[13] = n[13],
  39565. i[14] = n[14],
  39566. i[15] = n[15],
  39567. this
  39568. },
  39569. multiplyScalar: function(e) {
  39570. var t = this.elements;
  39571. return t[0] *= e,
  39572. t[4] *= e,
  39573. t[8] *= e,
  39574. t[12] *= e,
  39575. t[1] *= e,
  39576. t[5] *= e,
  39577. t[9] *= e,
  39578. t[13] *= e,
  39579. t[2] *= e,
  39580. t[6] *= e,
  39581. t[10] *= e,
  39582. t[14] *= e,
  39583. t[3] *= e,
  39584. t[7] *= e,
  39585. t[11] *= e,
  39586. t[15] *= e,
  39587. this
  39588. },
  39589. applyToVector3Array: function(e, t, i) {
  39590. void 0 === re && (re = new Ci.Vector3),
  39591. void 0 === t && (t = 0),
  39592. void 0 === i && (i = e.length);
  39593. for (var n = 0, r = t; n < i; n += 3,
  39594. r += 3)
  39595. re.fromArray(e, r),
  39596. re.applyMatrix4(this),
  39597. re.toArray(e, r);
  39598. return e
  39599. },
  39600. applyToBuffer: function(e, t, i) {
  39601. void 0 === ne && (ne = new Ci.Vector3),
  39602. void 0 === t && (t = 0),
  39603. void 0 === i && (i = e.length / e.itemSize);
  39604. for (var n = 0, r = t; n < i; n++,
  39605. r++)
  39606. ne.x = e.getX(r),
  39607. ne.y = e.getY(r),
  39608. ne.z = e.getZ(r),
  39609. ne.applyMatrix4(this),
  39610. e.setXYZ(ne.x, ne.y, ne.z);
  39611. return e
  39612. },
  39613. determinant: function() {
  39614. var e = this.elements
  39615. , t = e[0]
  39616. , i = e[4]
  39617. , n = e[8]
  39618. , r = e[12]
  39619. , o = e[1]
  39620. , a = e[5]
  39621. , s = e[9]
  39622. , l = e[13]
  39623. , c = e[2]
  39624. , h = e[6]
  39625. , u = e[10]
  39626. , d = e[14];
  39627. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39628. },
  39629. transpose: function() {
  39630. var e, t = this.elements;
  39631. return e = t[1],
  39632. t[1] = t[4],
  39633. t[4] = e,
  39634. e = t[2],
  39635. t[2] = t[8],
  39636. t[8] = e,
  39637. e = t[6],
  39638. t[6] = t[9],
  39639. t[9] = e,
  39640. e = t[3],
  39641. t[3] = t[12],
  39642. t[12] = e,
  39643. e = t[7],
  39644. t[7] = t[13],
  39645. t[13] = e,
  39646. e = t[11],
  39647. t[11] = t[14],
  39648. t[14] = e,
  39649. this
  39650. },
  39651. flattenToArrayOffset: function(e, t) {
  39652. var i = this.elements;
  39653. return e[t] = i[0],
  39654. e[t + 1] = i[1],
  39655. e[t + 2] = i[2],
  39656. e[t + 3] = i[3],
  39657. e[t + 4] = i[4],
  39658. e[t + 5] = i[5],
  39659. e[t + 6] = i[6],
  39660. e[t + 7] = i[7],
  39661. e[t + 8] = i[8],
  39662. e[t + 9] = i[9],
  39663. e[t + 10] = i[10],
  39664. e[t + 11] = i[11],
  39665. e[t + 12] = i[12],
  39666. e[t + 13] = i[13],
  39667. e[t + 14] = i[14],
  39668. e[t + 15] = i[15],
  39669. e
  39670. },
  39671. getPosition: function() {
  39672. return void 0 === ie && (ie = new Ci.Vector3),
  39673. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39674. ie.setFromMatrixColumn(this, 3)
  39675. },
  39676. setPosition: function(e) {
  39677. var t = this.elements;
  39678. return t[12] = e.x,
  39679. t[13] = e.y,
  39680. t[14] = e.z,
  39681. this
  39682. },
  39683. getInverse: function(e, t) {
  39684. var i = this.elements
  39685. , n = e.elements
  39686. , r = n[0]
  39687. , o = n[1]
  39688. , a = n[2]
  39689. , s = n[3]
  39690. , l = n[4]
  39691. , c = n[5]
  39692. , h = n[6]
  39693. , u = n[7]
  39694. , d = n[8]
  39695. , p = n[9]
  39696. , f = n[10]
  39697. , g = n[11]
  39698. , m = n[12]
  39699. , v = n[13]
  39700. , y = n[14]
  39701. , A = n[15]
  39702. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39703. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39704. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39705. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39706. , b = r * C + o * I + a * E + s * _;
  39707. if (0 != b)
  39708. return i[0] = C,
  39709. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39710. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39711. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39712. i[4] = I,
  39713. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39714. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39715. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39716. i[8] = E,
  39717. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39718. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39719. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39720. i[12] = _,
  39721. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39722. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39723. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39724. this.multiplyScalar(1 / b);
  39725. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39726. if (t)
  39727. throw new Error(w);
  39728. return console.warn(w),
  39729. this.identity()
  39730. },
  39731. scale: function(e) {
  39732. var t = this.elements
  39733. , i = e.x
  39734. , n = e.y
  39735. , r = e.z;
  39736. return t[0] *= i,
  39737. t[4] *= n,
  39738. t[8] *= r,
  39739. t[1] *= i,
  39740. t[5] *= n,
  39741. t[9] *= r,
  39742. t[2] *= i,
  39743. t[6] *= n,
  39744. t[10] *= r,
  39745. t[3] *= i,
  39746. t[7] *= n,
  39747. t[11] *= r,
  39748. this
  39749. },
  39750. getMaxScaleOnAxis: function() {
  39751. var e = this.elements
  39752. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39753. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39754. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39755. return Math.sqrt(Math.max(t, i, n))
  39756. },
  39757. makeTranslation: function(e, t, i) {
  39758. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39759. this
  39760. },
  39761. makeRotationX: function(e) {
  39762. var t = Math.cos(e)
  39763. , i = Math.sin(e);
  39764. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39765. this
  39766. },
  39767. makeRotationY: function(e) {
  39768. var t = Math.cos(e)
  39769. , i = Math.sin(e);
  39770. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39771. this
  39772. },
  39773. makeRotationZ: function(e) {
  39774. var t = Math.cos(e)
  39775. , i = Math.sin(e);
  39776. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39777. this
  39778. },
  39779. makeRotationAxis: function(e, t) {
  39780. var i = Math.cos(t)
  39781. , n = Math.sin(t)
  39782. , r = 1 - i
  39783. , o = e.x
  39784. , a = e.y
  39785. , s = e.z
  39786. , l = r * o
  39787. , c = r * a;
  39788. 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),
  39789. this
  39790. },
  39791. makeScale: function(e, t, i) {
  39792. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39793. this
  39794. },
  39795. compose: function(e, t, i) {
  39796. return this.makeRotationFromQuaternion(t),
  39797. this.scale(i),
  39798. this.setPosition(e),
  39799. this
  39800. },
  39801. decompose: function(e, t, i) {
  39802. void 0 === ee && (ee = new Ci.Vector3),
  39803. void 0 === te && (te = new Ci.Matrix4);
  39804. var n = this.elements
  39805. , r = ee.set(n[0], n[1], n[2]).length()
  39806. , o = ee.set(n[4], n[5], n[6]).length()
  39807. , a = ee.set(n[8], n[9], n[10]).length();
  39808. this.determinant() < 0 && (r = -r),
  39809. e.x = n[12],
  39810. e.y = n[13],
  39811. e.z = n[14],
  39812. te.elements.set(this.elements);
  39813. var s = 1 / r
  39814. , l = 1 / o
  39815. , c = 1 / a;
  39816. return te.elements[0] *= s,
  39817. te.elements[1] *= s,
  39818. te.elements[2] *= s,
  39819. te.elements[4] *= l,
  39820. te.elements[5] *= l,
  39821. te.elements[6] *= l,
  39822. te.elements[8] *= c,
  39823. te.elements[9] *= c,
  39824. te.elements[10] *= c,
  39825. t.setFromRotationMatrix(te),
  39826. i.x = r,
  39827. i.y = o,
  39828. i.z = a,
  39829. this
  39830. },
  39831. makeFrustum: function(e, t, i, n, r, o) {
  39832. var a = this.elements
  39833. , s = 2 * r / (t - e)
  39834. , l = 2 * r / (n - i)
  39835. , c = (t + e) / (t - e)
  39836. , h = (n + i) / (n - i)
  39837. , u = -(o + r) / (o - r)
  39838. , d = -2 * o * r / (o - r);
  39839. return a[0] = s,
  39840. a[4] = 0,
  39841. a[8] = c,
  39842. a[12] = 0,
  39843. a[1] = 0,
  39844. a[5] = l,
  39845. a[9] = h,
  39846. a[13] = 0,
  39847. a[2] = 0,
  39848. a[6] = 0,
  39849. a[10] = u,
  39850. a[14] = d,
  39851. a[3] = 0,
  39852. a[7] = 0,
  39853. a[11] = -1,
  39854. a[15] = 0,
  39855. this
  39856. },
  39857. makePerspective: function(e, t, i, n) {
  39858. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39859. , o = -r
  39860. , a = o * t
  39861. , s = r * t;
  39862. return this.makeFrustum(a, s, o, r, i, n)
  39863. },
  39864. makeOrthographic: function(e, t, i, n, r, o) {
  39865. var a = this.elements
  39866. , s = 1 / (t - e)
  39867. , l = 1 / (i - n)
  39868. , c = 1 / (o - r)
  39869. , h = (t + e) * s
  39870. , u = (i + n) * l
  39871. , d = (o + r) * c;
  39872. return a[0] = 2 * s,
  39873. a[4] = 0,
  39874. a[8] = 0,
  39875. a[12] = -h,
  39876. a[1] = 0,
  39877. a[5] = 2 * l,
  39878. a[9] = 0,
  39879. a[13] = -u,
  39880. a[2] = 0,
  39881. a[6] = 0,
  39882. a[10] = -2 * c,
  39883. a[14] = -d,
  39884. a[3] = 0,
  39885. a[7] = 0,
  39886. a[11] = 0,
  39887. a[15] = 1,
  39888. this
  39889. },
  39890. equals: function(e) {
  39891. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39892. if (t[n] !== i[n])
  39893. return !1;
  39894. return !0
  39895. },
  39896. fromArray: function(e) {
  39897. return this.elements.set(e),
  39898. this
  39899. },
  39900. toArray: function() {
  39901. var e = this.elements;
  39902. 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]]
  39903. }
  39904. },
  39905. Ci.Ray = function(e, t) {
  39906. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39907. this.direction = void 0 !== t ? t : new Ci.Vector3
  39908. }
  39909. ,
  39910. Ci.Ray.prototype = {
  39911. constructor: Ci.Ray,
  39912. set: function(e, t) {
  39913. return this.origin.copy(e),
  39914. this.direction.copy(t),
  39915. this
  39916. },
  39917. clone: function() {
  39918. return (new this.constructor).copy(this)
  39919. },
  39920. copy: function(e) {
  39921. return this.origin.copy(e.origin),
  39922. this.direction.copy(e.direction),
  39923. this
  39924. },
  39925. at: function(e, t) {
  39926. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39927. },
  39928. lookAt: function(e) {
  39929. this.direction.copy(e).sub(this.origin).normalize()
  39930. },
  39931. recast: ($ = new Ci.Vector3,
  39932. function(e) {
  39933. return this.origin.copy(this.at(e, $)),
  39934. this
  39935. }
  39936. ),
  39937. closestPointToPoint: function(e, t) {
  39938. var i = t || new Ci.Vector3;
  39939. i.subVectors(e, this.origin);
  39940. var n = i.dot(this.direction);
  39941. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39942. },
  39943. distanceToPoint: function(e) {
  39944. return Math.sqrt(this.distanceSqToPoint(e))
  39945. },
  39946. distanceSqToPoint: (J = new Ci.Vector3,
  39947. function(e) {
  39948. var t = J.subVectors(e, this.origin).dot(this.direction);
  39949. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39950. J.distanceToSquared(e))
  39951. }
  39952. ),
  39953. distanceSqToSegment: (Z = new Ci.Vector3,
  39954. K = new Ci.Vector3,
  39955. Q = new Ci.Vector3,
  39956. function(e, t, i, n) {
  39957. Z.copy(e).add(t).multiplyScalar(.5),
  39958. K.copy(t).sub(e).normalize(),
  39959. Q.copy(this.origin).sub(Z);
  39960. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  39961. if (0 < p)
  39962. if (o = c * h - u,
  39963. s = l * p,
  39964. 0 <= (r = c * u - h))
  39965. if (-s <= o)
  39966. if (o <= s) {
  39967. var f = 1 / p;
  39968. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39969. } else
  39970. o = l,
  39971. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39972. else
  39973. o = -l,
  39974. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39975. else
  39976. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  39977. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  39978. else
  39979. o = 0 < c ? -l : l,
  39980. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39981. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39982. n && n.copy(K).multiplyScalar(o).add(Z),
  39983. a
  39984. }
  39985. ),
  39986. intersectSphere: (X = new Ci.Vector3,
  39987. function(e, t) {
  39988. X.subVectors(e.center, this.origin);
  39989. var i = X.dot(this.direction)
  39990. , n = X.dot(X) - i * i
  39991. , r = e.radius * e.radius;
  39992. if (r < n)
  39993. return null;
  39994. var o = Math.sqrt(r - n)
  39995. , a = i - o
  39996. , s = i + o;
  39997. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39998. }
  39999. ),
  40000. intersectsSphere: function(e) {
  40001. return this.distanceToPoint(e.center) <= e.radius
  40002. },
  40003. distanceToPlane: function(e) {
  40004. var t = e.normal.dot(this.direction);
  40005. if (0 === t)
  40006. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40007. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40008. return 0 <= i ? i : null
  40009. },
  40010. intersectPlane: function(e, t) {
  40011. var i = this.distanceToPlane(e);
  40012. return null === i ? null : this.at(i, t)
  40013. },
  40014. intersectsPlane: function(e) {
  40015. var t = e.distanceToPoint(this.origin);
  40016. return 0 === t || e.normal.dot(this.direction) * t < 0
  40017. },
  40018. intersectBox: function(e, t) {
  40019. 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;
  40020. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40021. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40022. (e.min.x - u.x) * l),
  40023. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40024. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40025. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40026. (o < n || n != n) && (n = o),
  40027. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40028. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40029. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40030. (s < n || n != n) && (n = s),
  40031. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40032. },
  40033. intersectsBox: (q = new Ci.Vector3,
  40034. function(e) {
  40035. return null !== this.intersectBox(e, q)
  40036. }
  40037. ),
  40038. intersectTriangle: (G = new Ci.Vector3,
  40039. W = new Ci.Vector3,
  40040. j = new Ci.Vector3,
  40041. Y = new Ci.Vector3,
  40042. function(e, t, i, n, r) {
  40043. W.subVectors(t, e),
  40044. j.subVectors(i, e),
  40045. Y.crossVectors(W, j);
  40046. var o, a = this.direction.dot(Y);
  40047. if (0 < a) {
  40048. if (n)
  40049. return null;
  40050. o = 1
  40051. } else {
  40052. if (!(a < 0))
  40053. return null;
  40054. o = -1,
  40055. a = -a
  40056. }
  40057. G.subVectors(this.origin, e);
  40058. var s = o * this.direction.dot(j.crossVectors(G, j));
  40059. if (s < 0)
  40060. return null;
  40061. var l = o * this.direction.dot(W.cross(G));
  40062. if (l < 0)
  40063. return null;
  40064. if (a < s + l)
  40065. return null;
  40066. var c = -o * G.dot(Y);
  40067. return c < 0 ? null : this.at(c / a, r)
  40068. }
  40069. ),
  40070. applyMatrix4: function(e) {
  40071. return this.direction.add(this.origin).applyMatrix4(e),
  40072. this.origin.applyMatrix4(e),
  40073. this.direction.sub(this.origin),
  40074. this.direction.normalize(),
  40075. this
  40076. },
  40077. equals: function(e) {
  40078. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40079. }
  40080. },
  40081. Ci.Sphere = function(e, t) {
  40082. this.center = void 0 !== e ? e : new Ci.Vector3,
  40083. this.radius = void 0 !== t ? t : 0
  40084. }
  40085. ,
  40086. Ci.Sphere.prototype = {
  40087. constructor: Ci.Sphere,
  40088. set: function(e, t) {
  40089. return this.center.copy(e),
  40090. this.radius = t,
  40091. this
  40092. },
  40093. setFromPoints: (z = new Ci.Box3,
  40094. function(e, t) {
  40095. var i = this.center;
  40096. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40097. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40098. n = Math.max(n, i.distanceToSquared(e[r]));
  40099. return this.radius = Math.sqrt(n),
  40100. this
  40101. }
  40102. ),
  40103. clone: function() {
  40104. return (new this.constructor).copy(this)
  40105. },
  40106. copy: function(e) {
  40107. return this.center.copy(e.center),
  40108. this.radius = e.radius,
  40109. this
  40110. },
  40111. empty: function() {
  40112. return this.radius <= 0
  40113. },
  40114. containsPoint: function(e) {
  40115. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40116. },
  40117. distanceToPoint: function(e) {
  40118. return e.distanceTo(this.center) - this.radius
  40119. },
  40120. intersectsSphere: function(e) {
  40121. var t = this.radius + e.radius;
  40122. return e.center.distanceToSquared(this.center) <= t * t
  40123. },
  40124. intersectsBox: function(e) {
  40125. return e.intersectsSphere(this)
  40126. },
  40127. intersectsPlane: function(e) {
  40128. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40129. },
  40130. clampPoint: function(e, t) {
  40131. var i = this.center.distanceToSquared(e)
  40132. , n = t || new Ci.Vector3;
  40133. return n.copy(e),
  40134. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40135. n.multiplyScalar(this.radius).add(this.center)),
  40136. n
  40137. },
  40138. getBoundingBox: function(e) {
  40139. var t = e || new Ci.Box3;
  40140. return t.set(this.center, this.center),
  40141. t.expandByScalar(this.radius),
  40142. t
  40143. },
  40144. applyMatrix4: function(e) {
  40145. return this.center.applyMatrix4(e),
  40146. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40147. this
  40148. },
  40149. translate: function(e) {
  40150. return this.center.add(e),
  40151. this
  40152. },
  40153. equals: function(e) {
  40154. return e.center.equals(this.center) && e.radius === this.radius
  40155. }
  40156. },
  40157. Ci.Frustum = function(e, t, i, n, r, o) {
  40158. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  40159. }
  40160. ,
  40161. Ci.Frustum.prototype = {
  40162. constructor: Ci.Frustum,
  40163. set: function(e, t, i, n, r, o) {
  40164. var a = this.planes;
  40165. return a[0].copy(e),
  40166. a[1].copy(t),
  40167. a[2].copy(i),
  40168. a[3].copy(n),
  40169. a[4].copy(r),
  40170. a[5].copy(o),
  40171. this
  40172. },
  40173. clone: function() {
  40174. return (new this.constructor).copy(this)
  40175. },
  40176. copy: function(e) {
  40177. for (var t = this.planes, i = 0; i < 6; i++)
  40178. t[i].copy(e.planes[i]);
  40179. return this
  40180. },
  40181. setFromMatrix: function(e) {
  40182. var t = this.planes
  40183. , i = e.elements
  40184. , n = i[0]
  40185. , r = i[1]
  40186. , o = i[2]
  40187. , a = i[3]
  40188. , s = i[4]
  40189. , l = i[5]
  40190. , c = i[6]
  40191. , h = i[7]
  40192. , u = i[8]
  40193. , d = i[9]
  40194. , p = i[10]
  40195. , f = i[11]
  40196. , g = i[12]
  40197. , m = i[13]
  40198. , v = i[14]
  40199. , y = i[15];
  40200. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40201. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40202. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40203. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40204. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40205. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40206. this
  40207. },
  40208. intersectsObject: (H = new Ci.Sphere,
  40209. function(e) {
  40210. var t = e.geometry;
  40211. return null === t.boundingSphere && t.computeBoundingSphere(),
  40212. H.copy(t.boundingSphere),
  40213. H.applyMatrix4(e.matrixWorld),
  40214. this.intersectsSphere(H)
  40215. }
  40216. ),
  40217. intersectsSphere: function(e) {
  40218. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40219. if (t[r].distanceToPoint(i) < n)
  40220. return !1
  40221. }
  40222. return !0
  40223. },
  40224. intersectsBox: (k = new Ci.Vector3,
  40225. U = new Ci.Vector3,
  40226. function(e) {
  40227. for (var t = this.planes, i = 0; i < 6; i++) {
  40228. var n = t[i];
  40229. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40230. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40231. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40232. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40233. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40234. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40235. var r = n.distanceToPoint(k)
  40236. , o = n.distanceToPoint(U);
  40237. if (r < 0 && o < 0)
  40238. return !1
  40239. }
  40240. return !0
  40241. }
  40242. ),
  40243. containsPoint: function(e) {
  40244. for (var t = this.planes, i = 0; i < 6; i++)
  40245. if (t[i].distanceToPoint(e) < 0)
  40246. return !1;
  40247. return !0
  40248. }
  40249. },
  40250. Ci.Plane = function(e, t) {
  40251. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40252. this.constant = void 0 !== t ? t : 0
  40253. }
  40254. ,
  40255. Ci.Plane.prototype = {
  40256. constructor: Ci.Plane,
  40257. set: function(e, t) {
  40258. return this.normal.copy(e),
  40259. this.constant = t,
  40260. this
  40261. },
  40262. setComponents: function(e, t, i, n) {
  40263. return this.normal.set(e, t, i),
  40264. this.constant = n,
  40265. this
  40266. },
  40267. setFromNormalAndCoplanarPoint: function(e, t) {
  40268. return this.normal.copy(e),
  40269. this.constant = -t.dot(this.normal),
  40270. this
  40271. },
  40272. setFromCoplanarPoints: (B = new Ci.Vector3,
  40273. V = new Ci.Vector3,
  40274. function(e, t, i) {
  40275. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40276. return this.setFromNormalAndCoplanarPoint(n, e),
  40277. this
  40278. }
  40279. ),
  40280. clone: function() {
  40281. return (new this.constructor).copy(this)
  40282. },
  40283. copy: function(e) {
  40284. return this.normal.copy(e.normal),
  40285. this.constant = e.constant,
  40286. this
  40287. },
  40288. normalize: function() {
  40289. var e = 1 / this.normal.length();
  40290. return this.normal.multiplyScalar(e),
  40291. this.constant *= e,
  40292. this
  40293. },
  40294. negate: function() {
  40295. return this.constant *= -1,
  40296. this.normal.negate(),
  40297. this
  40298. },
  40299. distanceToPoint: function(e) {
  40300. return this.normal.dot(e) + this.constant
  40301. },
  40302. distanceToSphere: function(e) {
  40303. return this.distanceToPoint(e.center) - e.radius
  40304. },
  40305. projectPoint: function(e, t) {
  40306. return this.orthoPoint(e, t).sub(e).negate()
  40307. },
  40308. orthoPoint: function(e, t) {
  40309. var i = this.distanceToPoint(e);
  40310. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40311. },
  40312. intersectLine: (F = new Ci.Vector3,
  40313. function(e, t) {
  40314. var i = t || new Ci.Vector3
  40315. , n = e.delta(F)
  40316. , r = this.normal.dot(n);
  40317. if (0 !== r) {
  40318. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40319. if (!(o < 0 || 1 < o))
  40320. return i.copy(n).multiplyScalar(o).add(e.start)
  40321. } else if (0 === this.distanceToPoint(e.start))
  40322. return i.copy(e.start)
  40323. }
  40324. ),
  40325. intersectsLine: function(e) {
  40326. var t = this.distanceToPoint(e.start)
  40327. , i = this.distanceToPoint(e.end);
  40328. return t < 0 && 0 < i || i < 0 && 0 < t
  40329. },
  40330. intersectsBox: function(e) {
  40331. return e.intersectsPlane(this)
  40332. },
  40333. intersectsSphere: function(e) {
  40334. return e.intersectsPlane(this)
  40335. },
  40336. coplanarPoint: function(e) {
  40337. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40338. },
  40339. applyMatrix4: (L = new Ci.Vector3,
  40340. D = new Ci.Vector3,
  40341. N = new Ci.Matrix3,
  40342. function(e, t) {
  40343. var i = t || N.getNormalMatrix(e)
  40344. , n = L.copy(this.normal).applyMatrix3(i)
  40345. , r = this.coplanarPoint(D);
  40346. return r.applyMatrix4(e),
  40347. this.setFromNormalAndCoplanarPoint(n, r),
  40348. this
  40349. }
  40350. ),
  40351. translate: function(e) {
  40352. return this.constant = this.constant - e.dot(this.normal),
  40353. this
  40354. },
  40355. equals: function(e) {
  40356. return e.normal.equals(this.normal) && e.constant === this.constant
  40357. }
  40358. },
  40359. Ci.Spherical = function(e, t, i) {
  40360. return this.radius = void 0 !== e ? e : 1,
  40361. this.phi = void 0 !== t ? t : 0,
  40362. this.theta = void 0 !== i ? i : 0,
  40363. this
  40364. }
  40365. ,
  40366. Ci.Spherical.prototype = {
  40367. constructor: Ci.Spherical,
  40368. set: function(e, t, i) {
  40369. this.radius = e,
  40370. this.phi = t,
  40371. this.theta = i
  40372. },
  40373. clone: function() {
  40374. return (new this.constructor).copy(this)
  40375. },
  40376. copy: function(e) {
  40377. return this.radius.copy(e.radius),
  40378. this.phi.copy(e.phi),
  40379. this.theta.copy(e.theta),
  40380. this
  40381. },
  40382. makeSafe: function() {
  40383. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40384. },
  40385. setFromVector3: function(e) {
  40386. return this.radius = e.length(),
  40387. 0 === this.radius ? (this.theta = 0,
  40388. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40389. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40390. this
  40391. }
  40392. },
  40393. Ci.Math = {
  40394. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40395. P = new Array(36),
  40396. O = 0,
  40397. function() {
  40398. for (var e = 0; e < 36; e++)
  40399. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40400. M = 15 & O,
  40401. O >>= 4,
  40402. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40403. return P.join("")
  40404. }
  40405. ),
  40406. clamp: function(e, t, i) {
  40407. return Math.max(t, Math.min(i, e))
  40408. },
  40409. euclideanModulo: function(e, t) {
  40410. return (e % t + t) % t
  40411. },
  40412. mapLinear: function(e, t, i, n, r) {
  40413. return n + (e - t) * (r - n) / (i - t)
  40414. },
  40415. smoothstep: function(e, t, i) {
  40416. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40417. },
  40418. smootherstep: function(e, t, i) {
  40419. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40420. },
  40421. random16: function() {
  40422. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40423. Math.random()
  40424. },
  40425. randInt: function(e, t) {
  40426. return e + Math.floor(Math.random() * (t - e + 1))
  40427. },
  40428. randFloat: function(e, t) {
  40429. return e + Math.random() * (t - e)
  40430. },
  40431. randFloatSpread: function(e) {
  40432. return e * (.5 - Math.random())
  40433. },
  40434. degToRad: (S = Math.PI / 180,
  40435. function(e) {
  40436. return e * S
  40437. }
  40438. ),
  40439. radToDeg: (x = 180 / Math.PI,
  40440. function(e) {
  40441. return e * x
  40442. }
  40443. ),
  40444. isPowerOfTwo: function(e) {
  40445. return 0 == (e & e - 1) && 0 !== e
  40446. },
  40447. nearestPowerOfTwo: function(e) {
  40448. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40449. },
  40450. nextPowerOfTwo: function(e) {
  40451. return e--,
  40452. e |= e >> 1,
  40453. e |= e >> 2,
  40454. e |= e >> 4,
  40455. e |= e >> 8,
  40456. e |= e >> 16,
  40457. ++e
  40458. }
  40459. },
  40460. Ci.Spline = function(e) {
  40461. function t(e, t, i, n, r, o, a) {
  40462. var s = .5 * (i - e)
  40463. , l = .5 * (n - t);
  40464. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40465. }
  40466. this.points = e;
  40467. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40468. x: 0,
  40469. y: 0,
  40470. z: 0
  40471. };
  40472. this.initFromArray = function(e) {
  40473. this.points = [];
  40474. for (var t = 0; t < e.length; t++)
  40475. this.points[t] = {
  40476. x: e[t][0],
  40477. y: e[t][1],
  40478. z: e[t][2]
  40479. }
  40480. }
  40481. ,
  40482. this.getPoint = function(e) {
  40483. return i = (this.points.length - 1) * e,
  40484. n = Math.floor(i),
  40485. r = i - n,
  40486. u[0] = 0 === n ? n : n - 1,
  40487. u[1] = n,
  40488. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40489. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40490. s = this.points[u[0]],
  40491. l = this.points[u[1]],
  40492. c = this.points[u[2]],
  40493. h = this.points[u[3]],
  40494. a = r * (o = r * r),
  40495. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40496. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40497. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40498. d
  40499. }
  40500. ,
  40501. this.getControlPointsArray = function() {
  40502. var e, t, i = this.points.length, n = [];
  40503. for (e = 0; e < i; e++)
  40504. t = this.points[e],
  40505. n[e] = [t.x, t.y, t.z];
  40506. return n
  40507. }
  40508. ,
  40509. this.getLength = function(e) {
  40510. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40511. for (h[0] = 0,
  40512. e = e || 100,
  40513. n = this.points.length * e,
  40514. l.copy(this.points[0]),
  40515. t = 1; t < n; t++)
  40516. i = t / n,
  40517. r = this.getPoint(i),
  40518. c.copy(r),
  40519. u += c.distanceTo(l),
  40520. l.copy(r),
  40521. o = (this.points.length - 1) * i,
  40522. (a = Math.floor(o)) !== s && (h[a] = u,
  40523. s = a);
  40524. return h[h.length] = u,
  40525. {
  40526. chunks: h,
  40527. total: u
  40528. }
  40529. }
  40530. ,
  40531. this.reparametrizeByArcLength = function(e) {
  40532. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40533. for (c.push(h.copy(this.points[0]).clone()),
  40534. t = 1; t < this.points.length; t++) {
  40535. for (a = u.chunks[t] - u.chunks[t - 1],
  40536. s = Math.ceil(e * a / u.total),
  40537. r = (t - 1) / (this.points.length - 1),
  40538. o = t / (this.points.length - 1),
  40539. i = 1; i < s - 1; i++)
  40540. n = r + i * (1 / s) * (o - r),
  40541. l = this.getPoint(n),
  40542. c.push(h.copy(l).clone());
  40543. c.push(h.copy(this.points[t]).clone())
  40544. }
  40545. this.points = c
  40546. }
  40547. }
  40548. ,
  40549. Ci.Triangle = function(e, t, i) {
  40550. this.a = void 0 !== e ? e : new Ci.Vector3,
  40551. this.b = void 0 !== t ? t : new Ci.Vector3,
  40552. this.c = void 0 !== i ? i : new Ci.Vector3
  40553. }
  40554. ,
  40555. Ci.Triangle.normal = (T = new Ci.Vector3,
  40556. function(e, t, i, n) {
  40557. var r = n || new Ci.Vector3;
  40558. r.subVectors(i, t),
  40559. T.subVectors(e, t),
  40560. r.cross(T);
  40561. var o = r.lengthSq();
  40562. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40563. }
  40564. ),
  40565. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40566. b = new Ci.Vector3,
  40567. w = new Ci.Vector3,
  40568. function(e, t, i, n, r) {
  40569. _.subVectors(n, t),
  40570. b.subVectors(i, t),
  40571. w.subVectors(e, t);
  40572. var o = _.dot(_)
  40573. , a = _.dot(b)
  40574. , s = _.dot(w)
  40575. , l = b.dot(b)
  40576. , c = b.dot(w)
  40577. , h = o * l - a * a
  40578. , u = r || new Ci.Vector3;
  40579. if (0 == h)
  40580. return u.set(-2, -1, -1);
  40581. var d = 1 / h
  40582. , p = (l * s - a * c) * d
  40583. , f = (o * c - a * s) * d;
  40584. return u.set(1 - p - f, f, p)
  40585. }
  40586. ),
  40587. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40588. function(e, t, i, n) {
  40589. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40590. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40591. }
  40592. ),
  40593. Ci.Triangle.prototype = {
  40594. constructor: Ci.Triangle,
  40595. set: function(e, t, i) {
  40596. return this.a.copy(e),
  40597. this.b.copy(t),
  40598. this.c.copy(i),
  40599. this
  40600. },
  40601. setFromPointsAndIndices: function(e, t, i, n) {
  40602. return this.a.copy(e[t]),
  40603. this.b.copy(e[i]),
  40604. this.c.copy(e[n]),
  40605. this
  40606. },
  40607. clone: function() {
  40608. return (new this.constructor).copy(this)
  40609. },
  40610. copy: function(e) {
  40611. return this.a.copy(e.a),
  40612. this.b.copy(e.b),
  40613. this.c.copy(e.c),
  40614. this
  40615. },
  40616. area: (C = new Ci.Vector3,
  40617. I = new Ci.Vector3,
  40618. function() {
  40619. return C.subVectors(this.c, this.b),
  40620. I.subVectors(this.a, this.b),
  40621. .5 * C.cross(I).length()
  40622. }
  40623. ),
  40624. midpoint: function(e) {
  40625. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40626. },
  40627. normal: function(e) {
  40628. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40629. },
  40630. plane: function(e) {
  40631. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40632. },
  40633. barycoordFromPoint: function(e, t) {
  40634. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40635. },
  40636. containsPoint: function(e) {
  40637. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40638. },
  40639. equals: function(e) {
  40640. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40641. }
  40642. },
  40643. Ci.Interpolant = function(e, t, i, n) {
  40644. this.parameterPositions = e,
  40645. this._cachedIndex = 0,
  40646. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40647. this.sampleValues = t,
  40648. this.valueSize = i
  40649. }
  40650. ,
  40651. Ci.Interpolant.prototype = {
  40652. constructor: Ci.Interpolant,
  40653. evaluate: function(e) {
  40654. var t = this.parameterPositions
  40655. , i = this._cachedIndex
  40656. , n = t[i]
  40657. , r = t[i - 1];
  40658. e: {
  40659. t: {
  40660. var o;
  40661. i: {
  40662. n: if (!(e < n)) {
  40663. for (var a = i + 2; ; ) {
  40664. if (void 0 === n) {
  40665. if (e < r)
  40666. break n;
  40667. return i = t.length,
  40668. this._cachedIndex = i,
  40669. this.afterEnd_(i - 1, e, r)
  40670. }
  40671. if (i === a)
  40672. break;
  40673. if (r = n,
  40674. e < (n = t[++i]))
  40675. break t
  40676. }
  40677. o = t.length;
  40678. break i
  40679. }
  40680. if (r <= e)
  40681. break e;
  40682. var s = t[1];
  40683. e < s && (i = 2,
  40684. r = s);
  40685. for (a = i - 2; ; ) {
  40686. if (void 0 === r)
  40687. return this._cachedIndex = 0,
  40688. this.beforeStart_(0, e, n);
  40689. if (i === a)
  40690. break;
  40691. if (n = r,
  40692. (r = t[--i - 1]) <= e)
  40693. break t
  40694. }
  40695. o = i,
  40696. i = 0
  40697. }
  40698. for (; i < o; ) {
  40699. var l = i + o >>> 1;
  40700. e < t[l] ? o = l : i = 1 + l
  40701. }
  40702. if (n = t[i],
  40703. void 0 === (r = t[i - 1]))
  40704. return this._cachedIndex = 0,
  40705. this.beforeStart_(0, e, n);
  40706. if (void 0 === n)
  40707. return i = t.length,
  40708. this._cachedIndex = i,
  40709. this.afterEnd_(i - 1, r, e)
  40710. }
  40711. this._cachedIndex = i,
  40712. this.intervalChanged_(i, r, n)
  40713. }
  40714. return this.interpolate_(i, r, e, n)
  40715. },
  40716. settings: null,
  40717. DefaultSettings_: {},
  40718. getSettings_: function() {
  40719. return this.settings || this.DefaultSettings_
  40720. },
  40721. copySampleValue_: function(e) {
  40722. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40723. t[o] = i[r + o];
  40724. return t
  40725. },
  40726. interpolate_: function(e, t, i, n) {
  40727. throw new Error("call to abstract method")
  40728. },
  40729. intervalChanged_: function(e, t, i) {}
  40730. },
  40731. Object.assign(Ci.Interpolant.prototype, {
  40732. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40733. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40734. }),
  40735. Ci.CubicInterpolant = function(e, t, i, n) {
  40736. Ci.Interpolant.call(this, e, t, i, n),
  40737. this._weightPrev = -0,
  40738. this._offsetPrev = -0,
  40739. this._weightNext = -0,
  40740. this._offsetNext = -0
  40741. }
  40742. ,
  40743. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40744. constructor: Ci.CubicInterpolant,
  40745. DefaultSettings_: {
  40746. endingStart: Ci.ZeroCurvatureEnding,
  40747. endingEnd: Ci.ZeroCurvatureEnding
  40748. },
  40749. intervalChanged_: function(e, t, i) {
  40750. var n = this.parameterPositions
  40751. , r = e - 2
  40752. , o = e + 1
  40753. , a = n[r]
  40754. , s = n[o];
  40755. if (void 0 === a)
  40756. switch (this.getSettings_().endingStart) {
  40757. case Ci.ZeroSlopeEnding:
  40758. r = e,
  40759. a = 2 * t - i;
  40760. break;
  40761. case Ci.WrapAroundEnding:
  40762. a = t + n[r = n.length - 2] - n[r + 1];
  40763. break;
  40764. default:
  40765. r = e,
  40766. a = i
  40767. }
  40768. if (void 0 === s)
  40769. switch (this.getSettings_().endingEnd) {
  40770. case Ci.ZeroSlopeEnding:
  40771. o = e,
  40772. s = 2 * i - t;
  40773. break;
  40774. case Ci.WrapAroundEnding:
  40775. s = i + n[o = 1] - n[0];
  40776. break;
  40777. default:
  40778. o = e - 1,
  40779. s = t
  40780. }
  40781. var l = .5 * (i - t)
  40782. , c = this.valueSize;
  40783. this._weightPrev = l / (t - a),
  40784. this._weightNext = l / (s - i),
  40785. this._offsetPrev = r * c,
  40786. this._offsetNext = o * c
  40787. },
  40788. interpolate_: function(e, t, i, n) {
  40789. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  40790. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40791. return r
  40792. }
  40793. }),
  40794. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40795. Ci.Interpolant.call(this, e, t, i, n)
  40796. }
  40797. ,
  40798. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40799. constructor: Ci.DiscreteInterpolant,
  40800. interpolate_: function(e, t, i, n) {
  40801. return this.copySampleValue_(e - 1)
  40802. }
  40803. }),
  40804. Ci.LinearInterpolant = function(e, t, i, n) {
  40805. Ci.Interpolant.call(this, e, t, i, n)
  40806. }
  40807. ,
  40808. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40809. constructor: Ci.LinearInterpolant,
  40810. interpolate_: function(e, t, i, n) {
  40811. 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)
  40812. r[u] = o[l + u] * h + o[s + u] * c;
  40813. return r
  40814. }
  40815. }),
  40816. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40817. Ci.Interpolant.call(this, e, t, i, n)
  40818. }
  40819. ,
  40820. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40821. constructor: Ci.QuaternionLinearInterpolant,
  40822. interpolate_: function(e, t, i, n) {
  40823. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  40824. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40825. return r
  40826. }
  40827. }),
  40828. Ci.Clock = function(e) {
  40829. this.autoStart = void 0 === e || e,
  40830. this.startTime = 0,
  40831. this.oldTime = 0,
  40832. this.elapsedTime = 0,
  40833. this.running = !1
  40834. }
  40835. ,
  40836. Ci.Clock.prototype = {
  40837. constructor: Ci.Clock,
  40838. start: function() {
  40839. this.startTime = performance.now(),
  40840. this.oldTime = this.startTime,
  40841. this.running = !0
  40842. },
  40843. stop: function() {
  40844. this.getElapsedTime(),
  40845. this.running = !1
  40846. },
  40847. getElapsedTime: function() {
  40848. return this.getDelta(),
  40849. this.elapsedTime
  40850. },
  40851. getDelta: function() {
  40852. var e = 0;
  40853. if (this.autoStart && !this.running && this.start(),
  40854. this.running) {
  40855. var t = performance.now();
  40856. e = .001 * (t - this.oldTime),
  40857. this.oldTime = t,
  40858. this.elapsedTime += e
  40859. }
  40860. return e
  40861. }
  40862. },
  40863. Ci.EventDispatcher = function() {}
  40864. ,
  40865. Ci.EventDispatcher.prototype = {
  40866. constructor: Ci.EventDispatcher,
  40867. apply: function(e) {
  40868. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40869. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40870. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40871. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40872. },
  40873. addEventListener: function(e, t) {
  40874. void 0 === this._listeners && (this._listeners = {});
  40875. var i = this._listeners;
  40876. void 0 === i[e] && (i[e] = []),
  40877. -1 === i[e].indexOf(t) && i[e].push(t)
  40878. },
  40879. hasEventListener: function(e, t) {
  40880. if (void 0 === this._listeners)
  40881. return !1;
  40882. var i = this._listeners;
  40883. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40884. },
  40885. removeEventListener: function(e, t) {
  40886. if (void 0 !== this._listeners) {
  40887. var i = this._listeners[e];
  40888. if (void 0 !== i) {
  40889. var n = i.indexOf(t);
  40890. -1 !== n && i.splice(n, 1)
  40891. }
  40892. }
  40893. },
  40894. dispatchEvent: function(e) {
  40895. if (void 0 !== this._listeners) {
  40896. var t = this._listeners[e.type];
  40897. if (void 0 !== t) {
  40898. e.target = this;
  40899. for (var i = [], n = t.length, r = 0; r < n; r++)
  40900. i[r] = t[r];
  40901. for (r = 0; r < n; r++)
  40902. i[r].call(this, e)
  40903. }
  40904. }
  40905. }
  40906. },
  40907. Ci.Layers = function() {
  40908. this.mask = 1
  40909. }
  40910. ,
  40911. Ci.Layers.prototype = {
  40912. constructor: Ci.Layers,
  40913. set: function(e) {
  40914. this.mask = 1 << e
  40915. },
  40916. enable: function(e) {
  40917. this.mask |= 1 << e
  40918. },
  40919. toggle: function(e) {
  40920. this.mask ^= 1 << e
  40921. },
  40922. disable: function(e) {
  40923. this.mask &= ~(1 << e)
  40924. },
  40925. test: function(e) {
  40926. return 0 != (this.mask & e.mask)
  40927. }
  40928. },
  40929. (A = Ci).Raycaster = function(e, t, i, n) {
  40930. this.ray = new A.Ray(e,t),
  40931. this.near = i || 0,
  40932. this.far = n || 1 / 0,
  40933. this.params = {
  40934. Mesh: {},
  40935. Line: {},
  40936. LOD: {},
  40937. Points: {
  40938. threshold: 1
  40939. },
  40940. Sprite: {}
  40941. },
  40942. Object.defineProperties(this.params, {
  40943. PointCloud: {
  40944. get: function() {
  40945. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40946. this.Points
  40947. }
  40948. }
  40949. })
  40950. }
  40951. ,
  40952. A.Raycaster.prototype = {
  40953. constructor: A.Raycaster,
  40954. linePrecision: 1,
  40955. set: function(e, t) {
  40956. this.ray.set(e, t)
  40957. },
  40958. setFromCamera: function(e, t) {
  40959. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40960. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  40961. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40962. },
  40963. intersectObject: function(e, t) {
  40964. var i = [];
  40965. return Ei(e, this, i, t),
  40966. i.sort(Ii),
  40967. i
  40968. },
  40969. intersectObjects: function(e, t) {
  40970. var i = [];
  40971. if (!1 === Array.isArray(e))
  40972. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40973. i;
  40974. for (var n = 0, r = e.length; n < r; n++)
  40975. Ei(e[n], this, i, t);
  40976. return i.sort(Ii),
  40977. i
  40978. }
  40979. },
  40980. Ci.Object3D = function() {
  40981. Object.defineProperty(this, "id", {
  40982. value: Ci.Object3DIdCount++
  40983. }),
  40984. this.uuid = Ci.Math.generateUUID(),
  40985. this.name = "",
  40986. this.type = "Object3D",
  40987. this.parent = null,
  40988. this.children = [],
  40989. this.up = Ci.Object3D.DefaultUp.clone();
  40990. var e = new Ci.Vector3
  40991. , t = new Ci.Euler
  40992. , i = new Ci.Quaternion
  40993. , n = new Ci.Vector3(1,1,1);
  40994. t.onChange(function() {
  40995. i.setFromEuler(t, !1)
  40996. }),
  40997. i.onChange(function() {
  40998. t.setFromQuaternion(i, void 0, !1)
  40999. }),
  41000. Object.defineProperties(this, {
  41001. position: {
  41002. enumerable: !0,
  41003. value: e
  41004. },
  41005. rotation: {
  41006. enumerable: !0,
  41007. value: t
  41008. },
  41009. quaternion: {
  41010. enumerable: !0,
  41011. value: i
  41012. },
  41013. scale: {
  41014. enumerable: !0,
  41015. value: n
  41016. },
  41017. modelViewMatrix: {
  41018. value: new Ci.Matrix4
  41019. },
  41020. normalMatrix: {
  41021. value: new Ci.Matrix3
  41022. }
  41023. }),
  41024. this.rotationAutoUpdate = !0,
  41025. this.matrix = new Ci.Matrix4,
  41026. this.matrixWorld = new Ci.Matrix4,
  41027. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41028. this.matrixWorldNeedsUpdate = !1,
  41029. this.layers = new Ci.Layers,
  41030. this.visible = !0,
  41031. this.castShadow = !1,
  41032. this.receiveShadow = !1,
  41033. this.frustumCulled = !0,
  41034. this.renderOrder = 0,
  41035. this.userData = {}
  41036. }
  41037. ,
  41038. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41039. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41040. Ci.Object3D.prototype = {
  41041. constructor: Ci.Object3D,
  41042. applyMatrix: function(e) {
  41043. this.matrix.multiplyMatrices(e, this.matrix),
  41044. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41045. },
  41046. setRotationFromAxisAngle: function(e, t) {
  41047. this.quaternion.setFromAxisAngle(e, t)
  41048. },
  41049. setRotationFromEuler: function(e) {
  41050. this.quaternion.setFromEuler(e, !0)
  41051. },
  41052. setRotationFromMatrix: function(e) {
  41053. this.quaternion.setFromRotationMatrix(e)
  41054. },
  41055. setRotationFromQuaternion: function(e) {
  41056. this.quaternion.copy(e)
  41057. },
  41058. rotateOnAxis: (y = new Ci.Quaternion,
  41059. function(e, t) {
  41060. return y.setFromAxisAngle(e, t),
  41061. this.quaternion.multiply(y),
  41062. this
  41063. }
  41064. ),
  41065. rotateX: (v = new Ci.Vector3(1,0,0),
  41066. function(e) {
  41067. return this.rotateOnAxis(v, e)
  41068. }
  41069. ),
  41070. rotateY: (m = new Ci.Vector3(0,1,0),
  41071. function(e) {
  41072. return this.rotateOnAxis(m, e)
  41073. }
  41074. ),
  41075. rotateZ: (g = new Ci.Vector3(0,0,1),
  41076. function(e) {
  41077. return this.rotateOnAxis(g, e)
  41078. }
  41079. ),
  41080. translateOnAxis: (f = new Ci.Vector3,
  41081. function(e, t) {
  41082. return f.copy(e).applyQuaternion(this.quaternion),
  41083. this.position.add(f.multiplyScalar(t)),
  41084. this
  41085. }
  41086. ),
  41087. translateX: (p = new Ci.Vector3(1,0,0),
  41088. function(e) {
  41089. return this.translateOnAxis(p, e)
  41090. }
  41091. ),
  41092. translateY: (d = new Ci.Vector3(0,1,0),
  41093. function(e) {
  41094. return this.translateOnAxis(d, e)
  41095. }
  41096. ),
  41097. translateZ: (u = new Ci.Vector3(0,0,1),
  41098. function(e) {
  41099. return this.translateOnAxis(u, e)
  41100. }
  41101. ),
  41102. localToWorld: function(e) {
  41103. return e.applyMatrix4(this.matrixWorld)
  41104. },
  41105. worldToLocal: (h = new Ci.Matrix4,
  41106. function(e) {
  41107. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41108. }
  41109. ),
  41110. lookAt: (c = new Ci.Matrix4,
  41111. function(e) {
  41112. c.lookAt(e, this.position, this.up),
  41113. this.quaternion.setFromRotationMatrix(c)
  41114. }
  41115. ),
  41116. add: function(e) {
  41117. if (1 < arguments.length) {
  41118. for (var t = 0; t < arguments.length; t++)
  41119. this.add(arguments[t]);
  41120. return this
  41121. }
  41122. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  41123. e.parent = this,
  41124. e.dispatchEvent({
  41125. type: "added"
  41126. }),
  41127. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41128. this
  41129. },
  41130. remove: function(e) {
  41131. if (1 < arguments.length)
  41132. for (var t = 0; t < arguments.length; t++)
  41133. this.remove(arguments[t]);
  41134. var i = this.children.indexOf(e);
  41135. -1 !== i && (e.parent = null,
  41136. e.dispatchEvent({
  41137. type: "removed"
  41138. }),
  41139. this.children.splice(i, 1))
  41140. },
  41141. getObjectById: function(e) {
  41142. return this.getObjectByProperty("id", e)
  41143. },
  41144. getObjectByName: function(e) {
  41145. return this.getObjectByProperty("name", e)
  41146. },
  41147. getObjectByProperty: function(e, t) {
  41148. if (this[e] === t)
  41149. return this;
  41150. for (var i = 0, n = this.children.length; i < n; i++) {
  41151. var r = this.children[i].getObjectByProperty(e, t);
  41152. if (void 0 !== r)
  41153. return r
  41154. }
  41155. },
  41156. getWorldPosition: function(e) {
  41157. var t = e || new Ci.Vector3;
  41158. return this.updateMatrixWorld(!0),
  41159. t.setFromMatrixPosition(this.matrixWorld)
  41160. },
  41161. getWorldQuaternion: (s = new Ci.Vector3,
  41162. l = new Ci.Vector3,
  41163. function(e) {
  41164. var t = e || new Ci.Quaternion;
  41165. return this.updateMatrixWorld(!0),
  41166. this.matrixWorld.decompose(s, t, l),
  41167. t
  41168. }
  41169. ),
  41170. getWorldRotation: (a = new Ci.Quaternion,
  41171. function(e) {
  41172. var t = e || new Ci.Euler;
  41173. return this.getWorldQuaternion(a),
  41174. t.setFromQuaternion(a, this.rotation.order, !1)
  41175. }
  41176. ),
  41177. getWorldScale: (r = new Ci.Vector3,
  41178. o = new Ci.Quaternion,
  41179. function(e) {
  41180. var t = e || new Ci.Vector3;
  41181. return this.updateMatrixWorld(!0),
  41182. this.matrixWorld.decompose(r, o, t),
  41183. t
  41184. }
  41185. ),
  41186. getWorldDirection: (n = new Ci.Quaternion,
  41187. function(e) {
  41188. var t = e || new Ci.Vector3;
  41189. return this.getWorldQuaternion(n),
  41190. t.set(0, 0, 1).applyQuaternion(n)
  41191. }
  41192. ),
  41193. raycast: function() {},
  41194. traverse: function(e) {
  41195. e(this);
  41196. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41197. t[i].traverse(e)
  41198. },
  41199. traverseVisible: function(e) {
  41200. if (!1 !== this.visible) {
  41201. e(this);
  41202. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41203. t[i].traverseVisible(e)
  41204. }
  41205. },
  41206. traverseAncestors: function(e) {
  41207. var t = this.parent;
  41208. null !== t && (e(t),
  41209. t.traverseAncestors(e))
  41210. },
  41211. updateMatrix: function() {
  41212. this.matrix.compose(this.position, this.quaternion, this.scale),
  41213. this.matrixWorldNeedsUpdate = !0
  41214. },
  41215. updateMatrixWorld: function(e) {
  41216. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41217. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41218. e = !(this.matrixWorldNeedsUpdate = !1));
  41219. for (var t = 0, i = this.children.length; t < i; t++)
  41220. this.children[t].updateMatrixWorld(e)
  41221. },
  41222. toJSON: function(e) {
  41223. function t(e) {
  41224. var t = [];
  41225. for (var i in e) {
  41226. var n = e[i];
  41227. delete n.metadata,
  41228. t.push(n)
  41229. }
  41230. return t
  41231. }
  41232. var i = void 0 === e
  41233. , n = {};
  41234. i && (e = {
  41235. geometries: {},
  41236. materials: {},
  41237. textures: {},
  41238. images: {}
  41239. },
  41240. n.metadata = {
  41241. version: 4.4,
  41242. type: "Object",
  41243. generator: "Object3D.toJSON"
  41244. });
  41245. var r = {};
  41246. if (r.uuid = this.uuid,
  41247. r.type = this.type,
  41248. "" !== this.name && (r.name = this.name),
  41249. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41250. !0 === this.castShadow && (r.castShadow = !0),
  41251. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41252. !1 === this.visible && (r.visible = !1),
  41253. r.matrix = this.matrix.toArray(),
  41254. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41255. r.geometry = this.geometry.uuid),
  41256. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41257. r.material = this.material.uuid),
  41258. 0 < this.children.length) {
  41259. r.children = [];
  41260. for (var o = 0; o < this.children.length; o++)
  41261. r.children.push(this.children[o].toJSON(e).object)
  41262. }
  41263. if (i) {
  41264. var a = t(e.geometries)
  41265. , s = t(e.materials)
  41266. , l = t(e.textures)
  41267. , c = t(e.images);
  41268. 0 < a.length && (n.geometries = a),
  41269. 0 < s.length && (n.materials = s),
  41270. 0 < l.length && (n.textures = l),
  41271. 0 < c.length && (n.images = c)
  41272. }
  41273. return n.object = r,
  41274. n
  41275. },
  41276. clone: function(e) {
  41277. return (new this.constructor).copy(this, e)
  41278. },
  41279. copy: function(e, t) {
  41280. if (void 0 === t && (t = !0),
  41281. this.name = e.name,
  41282. this.up.copy(e.up),
  41283. this.position.copy(e.position),
  41284. this.quaternion.copy(e.quaternion),
  41285. this.scale.copy(e.scale),
  41286. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41287. this.matrix.copy(e.matrix),
  41288. this.matrixWorld.copy(e.matrixWorld),
  41289. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41290. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41291. this.visible = e.visible,
  41292. this.castShadow = e.castShadow,
  41293. this.receiveShadow = e.receiveShadow,
  41294. this.frustumCulled = e.frustumCulled,
  41295. this.renderOrder = e.renderOrder,
  41296. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41297. !0 === t)
  41298. for (var i = 0; i < e.children.length; i++) {
  41299. var n = e.children[i];
  41300. this.add(n.clone())
  41301. }
  41302. return this
  41303. }
  41304. },
  41305. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41306. Ci.Object3DIdCount = 0,
  41307. Ci.Face3 = function(e, t, i, n, r, o) {
  41308. this.a = e,
  41309. this.b = t,
  41310. this.c = i,
  41311. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41312. this.vertexNormals = Array.isArray(n) ? n : [],
  41313. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41314. this.vertexColors = Array.isArray(r) ? r : [],
  41315. this.materialIndex = void 0 !== o ? o : 0
  41316. }
  41317. ,
  41318. Ci.Face3.prototype = {
  41319. constructor: Ci.Face3,
  41320. clone: function() {
  41321. return (new this.constructor).copy(this)
  41322. },
  41323. copy: function(e) {
  41324. this.a = e.a,
  41325. this.b = e.b,
  41326. this.c = e.c,
  41327. this.normal.copy(e.normal),
  41328. this.color.copy(e.color),
  41329. this.materialIndex = e.materialIndex;
  41330. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41331. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41332. for (t = 0,
  41333. i = e.vertexColors.length; t < i; t++)
  41334. this.vertexColors[t] = e.vertexColors[t].clone();
  41335. return this
  41336. }
  41337. },
  41338. Ci.BufferAttribute = function(e, t) {
  41339. this.uuid = Ci.Math.generateUUID(),
  41340. this.array = e,
  41341. this.itemSize = t,
  41342. this.dynamic = !1,
  41343. this.updateRange = {
  41344. offset: 0,
  41345. count: -1
  41346. },
  41347. this.version = 0
  41348. }
  41349. ,
  41350. Ci.BufferAttribute.prototype = {
  41351. constructor: Ci.BufferAttribute,
  41352. get count() {
  41353. return this.array.length / this.itemSize
  41354. },
  41355. set needsUpdate(e) {
  41356. !0 === e && this.version++
  41357. },
  41358. setDynamic: function(e) {
  41359. return this.dynamic = e,
  41360. this
  41361. },
  41362. copy: function(e) {
  41363. return this.array = new e.array.constructor(e.array),
  41364. this.itemSize = e.itemSize,
  41365. this.dynamic = e.dynamic,
  41366. this
  41367. },
  41368. copyAt: function(e, t, i) {
  41369. e *= this.itemSize,
  41370. i *= t.itemSize;
  41371. for (var n = 0, r = this.itemSize; n < r; n++)
  41372. this.array[e + n] = t.array[i + n];
  41373. return this
  41374. },
  41375. copyArray: function(e) {
  41376. return this.array.set(e),
  41377. this
  41378. },
  41379. copyColorsArray: function(e) {
  41380. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41381. var o = e[n];
  41382. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41383. o = new Ci.Color),
  41384. t[i++] = o.r,
  41385. t[i++] = o.g,
  41386. t[i++] = o.b
  41387. }
  41388. return this
  41389. },
  41390. copyIndicesArray: function(e) {
  41391. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41392. var o = e[n];
  41393. t[i++] = o.a,
  41394. t[i++] = o.b,
  41395. t[i++] = o.c
  41396. }
  41397. return this
  41398. },
  41399. copyVector2sArray: function(e) {
  41400. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41401. var o = e[n];
  41402. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41403. o = new Ci.Vector2),
  41404. t[i++] = o.x,
  41405. t[i++] = o.y
  41406. }
  41407. return this
  41408. },
  41409. copyVector3sArray: function(e) {
  41410. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41411. var o = e[n];
  41412. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41413. o = new Ci.Vector3),
  41414. t[i++] = o.x,
  41415. t[i++] = o.y,
  41416. t[i++] = o.z
  41417. }
  41418. return this
  41419. },
  41420. copyVector4sArray: function(e) {
  41421. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41422. var o = e[n];
  41423. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41424. o = new Ci.Vector4),
  41425. t[i++] = o.x,
  41426. t[i++] = o.y,
  41427. t[i++] = o.z,
  41428. t[i++] = o.w
  41429. }
  41430. return this
  41431. },
  41432. set: function(e, t) {
  41433. return void 0 === t && (t = 0),
  41434. this.array.set(e, t),
  41435. this
  41436. },
  41437. getX: function(e) {
  41438. return this.array[e * this.itemSize]
  41439. },
  41440. setX: function(e, t) {
  41441. return this.array[e * this.itemSize] = t,
  41442. this
  41443. },
  41444. getY: function(e) {
  41445. return this.array[e * this.itemSize + 1]
  41446. },
  41447. setY: function(e, t) {
  41448. return this.array[e * this.itemSize + 1] = t,
  41449. this
  41450. },
  41451. getZ: function(e) {
  41452. return this.array[e * this.itemSize + 2]
  41453. },
  41454. setZ: function(e, t) {
  41455. return this.array[e * this.itemSize + 2] = t,
  41456. this
  41457. },
  41458. getW: function(e) {
  41459. return this.array[e * this.itemSize + 3]
  41460. },
  41461. setW: function(e, t) {
  41462. return this.array[e * this.itemSize + 3] = t,
  41463. this
  41464. },
  41465. setXY: function(e, t, i) {
  41466. return e *= this.itemSize,
  41467. this.array[e + 0] = t,
  41468. this.array[e + 1] = i,
  41469. this
  41470. },
  41471. setXYZ: function(e, t, i, n) {
  41472. return e *= this.itemSize,
  41473. this.array[e + 0] = t,
  41474. this.array[e + 1] = i,
  41475. this.array[e + 2] = n,
  41476. this
  41477. },
  41478. setXYZW: function(e, t, i, n, r) {
  41479. return e *= this.itemSize,
  41480. this.array[e + 0] = t,
  41481. this.array[e + 1] = i,
  41482. this.array[e + 2] = n,
  41483. this.array[e + 3] = r,
  41484. this
  41485. },
  41486. clone: function() {
  41487. return (new this.constructor).copy(this)
  41488. }
  41489. },
  41490. Ci.Int8Attribute = function(e, t) {
  41491. return new Ci.BufferAttribute(new Int8Array(e),t)
  41492. }
  41493. ,
  41494. Ci.Uint8Attribute = function(e, t) {
  41495. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41496. }
  41497. ,
  41498. Ci.Uint8ClampedAttribute = function(e, t) {
  41499. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41500. }
  41501. ,
  41502. Ci.Int16Attribute = function(e, t) {
  41503. return new Ci.BufferAttribute(new Int16Array(e),t)
  41504. }
  41505. ,
  41506. Ci.Uint16Attribute = function(e, t) {
  41507. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41508. }
  41509. ,
  41510. Ci.Int32Attribute = function(e, t) {
  41511. return new Ci.BufferAttribute(new Int32Array(e),t)
  41512. }
  41513. ,
  41514. Ci.Uint32Attribute = function(e, t) {
  41515. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41516. }
  41517. ,
  41518. Ci.Float32Attribute = function(e, t) {
  41519. return new Ci.BufferAttribute(new Float32Array(e),t)
  41520. }
  41521. ,
  41522. Ci.Float64Attribute = function(e, t) {
  41523. return new Ci.BufferAttribute(new Float64Array(e),t)
  41524. }
  41525. ,
  41526. Ci.DynamicBufferAttribute = function(e, t) {
  41527. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41528. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41529. }
  41530. ,
  41531. Ci.InstancedBufferAttribute = function(e, t, i) {
  41532. Ci.BufferAttribute.call(this, e, t),
  41533. this.meshPerAttribute = i || 1
  41534. }
  41535. ,
  41536. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41537. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41538. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41539. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41540. this.meshPerAttribute = e.meshPerAttribute,
  41541. this
  41542. }
  41543. ,
  41544. Ci.InterleavedBuffer = function(e, t) {
  41545. this.uuid = Ci.Math.generateUUID(),
  41546. this.array = e,
  41547. this.stride = t,
  41548. this.dynamic = !1,
  41549. this.updateRange = {
  41550. offset: 0,
  41551. count: -1
  41552. },
  41553. this.version = 0
  41554. }
  41555. ,
  41556. Ci.InterleavedBuffer.prototype = {
  41557. constructor: Ci.InterleavedBuffer,
  41558. get length() {
  41559. return this.array.length
  41560. },
  41561. get count() {
  41562. return this.array.length / this.stride
  41563. },
  41564. set needsUpdate(e) {
  41565. !0 === e && this.version++
  41566. },
  41567. setDynamic: function(e) {
  41568. return this.dynamic = e,
  41569. this
  41570. },
  41571. copy: function(e) {
  41572. return this.array = new e.array.constructor(e.array),
  41573. this.stride = e.stride,
  41574. this.dynamic = e.dynamic,
  41575. this
  41576. },
  41577. copyAt: function(e, t, i) {
  41578. e *= this.stride,
  41579. i *= t.stride;
  41580. for (var n = 0, r = this.stride; n < r; n++)
  41581. this.array[e + n] = t.array[i + n];
  41582. return this
  41583. },
  41584. set: function(e, t) {
  41585. return void 0 === t && (t = 0),
  41586. this.array.set(e, t),
  41587. this
  41588. },
  41589. clone: function() {
  41590. return (new this.constructor).copy(this)
  41591. }
  41592. },
  41593. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41594. Ci.InterleavedBuffer.call(this, e, t),
  41595. this.meshPerAttribute = i || 1
  41596. }
  41597. ,
  41598. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41599. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41600. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41601. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41602. this.meshPerAttribute = e.meshPerAttribute,
  41603. this
  41604. }
  41605. ,
  41606. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41607. this.uuid = Ci.Math.generateUUID(),
  41608. this.data = e,
  41609. this.itemSize = t,
  41610. this.offset = i
  41611. }
  41612. ,
  41613. Ci.InterleavedBufferAttribute.prototype = {
  41614. constructor: Ci.InterleavedBufferAttribute,
  41615. get length() {
  41616. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41617. this.array.length
  41618. },
  41619. get count() {
  41620. return this.data.count
  41621. },
  41622. setX: function(e, t) {
  41623. return this.data.array[e * this.data.stride + this.offset] = t,
  41624. this
  41625. },
  41626. setY: function(e, t) {
  41627. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41628. this
  41629. },
  41630. setZ: function(e, t) {
  41631. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41632. this
  41633. },
  41634. setW: function(e, t) {
  41635. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41636. this
  41637. },
  41638. getX: function(e) {
  41639. return this.data.array[e * this.data.stride + this.offset]
  41640. },
  41641. getY: function(e) {
  41642. return this.data.array[e * this.data.stride + this.offset + 1]
  41643. },
  41644. getZ: function(e) {
  41645. return this.data.array[e * this.data.stride + this.offset + 2]
  41646. },
  41647. getW: function(e) {
  41648. return this.data.array[e * this.data.stride + this.offset + 3]
  41649. },
  41650. setXY: function(e, t, i) {
  41651. return e = e * this.data.stride + this.offset,
  41652. this.data.array[e + 0] = t,
  41653. this.data.array[e + 1] = i,
  41654. this
  41655. },
  41656. setXYZ: function(e, t, i, n) {
  41657. return e = e * this.data.stride + this.offset,
  41658. this.data.array[e + 0] = t,
  41659. this.data.array[e + 1] = i,
  41660. this.data.array[e + 2] = n,
  41661. this
  41662. },
  41663. setXYZW: function(e, t, i, n, r) {
  41664. return e = e * this.data.stride + this.offset,
  41665. this.data.array[e + 0] = t,
  41666. this.data.array[e + 1] = i,
  41667. this.data.array[e + 2] = n,
  41668. this.data.array[e + 3] = r,
  41669. this
  41670. }
  41671. },
  41672. Ci.Geometry = function() {
  41673. Object.defineProperty(this, "id", {
  41674. value: Ci.GeometryIdCount++
  41675. }),
  41676. this.uuid = Ci.Math.generateUUID(),
  41677. this.name = "",
  41678. this.type = "Geometry",
  41679. this.vertices = [],
  41680. this.colors = [],
  41681. this.faces = [],
  41682. this.faceVertexUvs = [[]],
  41683. this.morphTargets = [],
  41684. this.morphNormals = [],
  41685. this.skinWeights = [],
  41686. this.skinIndices = [],
  41687. this.lineDistances = [],
  41688. this.boundingBox = null,
  41689. this.boundingSphere = null,
  41690. this.verticesNeedUpdate = !1,
  41691. this.elementsNeedUpdate = !1,
  41692. this.uvsNeedUpdate = !1,
  41693. this.normalsNeedUpdate = !1,
  41694. this.colorsNeedUpdate = !1,
  41695. this.lineDistancesNeedUpdate = !1,
  41696. this.groupsNeedUpdate = !1
  41697. }
  41698. ,
  41699. Ci.Geometry.prototype = {
  41700. constructor: Ci.Geometry,
  41701. applyMatrix: function(e) {
  41702. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41703. this.vertices[i].applyMatrix4(e)
  41704. }
  41705. for (i = 0,
  41706. n = this.faces.length; i < n; i++) {
  41707. var r = this.faces[i];
  41708. r.normal.applyMatrix3(t).normalize();
  41709. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41710. r.vertexNormals[o].applyMatrix3(t).normalize()
  41711. }
  41712. return null !== this.boundingBox && this.computeBoundingBox(),
  41713. null !== this.boundingSphere && this.computeBoundingSphere(),
  41714. this.verticesNeedUpdate = !0,
  41715. this.normalsNeedUpdate = !0,
  41716. this
  41717. },
  41718. rotateX: function(e) {
  41719. return void 0 === mt && (mt = new Ci.Matrix4),
  41720. mt.makeRotationX(e),
  41721. this.applyMatrix(mt),
  41722. this
  41723. },
  41724. rotateY: function(e) {
  41725. return void 0 === gt && (gt = new Ci.Matrix4),
  41726. gt.makeRotationY(e),
  41727. this.applyMatrix(gt),
  41728. this
  41729. },
  41730. rotateZ: function(e) {
  41731. return void 0 === ft && (ft = new Ci.Matrix4),
  41732. ft.makeRotationZ(e),
  41733. this.applyMatrix(ft),
  41734. this
  41735. },
  41736. translate: function(e, t, i) {
  41737. return void 0 === pt && (pt = new Ci.Matrix4),
  41738. pt.makeTranslation(e, t, i),
  41739. this.applyMatrix(pt),
  41740. this
  41741. },
  41742. scale: function(e, t, i) {
  41743. return void 0 === dt && (dt = new Ci.Matrix4),
  41744. dt.makeScale(e, t, i),
  41745. this.applyMatrix(dt),
  41746. this
  41747. },
  41748. lookAt: function(e) {
  41749. void 0 === ut && (ut = new Ci.Object3D),
  41750. ut.lookAt(e),
  41751. ut.updateMatrix(),
  41752. this.applyMatrix(ut.matrix)
  41753. },
  41754. fromBufferGeometry: function(e) {
  41755. function t(e, t, i, n) {
  41756. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41757. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41758. , a = new Ci.Face3(e,t,i,r,o,n);
  41759. s.faces.push(a),
  41760. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41761. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41762. }
  41763. var s = this
  41764. , i = null !== e.index ? e.index.array : void 0
  41765. , n = e.attributes
  41766. , r = n.position.array
  41767. , l = void 0 !== n.normal ? n.normal.array : void 0
  41768. , c = void 0 !== n.color ? n.color.array : void 0
  41769. , h = void 0 !== n.uv ? n.uv.array : void 0
  41770. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41771. void 0 !== u && (this.faceVertexUvs[1] = []);
  41772. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41773. a += 2)
  41774. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41775. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41776. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41777. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41778. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41779. if (void 0 !== i) {
  41780. var g = e.groups;
  41781. if (0 < g.length)
  41782. for (o = 0; o < g.length; o++)
  41783. for (var m = g[o], v = m.start, y = (a = v,
  41784. v + m.count); a < y; a += 3)
  41785. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41786. else
  41787. for (o = 0; o < i.length; o += 3)
  41788. t(i[o], i[o + 1], i[o + 2])
  41789. } else
  41790. for (o = 0; o < r.length / 3; o += 3)
  41791. t(o, o + 1, o + 2);
  41792. return this.computeFaceNormals(),
  41793. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41794. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41795. this
  41796. },
  41797. center: function() {
  41798. this.computeBoundingBox();
  41799. var e = this.boundingBox.center().negate();
  41800. return this.translate(e.x, e.y, e.z),
  41801. e
  41802. },
  41803. normalize: function() {
  41804. this.computeBoundingSphere();
  41805. var e = this.boundingSphere.center
  41806. , t = this.boundingSphere.radius
  41807. , i = 0 === t ? 1 : 1 / t
  41808. , n = new Ci.Matrix4;
  41809. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  41810. this.applyMatrix(n),
  41811. this
  41812. },
  41813. computeFaceNormals: function() {
  41814. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41815. var r = this.faces[i]
  41816. , o = this.vertices[r.a]
  41817. , a = this.vertices[r.b]
  41818. , s = this.vertices[r.c];
  41819. e.subVectors(s, a),
  41820. t.subVectors(o, a),
  41821. e.cross(t),
  41822. e.normalize(),
  41823. r.normal.copy(e)
  41824. }
  41825. },
  41826. computeVertexNormals: function(e) {
  41827. var t, i, n, r, o, a;
  41828. for (void 0 === e && (e = !0),
  41829. a = new Array(this.vertices.length),
  41830. t = 0,
  41831. i = this.vertices.length; t < i; t++)
  41832. a[t] = new Ci.Vector3;
  41833. if (e) {
  41834. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41835. for (n = 0,
  41836. r = this.faces.length; n < r; n++)
  41837. o = this.faces[n],
  41838. s = this.vertices[o.a],
  41839. l = this.vertices[o.b],
  41840. c = this.vertices[o.c],
  41841. h.subVectors(c, l),
  41842. u.subVectors(s, l),
  41843. h.cross(u),
  41844. a[o.a].add(h),
  41845. a[o.b].add(h),
  41846. a[o.c].add(h)
  41847. } else
  41848. for (n = 0,
  41849. r = this.faces.length; n < r; n++)
  41850. a[(o = this.faces[n]).a].add(o.normal),
  41851. a[o.b].add(o.normal),
  41852. a[o.c].add(o.normal);
  41853. for (t = 0,
  41854. i = this.vertices.length; t < i; t++)
  41855. a[t].normalize();
  41856. for (n = 0,
  41857. r = this.faces.length; n < r; n++) {
  41858. var d = (o = this.faces[n]).vertexNormals;
  41859. 3 === d.length ? (d[0].copy(a[o.a]),
  41860. d[1].copy(a[o.b]),
  41861. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41862. d[1] = a[o.b].clone(),
  41863. d[2] = a[o.c].clone())
  41864. }
  41865. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41866. },
  41867. computeMorphNormals: function() {
  41868. var e, t, i, n, r;
  41869. for (i = 0,
  41870. n = this.faces.length; i < n; i++)
  41871. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41872. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41873. e = 0,
  41874. t = r.vertexNormals.length; e < t; e++)
  41875. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41876. var o = new Ci.Geometry;
  41877. for (o.faces = this.faces,
  41878. e = 0,
  41879. t = this.morphTargets.length; e < t; e++) {
  41880. if (!this.morphNormals[e]) {
  41881. this.morphNormals[e] = {},
  41882. this.morphNormals[e].faceNormals = [],
  41883. this.morphNormals[e].vertexNormals = [];
  41884. var a = this.morphNormals[e].faceNormals
  41885. , s = this.morphNormals[e].vertexNormals;
  41886. for (i = 0,
  41887. n = this.faces.length; i < n; i++)
  41888. l = new Ci.Vector3,
  41889. c = {
  41890. a: new Ci.Vector3,
  41891. b: new Ci.Vector3,
  41892. c: new Ci.Vector3
  41893. },
  41894. a.push(l),
  41895. s.push(c)
  41896. }
  41897. var l, c, h = this.morphNormals[e];
  41898. for (o.vertices = this.morphTargets[e].vertices,
  41899. o.computeFaceNormals(),
  41900. o.computeVertexNormals(),
  41901. i = 0,
  41902. n = this.faces.length; i < n; i++)
  41903. r = this.faces[i],
  41904. l = h.faceNormals[i],
  41905. c = h.vertexNormals[i],
  41906. l.copy(r.normal),
  41907. c.a.copy(r.vertexNormals[0]),
  41908. c.b.copy(r.vertexNormals[1]),
  41909. c.c.copy(r.vertexNormals[2])
  41910. }
  41911. for (i = 0,
  41912. n = this.faces.length; i < n; i++)
  41913. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41914. r.vertexNormals = r.__originalVertexNormals
  41915. },
  41916. computeTangents: function() {
  41917. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41918. },
  41919. computeLineDistances: function() {
  41920. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41921. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41922. this.lineDistances[i] = e
  41923. },
  41924. computeBoundingBox: function() {
  41925. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41926. this.boundingBox.setFromPoints(this.vertices)
  41927. },
  41928. computeBoundingSphere: function() {
  41929. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41930. this.boundingSphere.setFromPoints(this.vertices)
  41931. },
  41932. merge: function(e, t, i) {
  41933. if (e instanceof Ci.Geometry != 0) {
  41934. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  41935. void 0 === i && (i = 0),
  41936. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41937. for (var u = 0, d = a.length; u < d; u++) {
  41938. var p = a[u].clone();
  41939. void 0 !== t && p.applyMatrix4(t),
  41940. o.push(p)
  41941. }
  41942. for (u = 0,
  41943. d = l.length; u < d; u++) {
  41944. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41945. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41946. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41947. for (var C = 0, I = y.length; C < I; C++)
  41948. g = y[C].clone(),
  41949. void 0 !== n && g.applyMatrix3(n).normalize(),
  41950. f.vertexNormals.push(g);
  41951. f.color.copy(v.color);
  41952. for (C = 0,
  41953. I = A.length; C < I; C++)
  41954. m = A[C],
  41955. f.vertexColors.push(m.clone());
  41956. f.materialIndex = v.materialIndex + i,
  41957. s.push(f)
  41958. }
  41959. for (u = 0,
  41960. d = h.length; u < d; u++) {
  41961. var E = h[u]
  41962. , _ = [];
  41963. if (void 0 !== E) {
  41964. for (C = 0,
  41965. I = E.length; C < I; C++)
  41966. _.push(E[C].clone());
  41967. c.push(_)
  41968. }
  41969. }
  41970. } else
  41971. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41972. },
  41973. mergeMesh: function(e) {
  41974. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41975. void this.merge(e.geometry, e.matrix))
  41976. },
  41977. mergeVertices: function() {
  41978. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41979. for (i = 0,
  41980. n = this.vertices.length; i < n; i++)
  41981. e = this.vertices[i],
  41982. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41983. c.push(this.vertices[i]),
  41984. h[i] = c.length - 1) : h[i] = h[l[t]];
  41985. var d = [];
  41986. for (i = 0,
  41987. n = this.faces.length; i < n; i++) {
  41988. (r = this.faces[i]).a = h[r.a],
  41989. r.b = h[r.b],
  41990. r.c = h[r.c],
  41991. o = [r.a, r.b, r.c];
  41992. for (var p = 0; p < 3; p++)
  41993. if (o[p] === o[(p + 1) % 3]) {
  41994. p,
  41995. d.push(i);
  41996. break
  41997. }
  41998. }
  41999. for (i = d.length - 1; 0 <= i; i--) {
  42000. var f = d[i];
  42001. for (this.faces.splice(f, 1),
  42002. a = 0,
  42003. s = this.faceVertexUvs.length; a < s; a++)
  42004. this.faceVertexUvs[a].splice(f, 1)
  42005. }
  42006. var g = this.vertices.length - c.length;
  42007. return this.vertices = c,
  42008. g
  42009. },
  42010. sortFacesByMaterialIndex: function() {
  42011. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42012. e[i]._id = i;
  42013. e.sort(function(e, t) {
  42014. return e.materialIndex - t.materialIndex
  42015. });
  42016. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42017. o && o.length === t && (n = []),
  42018. a && a.length === t && (r = []);
  42019. for (i = 0; i < t; i++) {
  42020. var s = e[i]._id;
  42021. n && n.push(o[s]),
  42022. r && r.push(a[s])
  42023. }
  42024. n && (this.faceVertexUvs[0] = n),
  42025. r && (this.faceVertexUvs[1] = r)
  42026. },
  42027. toJSON: function() {
  42028. function e(e, t, i) {
  42029. return i ? e | 1 << t : e & ~(1 << t)
  42030. }
  42031. function t(e) {
  42032. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42033. return void 0 !== d[t] || (d[t] = u.length / 3,
  42034. u.push(e.x, e.y, e.z)),
  42035. d[t]
  42036. }
  42037. function i(e) {
  42038. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42039. return void 0 !== f[t] || (f[t] = p.length,
  42040. p.push(e.getHex())),
  42041. f[t]
  42042. }
  42043. function n(e) {
  42044. var t = e.x.toString() + e.y.toString();
  42045. return void 0 !== m[t] || (m[t] = g.length / 2,
  42046. g.push(e.x, e.y)),
  42047. m[t]
  42048. }
  42049. var r = {
  42050. metadata: {
  42051. version: 4.4,
  42052. type: "Geometry",
  42053. generator: "Geometry.toJSON"
  42054. }
  42055. };
  42056. if (r.uuid = this.uuid,
  42057. r.type = this.type,
  42058. "" !== this.name && (r.name = this.name),
  42059. void 0 !== this.parameters) {
  42060. var o = this.parameters;
  42061. for (var a in o)
  42062. void 0 !== o[a] && (r[a] = o[a]);
  42063. return r
  42064. }
  42065. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42066. var c = this.vertices[l];
  42067. s.push(c.x, c.y, c.z)
  42068. }
  42069. var h = []
  42070. , u = []
  42071. , d = {}
  42072. , p = []
  42073. , f = {}
  42074. , g = []
  42075. , m = {};
  42076. for (l = 0; l < this.faces.length; l++) {
  42077. var v = this.faces[l]
  42078. , y = void 0 !== this.faceVertexUvs[0][l]
  42079. , A = 0 < v.normal.length()
  42080. , C = 0 < v.vertexNormals.length
  42081. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42082. , E = 0 < v.vertexColors.length
  42083. , _ = 0;
  42084. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  42085. h.push(_),
  42086. h.push(v.a, v.b, v.c),
  42087. h.push(v.materialIndex),
  42088. y) {
  42089. var b = this.faceVertexUvs[0][l];
  42090. h.push(n(b[0]), n(b[1]), n(b[2]))
  42091. }
  42092. if (A && h.push(t(v.normal)),
  42093. C) {
  42094. var w = v.vertexNormals;
  42095. h.push(t(w[0]), t(w[1]), t(w[2]))
  42096. }
  42097. if (I && h.push(i(v.color)),
  42098. E) {
  42099. var T = v.vertexColors;
  42100. h.push(i(T[0]), i(T[1]), i(T[2]))
  42101. }
  42102. }
  42103. return r.data = {},
  42104. r.data.vertices = s,
  42105. r.data.normals = u,
  42106. 0 < p.length && (r.data.colors = p),
  42107. 0 < g.length && (r.data.uvs = [g]),
  42108. r.data.faces = h,
  42109. r
  42110. },
  42111. clone: function() {
  42112. return (new Ci.Geometry).copy(this)
  42113. },
  42114. copy: function(e) {
  42115. this.vertices = [],
  42116. this.faces = [],
  42117. this.faceVertexUvs = [[]];
  42118. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42119. this.vertices.push(t[i].clone());
  42120. var r = e.faces;
  42121. for (i = 0,
  42122. n = r.length; i < n; i++)
  42123. this.faces.push(r[i].clone());
  42124. for (i = 0,
  42125. n = e.faceVertexUvs.length; i < n; i++) {
  42126. var o = e.faceVertexUvs[i];
  42127. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42128. for (var a = 0, s = o.length; a < s; a++) {
  42129. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42130. var d = l[h];
  42131. c.push(d.clone())
  42132. }
  42133. this.faceVertexUvs[i].push(c)
  42134. }
  42135. }
  42136. return this
  42137. },
  42138. dispose: function() {
  42139. this.dispatchEvent({
  42140. type: "dispose"
  42141. })
  42142. }
  42143. },
  42144. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42145. Ci.GeometryIdCount = 0,
  42146. Ci.DirectGeometry = function() {
  42147. Object.defineProperty(this, "id", {
  42148. value: Ci.GeometryIdCount++
  42149. }),
  42150. this.uuid = Ci.Math.generateUUID(),
  42151. this.name = "",
  42152. this.type = "DirectGeometry",
  42153. this.indices = [],
  42154. this.vertices = [],
  42155. this.normals = [],
  42156. this.colors = [],
  42157. this.uvs = [],
  42158. this.uvs2 = [],
  42159. this.groups = [],
  42160. this.morphTargets = {},
  42161. this.skinWeights = [],
  42162. this.skinIndices = [],
  42163. this.boundingBox = null,
  42164. this.boundingSphere = null,
  42165. this.verticesNeedUpdate = !1,
  42166. this.normalsNeedUpdate = !1,
  42167. this.colorsNeedUpdate = !1,
  42168. this.uvsNeedUpdate = !1,
  42169. this.groupsNeedUpdate = !1
  42170. }
  42171. ,
  42172. Ci.DirectGeometry.prototype = {
  42173. constructor: Ci.DirectGeometry,
  42174. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42175. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42176. computeFaceNormals: function() {
  42177. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42178. },
  42179. computeVertexNormals: function() {
  42180. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42181. },
  42182. computeGroups: function(e) {
  42183. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42184. var a = r[o];
  42185. a.materialIndex !== i && (i = a.materialIndex,
  42186. void 0 !== t && (t.count = 3 * o - t.start,
  42187. n.push(t)),
  42188. t = {
  42189. start: 3 * o,
  42190. materialIndex: i
  42191. })
  42192. }
  42193. void 0 !== t && (t.count = 3 * o - t.start,
  42194. n.push(t)),
  42195. this.groups = n
  42196. },
  42197. fromGeometry: function(e) {
  42198. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  42199. if (0 < l) {
  42200. t = [];
  42201. for (var c = 0; c < l; c++)
  42202. t[c] = [];
  42203. this.morphTargets.position = t
  42204. }
  42205. var h, u = e.morphNormals, d = u.length;
  42206. if (0 < d) {
  42207. h = [];
  42208. for (c = 0; c < d; c++)
  42209. h[c] = [];
  42210. this.morphTargets.normal = h
  42211. }
  42212. var p = e.skinIndices
  42213. , f = e.skinWeights
  42214. , g = p.length === n.length
  42215. , m = f.length === n.length;
  42216. for (c = 0; c < i.length; c++) {
  42217. var v = i[c];
  42218. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42219. var y = v.vertexNormals;
  42220. if (3 === y.length)
  42221. this.normals.push(y[0], y[1], y[2]);
  42222. else {
  42223. var A = v.normal;
  42224. this.normals.push(A, A, A)
  42225. }
  42226. var C, I = v.vertexColors;
  42227. if (3 === I.length)
  42228. this.colors.push(I[0], I[1], I[2]);
  42229. else {
  42230. var E = v.color;
  42231. this.colors.push(E, E, E)
  42232. }
  42233. if (!0 === o)
  42234. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42235. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42236. if (!0 === a)
  42237. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42238. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42239. for (var _ = 0; _ < l; _++) {
  42240. var b = s[_].vertices;
  42241. t[_].push(b[v.a], b[v.b], b[v.c])
  42242. }
  42243. for (_ = 0; _ < d; _++) {
  42244. var w = u[_].vertexNormals[c];
  42245. h[_].push(w.a, w.b, w.c)
  42246. }
  42247. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42248. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42249. }
  42250. return this.computeGroups(e),
  42251. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42252. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42253. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42254. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42255. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42256. this
  42257. },
  42258. dispose: function() {
  42259. this.dispatchEvent({
  42260. type: "dispose"
  42261. })
  42262. }
  42263. },
  42264. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42265. Ci.BufferGeometry = function() {
  42266. Object.defineProperty(this, "id", {
  42267. value: Ci.GeometryIdCount++
  42268. }),
  42269. this.uuid = Ci.Math.generateUUID(),
  42270. this.name = "",
  42271. this.type = "BufferGeometry",
  42272. this.index = null,
  42273. this.attributes = {},
  42274. this.morphAttributes = {},
  42275. this.groups = [],
  42276. this.boundingBox = null,
  42277. this.boundingSphere = null,
  42278. this.drawRange = {
  42279. start: 0,
  42280. count: 1 / 0
  42281. }
  42282. }
  42283. ,
  42284. Ci.BufferGeometry.prototype = {
  42285. constructor: Ci.BufferGeometry,
  42286. getIndex: function() {
  42287. return this.index
  42288. },
  42289. setIndex: function(e) {
  42290. this.index = e
  42291. },
  42292. addAttribute: function(e, t) {
  42293. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42294. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42295. void this.setIndex(t)) : (this.attributes[e] = t,
  42296. this)
  42297. },
  42298. getAttribute: function(e) {
  42299. return this.attributes[e]
  42300. },
  42301. removeAttribute: function(e) {
  42302. return delete this.attributes[e],
  42303. this
  42304. },
  42305. addGroup: function(e, t, i) {
  42306. this.groups.push({
  42307. start: e,
  42308. count: t,
  42309. materialIndex: void 0 !== i ? i : 0
  42310. })
  42311. },
  42312. clearGroups: function() {
  42313. this.groups = []
  42314. },
  42315. setDrawRange: function(e, t) {
  42316. this.drawRange.start = e,
  42317. this.drawRange.count = t
  42318. },
  42319. applyMatrix: function(e) {
  42320. var t = this.attributes.position;
  42321. void 0 !== t && (e.applyToVector3Array(t.array),
  42322. t.needsUpdate = !0);
  42323. var i = this.attributes.normal;
  42324. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42325. i.needsUpdate = !0);
  42326. return null !== this.boundingBox && this.computeBoundingBox(),
  42327. null !== this.boundingSphere && this.computeBoundingSphere(),
  42328. this
  42329. },
  42330. rotateX: function(e) {
  42331. return void 0 === ht && (ht = new Ci.Matrix4),
  42332. ht.makeRotationX(e),
  42333. this.applyMatrix(ht),
  42334. this
  42335. },
  42336. rotateY: function(e) {
  42337. return void 0 === ct && (ct = new Ci.Matrix4),
  42338. ct.makeRotationY(e),
  42339. this.applyMatrix(ct),
  42340. this
  42341. },
  42342. rotateZ: function(e) {
  42343. return void 0 === lt && (lt = new Ci.Matrix4),
  42344. lt.makeRotationZ(e),
  42345. this.applyMatrix(lt),
  42346. this
  42347. },
  42348. translate: function(e, t, i) {
  42349. return void 0 === st && (st = new Ci.Matrix4),
  42350. st.makeTranslation(e, t, i),
  42351. this.applyMatrix(st),
  42352. this
  42353. },
  42354. scale: function(e, t, i) {
  42355. return void 0 === at && (at = new Ci.Matrix4),
  42356. at.makeScale(e, t, i),
  42357. this.applyMatrix(at),
  42358. this
  42359. },
  42360. lookAt: function(e) {
  42361. void 0 === ot && (ot = new Ci.Object3D),
  42362. ot.lookAt(e),
  42363. ot.updateMatrix(),
  42364. this.applyMatrix(ot.matrix)
  42365. },
  42366. center: function() {
  42367. this.computeBoundingBox();
  42368. var e = this.boundingBox.center().negate();
  42369. return this.translate(e.x, e.y, e.z),
  42370. e
  42371. },
  42372. setFromObject: function(e) {
  42373. var t = e.geometry;
  42374. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42375. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42376. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42377. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42378. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42379. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42380. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42381. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42382. }
  42383. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42384. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42385. } else
  42386. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42387. return this
  42388. },
  42389. updateFromObject: function(e) {
  42390. var t, i = e.geometry;
  42391. if (e instanceof Ci.Mesh) {
  42392. var n = i.__directGeometry;
  42393. if (void 0 === n)
  42394. return this.fromGeometry(i);
  42395. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42396. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42397. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42398. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42399. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42400. i.verticesNeedUpdate = !1,
  42401. i.normalsNeedUpdate = !1,
  42402. i.colorsNeedUpdate = !1,
  42403. i.uvsNeedUpdate = !1,
  42404. i.groupsNeedUpdate = !1,
  42405. i = n
  42406. }
  42407. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42408. t.needsUpdate = !0),
  42409. i.verticesNeedUpdate = !1);
  42410. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42411. t.needsUpdate = !0),
  42412. i.normalsNeedUpdate = !1);
  42413. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42414. t.needsUpdate = !0),
  42415. i.colorsNeedUpdate = !1);
  42416. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42417. t.needsUpdate = !0),
  42418. i.uvsNeedUpdate = !1);
  42419. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42420. t.needsUpdate = !0),
  42421. i.lineDistancesNeedUpdate = !1);
  42422. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42423. this.groups = i.groups,
  42424. i.groupsNeedUpdate = !1),
  42425. this
  42426. },
  42427. fromGeometry: function(e) {
  42428. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42429. this.fromDirectGeometry(e.__directGeometry)
  42430. },
  42431. fromDirectGeometry: function(e) {
  42432. var t = new Float32Array(3 * e.vertices.length);
  42433. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42434. 0 < e.normals.length) {
  42435. var i = new Float32Array(3 * e.normals.length);
  42436. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42437. }
  42438. if (0 < e.colors.length) {
  42439. var n = new Float32Array(3 * e.colors.length);
  42440. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42441. }
  42442. if (0 < e.uvs.length) {
  42443. var r = new Float32Array(2 * e.uvs.length);
  42444. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42445. }
  42446. if (0 < e.uvs2.length) {
  42447. var o = new Float32Array(2 * e.uvs2.length);
  42448. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42449. }
  42450. if (0 < e.indices.length) {
  42451. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42452. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42453. }
  42454. for (var s in this.groups = e.groups,
  42455. e.morphTargets) {
  42456. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42457. var d = c[h]
  42458. , p = new Ci.Float32Attribute(3 * d.length,3);
  42459. l.push(p.copyVector3sArray(d))
  42460. }
  42461. this.morphAttributes[s] = l
  42462. }
  42463. if (0 < e.skinIndices.length) {
  42464. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42465. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42466. }
  42467. if (0 < e.skinWeights.length) {
  42468. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42469. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42470. }
  42471. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42472. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42473. this
  42474. },
  42475. computeBoundingBox: (new Ci.Vector3,
  42476. function() {
  42477. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42478. var e = this.attributes.position.array;
  42479. e && this.boundingBox.setFromArray(e),
  42480. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42481. this.boundingBox.max.set(0, 0, 0)),
  42482. (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)
  42483. }
  42484. ),
  42485. computeBoundingSphere: (nt = new Ci.Box3,
  42486. rt = new Ci.Vector3,
  42487. function() {
  42488. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42489. var e = this.attributes.position.array;
  42490. if (e) {
  42491. var t = this.boundingSphere.center;
  42492. nt.setFromArray(e),
  42493. nt.center(t);
  42494. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42495. rt.fromArray(e, n),
  42496. i = Math.max(i, t.distanceToSquared(rt));
  42497. this.boundingSphere.radius = Math.sqrt(i),
  42498. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42499. }
  42500. }
  42501. ),
  42502. computeFaceNormals: function() {},
  42503. computeVertexNormals: function() {
  42504. var e = this.index
  42505. , t = this.attributes
  42506. , i = this.groups;
  42507. if (t.position) {
  42508. var n = t.position.array;
  42509. if (void 0 === t.normal)
  42510. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42511. else
  42512. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42513. r[o] = 0;
  42514. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  42515. if (e) {
  42516. var m = e.array;
  42517. 0 === i.length && this.addGroup(0, m.length);
  42518. for (var v = 0, y = i.length; v < y; ++v) {
  42519. var A = i[v]
  42520. , C = A.start;
  42521. for (o = C,
  42522. a = C + A.count; o < a; o += 3)
  42523. s = 3 * m[o + 0],
  42524. l = 3 * m[o + 1],
  42525. c = 3 * m[o + 2],
  42526. u.fromArray(n, s),
  42527. d.fromArray(n, l),
  42528. p.fromArray(n, c),
  42529. f.subVectors(p, d),
  42530. g.subVectors(u, d),
  42531. f.cross(g),
  42532. h[s] += f.x,
  42533. h[1 + s] += f.y,
  42534. h[2 + s] += f.z,
  42535. h[l] += f.x,
  42536. h[1 + l] += f.y,
  42537. h[2 + l] += f.z,
  42538. h[c] += f.x,
  42539. h[1 + c] += f.y,
  42540. h[2 + c] += f.z
  42541. }
  42542. } else
  42543. for (o = 0,
  42544. a = n.length; o < a; o += 9)
  42545. u.fromArray(n, o),
  42546. d.fromArray(n, o + 3),
  42547. p.fromArray(n, o + 6),
  42548. f.subVectors(p, d),
  42549. g.subVectors(u, d),
  42550. f.cross(g),
  42551. h[o] = f.x,
  42552. h[o + 1] = f.y,
  42553. h[o + 2] = f.z,
  42554. h[o + 3] = f.x,
  42555. h[o + 4] = f.y,
  42556. h[o + 5] = f.z,
  42557. h[o + 6] = f.x,
  42558. h[o + 7] = f.y,
  42559. h[o + 8] = f.z;
  42560. this.normalizeNormals(),
  42561. t.normal.needsUpdate = !0
  42562. }
  42563. },
  42564. merge: function(e, t) {
  42565. if (e instanceof Ci.BufferGeometry != 0) {
  42566. void 0 === t && (t = 0);
  42567. var i = this.attributes;
  42568. for (var n in i)
  42569. if (void 0 !== e.attributes[n])
  42570. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42571. l++)
  42572. r[l] = a[s];
  42573. return this
  42574. }
  42575. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42576. },
  42577. normalizeNormals: function() {
  42578. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42579. e = r[o],
  42580. t = r[o + 1],
  42581. i = r[o + 2],
  42582. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42583. r[o] *= n,
  42584. r[o + 1] *= n,
  42585. r[o + 2] *= n
  42586. },
  42587. toNonIndexed: function() {
  42588. if (null === this.index)
  42589. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42590. this;
  42591. var e = new Ci.BufferGeometry
  42592. , t = this.index.array
  42593. , i = this.attributes;
  42594. for (var n in i) {
  42595. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  42596. l = t[h] * a;
  42597. for (var d = 0; d < a; d++)
  42598. s[c++] = o[l++]
  42599. }
  42600. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42601. }
  42602. return e
  42603. },
  42604. toJSON: function() {
  42605. var e = {
  42606. metadata: {
  42607. version: 4.4,
  42608. type: "BufferGeometry",
  42609. generator: "BufferGeometry.toJSON"
  42610. }
  42611. };
  42612. if (e.uuid = this.uuid,
  42613. e.type = this.type,
  42614. "" !== this.name && (e.name = this.name),
  42615. void 0 !== this.parameters) {
  42616. var t = this.parameters;
  42617. for (var i in t)
  42618. void 0 !== t[i] && (e[i] = t[i]);
  42619. return e
  42620. }
  42621. e.data = {
  42622. attributes: {}
  42623. };
  42624. var n = this.index;
  42625. if (null !== n) {
  42626. var r = Array.prototype.slice.call(n.array);
  42627. e.data.index = {
  42628. type: n.array.constructor.name,
  42629. array: r
  42630. }
  42631. }
  42632. var o = this.attributes;
  42633. for (var i in o) {
  42634. var a = o[i];
  42635. r = Array.prototype.slice.call(a.array);
  42636. e.data.attributes[i] = {
  42637. itemSize: a.itemSize,
  42638. type: a.array.constructor.name,
  42639. array: r
  42640. }
  42641. }
  42642. var s = this.groups;
  42643. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42644. var l = this.boundingSphere;
  42645. return null !== l && (e.data.boundingSphere = {
  42646. center: l.center.toArray(),
  42647. radius: l.radius
  42648. }),
  42649. e
  42650. },
  42651. clone: function() {
  42652. return (new Ci.BufferGeometry).copy(this)
  42653. },
  42654. copy: function(e) {
  42655. var t = e.index;
  42656. null !== t && this.setIndex(t.clone());
  42657. var i = e.attributes;
  42658. for (var n in i) {
  42659. var r = i[n];
  42660. this.addAttribute(n, r.clone())
  42661. }
  42662. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42663. var l = o[a];
  42664. this.addGroup(l.start, l.count)
  42665. }
  42666. return this
  42667. },
  42668. dispose: function() {
  42669. this.dispatchEvent({
  42670. type: "dispose"
  42671. })
  42672. }
  42673. },
  42674. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42675. Ci.BufferGeometry.MaxIndex = 65535,
  42676. Ci.InstancedBufferGeometry = function() {
  42677. Ci.BufferGeometry.call(this),
  42678. this.type = "InstancedBufferGeometry",
  42679. this.maxInstancedCount = void 0
  42680. }
  42681. ,
  42682. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42683. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42684. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42685. this.groups.push({
  42686. start: e,
  42687. count: t,
  42688. instances: i
  42689. })
  42690. }
  42691. ,
  42692. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42693. var t = e.index;
  42694. null !== t && this.setIndex(t.clone());
  42695. var i = e.attributes;
  42696. for (var n in i) {
  42697. var r = i[n];
  42698. this.addAttribute(n, r.clone())
  42699. }
  42700. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42701. var l = o[a];
  42702. this.addGroup(l.start, l.count, l.instances)
  42703. }
  42704. return this
  42705. }
  42706. ,
  42707. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42708. Ci.Uniform = function(e, t) {
  42709. this.type = e,
  42710. this.value = t,
  42711. this.dynamic = !1
  42712. }
  42713. ,
  42714. Ci.Uniform.prototype = {
  42715. constructor: Ci.Uniform,
  42716. onUpdate: function(e) {
  42717. return this.dynamic = !0,
  42718. this.onUpdateCallback = e,
  42719. this
  42720. }
  42721. },
  42722. Ci.AnimationClip = function(e, t, i) {
  42723. this.name = e || Ci.Math.generateUUID(),
  42724. this.tracks = i,
  42725. this.duration = void 0 !== t ? t : -1,
  42726. this.duration < 0 && this.resetDuration(),
  42727. this.trim(),
  42728. this.optimize()
  42729. }
  42730. ,
  42731. Ci.AnimationClip.prototype = {
  42732. constructor: Ci.AnimationClip,
  42733. resetDuration: function() {
  42734. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42735. var n = this.tracks[t];
  42736. e = Math.max(e, n.times[n.times.length - 1])
  42737. }
  42738. this.duration = e
  42739. },
  42740. trim: function() {
  42741. for (var e = 0; e < this.tracks.length; e++)
  42742. this.tracks[e].trim(0, this.duration);
  42743. return this
  42744. },
  42745. optimize: function() {
  42746. for (var e = 0; e < this.tracks.length; e++)
  42747. this.tracks[e].optimize();
  42748. return this
  42749. }
  42750. },
  42751. Object.assign(Ci.AnimationClip, {
  42752. parse: function(e) {
  42753. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42754. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42755. return new Ci.AnimationClip(e.name,e.duration,t)
  42756. },
  42757. toJSON: function(e) {
  42758. for (var t = [], i = e.tracks, n = {
  42759. name: e.name,
  42760. duration: e.duration,
  42761. tracks: t
  42762. }, r = 0, o = i.length; r !== o; ++r)
  42763. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42764. return n
  42765. },
  42766. CreateFromMorphTargetSequence: function(e, t, i) {
  42767. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42768. var a = []
  42769. , s = [];
  42770. a.push((o + n - 1) % n, o, (o + 1) % n),
  42771. s.push(0, 1, 0);
  42772. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42773. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42774. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42775. 0 === a[0] && (a.push(n),
  42776. s.push(s[0])),
  42777. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42778. }
  42779. return new Ci.AnimationClip(e,-1,r)
  42780. },
  42781. findByName: function(e, t) {
  42782. for (var i = 0; i < e.length; i++)
  42783. if (e[i].name === t)
  42784. return e[i];
  42785. return null
  42786. },
  42787. CreateClipsFromMorphTargetSequences: function(e, t) {
  42788. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42789. var a = e[r]
  42790. , s = a.name.match(n);
  42791. if (s && 1 < s.length) {
  42792. var l = i[h = s[1]];
  42793. l || (i[h] = l = []),
  42794. l.push(a)
  42795. }
  42796. }
  42797. var c = [];
  42798. for (var h in i)
  42799. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42800. return c
  42801. },
  42802. parseAnimation: function(e, t, i) {
  42803. if (!e)
  42804. return console.error(" no animation in JSONLoader data"),
  42805. null;
  42806. function n(e, t, i, n, r) {
  42807. if (0 !== i.length) {
  42808. var o = []
  42809. , a = [];
  42810. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42811. 0 !== o.length && r.push(new e(t,o,a))
  42812. }
  42813. }
  42814. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42815. var h = l[c].keys;
  42816. if (h && 0 != h.length)
  42817. if (h[0].morphTargets) {
  42818. for (var u = {}, d = 0; d < h.length; d++)
  42819. if (h[d].morphTargets)
  42820. for (var p = 0; p < h[d].morphTargets.length; p++)
  42821. u[h[d].morphTargets[p]] = -1;
  42822. for (var f in u) {
  42823. var g = []
  42824. , m = [];
  42825. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42826. var v = h[d];
  42827. g.push(v.time),
  42828. m.push(v.morphTarget === f ? 1 : 0)
  42829. }
  42830. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42831. }
  42832. a = u.length * (s || 1)
  42833. } else {
  42834. var y = ".bones[" + t[c].name + "]";
  42835. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42836. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42837. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42838. }
  42839. }
  42840. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42841. }
  42842. }),
  42843. Ci.AnimationMixer = function(e) {
  42844. this._root = e,
  42845. this._initMemoryManager(),
  42846. this._accuIndex = 0,
  42847. this.time = 0,
  42848. this.timeScale = 1
  42849. }
  42850. ,
  42851. Ci.AnimationMixer.prototype = {
  42852. constructor: Ci.AnimationMixer,
  42853. clipAction: function(e, t) {
  42854. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42855. if (void 0 !== a) {
  42856. var s = a.actionByRoot[n];
  42857. if (void 0 !== s)
  42858. return s;
  42859. if (o = (i = a.knownActions[0])._clip,
  42860. e !== r && e !== o)
  42861. throw new Error("Different clips with the same name detected!")
  42862. }
  42863. if (null === o)
  42864. return null;
  42865. var l = new Ci.AnimationMixer._Action(this,o,t);
  42866. return this._bindAction(l, i),
  42867. this._addInactiveAction(l, r, n),
  42868. l
  42869. },
  42870. existingAction: function(e, t) {
  42871. var i = (t || this._root).uuid
  42872. , n = "string" == typeof e ? e : e.name
  42873. , r = this._actionsByClip[n];
  42874. return void 0 !== r && r.actionByRoot[i] || null
  42875. },
  42876. stopAllAction: function() {
  42877. var e = this._actions
  42878. , t = this._nActiveActions
  42879. , i = this._bindings
  42880. , n = this._nActiveBindings;
  42881. this._nActiveActions = 0;
  42882. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42883. e[r].reset();
  42884. for (r = 0; r !== n; ++r)
  42885. i[r].useCount = 0;
  42886. return this
  42887. },
  42888. update: function(e) {
  42889. e *= this.timeScale;
  42890. 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) {
  42891. var s = t[a];
  42892. s.enabled && s._update(n, e, r, o)
  42893. }
  42894. var l = this._bindings
  42895. , c = this._nActiveBindings;
  42896. for (a = 0; a !== c; ++a)
  42897. l[a].apply(o);
  42898. return this
  42899. },
  42900. getRoot: function() {
  42901. return this._root
  42902. },
  42903. uncacheClip: function(e) {
  42904. var t = this._actions
  42905. , i = e.name
  42906. , n = this._actionsByClip
  42907. , r = n[i];
  42908. if (void 0 !== r) {
  42909. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42910. var l = o[a];
  42911. this._deactivateAction(l);
  42912. var c = l._cacheIndex
  42913. , h = t[t.length - 1];
  42914. l._cacheIndex = null,
  42915. l._byClipCacheIndex = null,
  42916. t[h._cacheIndex = c] = h,
  42917. t.pop(),
  42918. this._removeInactiveBindingsForAction(l)
  42919. }
  42920. delete n[i]
  42921. }
  42922. },
  42923. uncacheRoot: function(e) {
  42924. var t = e.uuid
  42925. , i = this._actionsByClip;
  42926. for (var n in i) {
  42927. var r = i[n].actionByRoot[t];
  42928. void 0 !== r && (this._deactivateAction(r),
  42929. this._removeInactiveAction(r))
  42930. }
  42931. var o = this._bindingsByRootAndName[t];
  42932. if (void 0 !== o)
  42933. for (var a in o) {
  42934. var s = o[a];
  42935. s.restoreOriginalState(),
  42936. this._removeInactiveBinding(s)
  42937. }
  42938. },
  42939. uncacheAction: function(e, t) {
  42940. var i = this.existingAction(e, t);
  42941. null !== i && (this._deactivateAction(i),
  42942. this._removeInactiveAction(i))
  42943. }
  42944. },
  42945. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42946. Ci.AnimationMixer._Action = function(e, t, i) {
  42947. this._mixer = e,
  42948. this._clip = t,
  42949. this._localRoot = i || null;
  42950. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42951. endingStart: Ci.ZeroCurvatureEnding,
  42952. endingEnd: Ci.ZeroCurvatureEnding
  42953. }, s = 0; s !== r; ++s) {
  42954. var l = n[s].createInterpolant(null);
  42955. (o[s] = l).settings = a
  42956. }
  42957. this._interpolantSettings = a,
  42958. this._interpolants = o,
  42959. this._propertyBindings = new Array(r),
  42960. this._cacheIndex = null,
  42961. this._byClipCacheIndex = null,
  42962. this._timeScaleInterpolant = null,
  42963. this._weightInterpolant = null,
  42964. this.loop = Ci.LoopRepeat,
  42965. this._loopCount = -1,
  42966. this._startTime = null,
  42967. this.time = 0,
  42968. this.timeScale = 1,
  42969. this._effectiveTimeScale = 1,
  42970. this.weight = 1,
  42971. this._effectiveWeight = 1,
  42972. this.repetitions = 1 / 0,
  42973. this.paused = !1,
  42974. this.enabled = !0,
  42975. this.clampWhenFinished = !1,
  42976. this.zeroSlopeAtStart = !0,
  42977. this.zeroSlopeAtEnd = !0
  42978. }
  42979. ,
  42980. Ci.AnimationMixer._Action.prototype = {
  42981. constructor: Ci.AnimationMixer._Action,
  42982. play: function() {
  42983. return this._mixer._activateAction(this),
  42984. this
  42985. },
  42986. stop: function() {
  42987. return this._mixer._deactivateAction(this),
  42988. this.reset()
  42989. },
  42990. reset: function() {
  42991. return this.paused = !1,
  42992. this.enabled = !0,
  42993. this.time = 0,
  42994. this._loopCount = -1,
  42995. this._startTime = null,
  42996. this.stopFading().stopWarping()
  42997. },
  42998. isRunning: function() {
  42999. return this._startTime,
  43000. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43001. },
  43002. isScheduled: function() {
  43003. return this._mixer._isActiveAction(this)
  43004. },
  43005. startAt: function(e) {
  43006. return this._startTime = e,
  43007. this
  43008. },
  43009. setLoop: function(e, t) {
  43010. return this.loop = e,
  43011. this.repetitions = t,
  43012. this
  43013. },
  43014. setEffectiveWeight: function(e) {
  43015. return this.weight = e,
  43016. this._effectiveWeight = this.enabled ? e : 0,
  43017. this.stopFading()
  43018. },
  43019. getEffectiveWeight: function() {
  43020. return this._effectiveWeight
  43021. },
  43022. fadeIn: function(e) {
  43023. return this._scheduleFading(e, 0, 1)
  43024. },
  43025. fadeOut: function(e) {
  43026. return this._scheduleFading(e, 1, 0)
  43027. },
  43028. crossFadeFrom: function(e, t, i) {
  43029. if (this._mixer,
  43030. e.fadeOut(t),
  43031. this.fadeIn(t),
  43032. i) {
  43033. var n = this._clip.duration
  43034. , r = e._clip.duration
  43035. , o = r / n
  43036. , a = n / r;
  43037. e.warp(1, o, t),
  43038. this.warp(a, 1, t)
  43039. }
  43040. return this
  43041. },
  43042. crossFadeTo: function(e, t, i) {
  43043. return e.crossFadeFrom(this, t, i)
  43044. },
  43045. stopFading: function() {
  43046. var e = this._weightInterpolant;
  43047. return null !== e && (this._weightInterpolant = null,
  43048. this._mixer._takeBackControlInterpolant(e)),
  43049. this
  43050. },
  43051. setEffectiveTimeScale: function(e) {
  43052. return this.timeScale = e,
  43053. this._effectiveTimeScale = this.paused ? 0 : e,
  43054. this.stopWarping()
  43055. },
  43056. getEffectiveTimeScale: function() {
  43057. return this._effectiveTimeScale
  43058. },
  43059. setDuration: function(e) {
  43060. return this.timeScale = this._clip.duration / e,
  43061. this.stopWarping()
  43062. },
  43063. syncWith: function(e) {
  43064. return this.time = e.time,
  43065. this.timeScale = e.timeScale,
  43066. this.stopWarping()
  43067. },
  43068. halt: function(e) {
  43069. return this.warp(this._currentTimeScale, 0, e)
  43070. },
  43071. warp: function(e, t, i) {
  43072. var n = this._mixer
  43073. , r = n.time
  43074. , o = this._timeScaleInterpolant
  43075. , a = this.timeScale;
  43076. null === o && (o = n._lendControlInterpolant(),
  43077. this._timeScaleInterpolant = o);
  43078. var s = o.parameterPositions
  43079. , l = o.sampleValues;
  43080. return s[0] = r,
  43081. s[1] = r + i,
  43082. l[0] = e / a,
  43083. l[1] = t / a,
  43084. this
  43085. },
  43086. stopWarping: function() {
  43087. var e = this._timeScaleInterpolant;
  43088. return null !== e && (this._timeScaleInterpolant = null,
  43089. this._mixer._takeBackControlInterpolant(e)),
  43090. this
  43091. },
  43092. getMixer: function() {
  43093. return this._mixer
  43094. },
  43095. getClip: function() {
  43096. return this._clip
  43097. },
  43098. getRoot: function() {
  43099. return this._localRoot || this._mixer._root
  43100. },
  43101. _update: function(e, t, i, n) {
  43102. var r = this._startTime;
  43103. if (null !== r) {
  43104. var o = (e - r) * i;
  43105. if (o < 0 || 0 === i)
  43106. return;
  43107. this._startTime = null,
  43108. t = i * o
  43109. }
  43110. t *= this._updateTimeScale(e);
  43111. var a = this._updateTime(t)
  43112. , s = this._updateWeight(e);
  43113. if (0 < s)
  43114. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43115. l[h].evaluate(a),
  43116. c[h].accumulate(n, s)
  43117. },
  43118. _updateWeight: function(e) {
  43119. var t = 0;
  43120. if (this.enabled) {
  43121. t = this.weight;
  43122. var i = this._weightInterpolant;
  43123. if (null !== i) {
  43124. var n = i.evaluate(e)[0];
  43125. t *= n,
  43126. e > i.parameterPositions[1] && (this.stopFading(),
  43127. 0 === n && (this.enabled = !1))
  43128. }
  43129. }
  43130. return this._effectiveWeight = t
  43131. },
  43132. _updateTimeScale: function(e) {
  43133. var t = 0;
  43134. if (!this.paused) {
  43135. t = this.timeScale;
  43136. var i = this._timeScaleInterpolant;
  43137. if (null !== i)
  43138. t *= i.evaluate(e)[0],
  43139. e > i.parameterPositions[1] && (this.stopWarping(),
  43140. 0 === t ? this.pause = !0 : this.timeScale = t)
  43141. }
  43142. return this._effectiveTimeScale = t
  43143. },
  43144. _updateTime: function(e) {
  43145. var t = this.time + e;
  43146. if (0 === e)
  43147. return t;
  43148. var i = this._clip.duration
  43149. , n = this.loop
  43150. , r = this._loopCount
  43151. , o = !1;
  43152. switch (n) {
  43153. case Ci.LoopOnce:
  43154. if (-1 === r && (this.loopCount = 0,
  43155. this._setEndings(!0, !0, !1)),
  43156. i <= t)
  43157. t = i;
  43158. else {
  43159. if (!(t < 0))
  43160. break;
  43161. t = 0
  43162. }
  43163. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43164. this._mixer.dispatchEvent({
  43165. type: "finished",
  43166. action: this,
  43167. direction: e < 0 ? -1 : 1
  43168. });
  43169. break;
  43170. case Ci.LoopPingPong:
  43171. o = !0;
  43172. case Ci.LoopRepeat:
  43173. if (-1 === r && (0 < e ? (r = 0,
  43174. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43175. i <= t || t < 0) {
  43176. var a = Math.floor(t / i);
  43177. t -= i * a,
  43178. r += Math.abs(a);
  43179. var s = this.repetitions - r;
  43180. if (s < 0) {
  43181. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43182. t = 0 < e ? i : 0,
  43183. this._mixer.dispatchEvent({
  43184. type: "finished",
  43185. action: this,
  43186. direction: 0 < e ? 1 : -1
  43187. });
  43188. break
  43189. }
  43190. if (0 == s) {
  43191. var l = e < 0;
  43192. this._setEndings(l, !l, o)
  43193. } else
  43194. this._setEndings(!1, !1, o);
  43195. this._loopCount = r,
  43196. this._mixer.dispatchEvent({
  43197. type: "loop",
  43198. action: this,
  43199. loopDelta: a
  43200. })
  43201. }
  43202. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43203. return i - (this.time = t)
  43204. }
  43205. return this.time = t
  43206. },
  43207. _setEndings: function(e, t, i) {
  43208. var n = this._interpolantSettings;
  43209. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43210. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43211. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43212. },
  43213. _scheduleFading: function(e, t, i) {
  43214. var n = this._mixer
  43215. , r = n.time
  43216. , o = this._weightInterpolant;
  43217. null === o && (o = n._lendControlInterpolant(),
  43218. this._weightInterpolant = o);
  43219. var a = o.parameterPositions
  43220. , s = o.sampleValues;
  43221. return a[0] = r,
  43222. s[0] = t,
  43223. a[1] = r + e,
  43224. s[1] = i,
  43225. this
  43226. }
  43227. },
  43228. Object.assign(Ci.AnimationMixer.prototype, {
  43229. _bindAction: function(e, t) {
  43230. var i = e._localRoot || this._root
  43231. , n = e._clip.tracks
  43232. , r = n.length
  43233. , o = e._propertyBindings
  43234. , a = e._interpolants
  43235. , s = i.uuid
  43236. , l = this._bindingsByRootAndName
  43237. , c = l[s];
  43238. void 0 === c && (c = {},
  43239. l[s] = c);
  43240. for (var h = 0; h !== r; ++h) {
  43241. var u = n[h]
  43242. , d = u.name
  43243. , p = c[d];
  43244. if (void 0 !== p)
  43245. o[h] = p;
  43246. else {
  43247. if (void 0 !== (p = o[h])) {
  43248. null === p._cacheIndex && (++p.referenceCount,
  43249. this._addInactiveBinding(p, s, d));
  43250. continue
  43251. }
  43252. var f = t && t._propertyBindings[h].binding.parsedPath;
  43253. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43254. this._addInactiveBinding(p, s, d),
  43255. o[h] = p
  43256. }
  43257. a[h].resultBuffer = p.buffer
  43258. }
  43259. },
  43260. _activateAction: function(e) {
  43261. if (!this._isActiveAction(e)) {
  43262. if (null === e._cacheIndex) {
  43263. var t = (e._localRoot || this._root).uuid
  43264. , i = e._clip.name
  43265. , n = this._actionsByClip[i];
  43266. this._bindAction(e, n && n.knownActions[0]),
  43267. this._addInactiveAction(e, i, t)
  43268. }
  43269. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43270. var s = r[o];
  43271. 0 == s.useCount++ && (this._lendBinding(s),
  43272. s.saveOriginalState())
  43273. }
  43274. this._lendAction(e)
  43275. }
  43276. },
  43277. _deactivateAction: function(e) {
  43278. if (this._isActiveAction(e)) {
  43279. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43280. var r = t[i];
  43281. 0 == --r.useCount && (r.restoreOriginalState(),
  43282. this._takeBackBinding(r))
  43283. }
  43284. this._takeBackAction(e)
  43285. }
  43286. },
  43287. _initMemoryManager: function() {
  43288. this._actions = [],
  43289. this._nActiveActions = 0,
  43290. this._actionsByClip = {},
  43291. this._bindings = [],
  43292. this._nActiveBindings = 0,
  43293. this._bindingsByRootAndName = {},
  43294. this._controlInterpolants = [],
  43295. this._nActiveControlInterpolants = 0;
  43296. var e = this;
  43297. this.stats = {
  43298. actions: {
  43299. get total() {
  43300. return e._actions.length
  43301. },
  43302. get inUse() {
  43303. return e._nActiveActions
  43304. }
  43305. },
  43306. bindings: {
  43307. get total() {
  43308. return e._bindings.length
  43309. },
  43310. get inUse() {
  43311. return e._nActiveBindings
  43312. }
  43313. },
  43314. controlInterpolants: {
  43315. get total() {
  43316. return e._controlInterpolants.length
  43317. },
  43318. get inUse() {
  43319. return e._nActiveControlInterpolants
  43320. }
  43321. }
  43322. }
  43323. },
  43324. _isActiveAction: function(e) {
  43325. var t = e._cacheIndex;
  43326. return null !== t && t < this._nActiveActions
  43327. },
  43328. _addInactiveAction: function(e, t, i) {
  43329. var n = this._actions
  43330. , r = this._actionsByClip
  43331. , o = r[t];
  43332. if (void 0 === o)
  43333. o = {
  43334. knownActions: [e],
  43335. actionByRoot: {}
  43336. },
  43337. e._byClipCacheIndex = 0,
  43338. r[t] = o;
  43339. else {
  43340. var a = o.knownActions;
  43341. e._byClipCacheIndex = a.length,
  43342. a.push(e)
  43343. }
  43344. e._cacheIndex = n.length,
  43345. n.push(e),
  43346. o.actionByRoot[i] = e
  43347. },
  43348. _removeInactiveAction: function(e) {
  43349. var t = this._actions
  43350. , i = t[t.length - 1]
  43351. , n = e._cacheIndex;
  43352. t[i._cacheIndex = n] = i,
  43353. t.pop(),
  43354. e._cacheIndex = null;
  43355. var r = e._clip.name
  43356. , o = this._actionsByClip
  43357. , a = o[r]
  43358. , s = a.knownActions
  43359. , l = s[s.length - 1]
  43360. , c = e._byClipCacheIndex;
  43361. s[l._byClipCacheIndex = c] = l,
  43362. s.pop(),
  43363. e._byClipCacheIndex = null,
  43364. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43365. 0 === s.length && delete o[r],
  43366. this._removeInactiveBindingsForAction(e)
  43367. },
  43368. _removeInactiveBindingsForAction: function(e) {
  43369. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43370. var r = t[i];
  43371. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43372. }
  43373. },
  43374. _lendAction: function(e) {
  43375. var t = this._actions
  43376. , i = e._cacheIndex
  43377. , n = this._nActiveActions++
  43378. , r = t[n];
  43379. t[e._cacheIndex = n] = e,
  43380. t[r._cacheIndex = i] = r
  43381. },
  43382. _takeBackAction: function(e) {
  43383. var t = this._actions
  43384. , i = e._cacheIndex
  43385. , n = --this._nActiveActions
  43386. , r = t[n];
  43387. t[e._cacheIndex = n] = e,
  43388. t[r._cacheIndex = i] = r
  43389. },
  43390. _addInactiveBinding: function(e, t, i) {
  43391. var n = this._bindingsByRootAndName
  43392. , r = n[t]
  43393. , o = this._bindings;
  43394. void 0 === r && (r = {},
  43395. n[t] = r),
  43396. (r[i] = e)._cacheIndex = o.length,
  43397. o.push(e)
  43398. },
  43399. _removeInactiveBinding: function(e) {
  43400. var t = this._bindings
  43401. , i = e.binding
  43402. , n = i.rootNode.uuid
  43403. , r = i.path
  43404. , o = this._bindingsByRootAndName
  43405. , a = o[n]
  43406. , s = t[t.length - 1]
  43407. , l = e._cacheIndex;
  43408. t[s._cacheIndex = l] = s,
  43409. t.pop(),
  43410. delete a[r];
  43411. e: {
  43412. for (var c in a)
  43413. break e;
  43414. delete o[n]
  43415. }
  43416. },
  43417. _lendBinding: function(e) {
  43418. var t = this._bindings
  43419. , i = e._cacheIndex
  43420. , n = this._nActiveBindings++
  43421. , r = t[n];
  43422. t[e._cacheIndex = n] = e,
  43423. t[r._cacheIndex = i] = r
  43424. },
  43425. _takeBackBinding: function(e) {
  43426. var t = this._bindings
  43427. , i = e._cacheIndex
  43428. , n = --this._nActiveBindings
  43429. , r = t[n];
  43430. t[e._cacheIndex = n] = e,
  43431. t[r._cacheIndex = i] = r
  43432. },
  43433. _lendControlInterpolant: function() {
  43434. var e = this._controlInterpolants
  43435. , t = this._nActiveControlInterpolants++
  43436. , i = e[t];
  43437. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43438. i
  43439. },
  43440. _takeBackControlInterpolant: function(e) {
  43441. var t = this._controlInterpolants
  43442. , i = e.__cacheIndex
  43443. , n = --this._nActiveControlInterpolants
  43444. , r = t[n];
  43445. t[e.__cacheIndex = n] = e,
  43446. t[r.__cacheIndex = i] = r
  43447. },
  43448. _controlInterpolantsResultBuffer: new Float32Array(1)
  43449. }),
  43450. Ci.AnimationObjectGroup = function(e) {
  43451. this.uuid = Ci.Math.generateUUID(),
  43452. this._objects = Array.prototype.slice.call(arguments),
  43453. this.nCachedObjects_ = 0;
  43454. var t = {};
  43455. this._indicesByUUID = t;
  43456. for (var i = 0, n = arguments.length; i !== n; ++i)
  43457. t[arguments[i].uuid] = i;
  43458. this._paths = [],
  43459. this._parsedPaths = [],
  43460. this._bindings = [],
  43461. this._bindingsIndicesByPath = {};
  43462. var r = this;
  43463. this.stats = {
  43464. objects: {
  43465. get total() {
  43466. return r._objects.length
  43467. },
  43468. get inUse() {
  43469. return this.total - r.nCachedObjects_
  43470. }
  43471. },
  43472. get bindingsPerObject() {
  43473. return r._bindings.length
  43474. }
  43475. }
  43476. }
  43477. ,
  43478. Ci.AnimationObjectGroup.prototype = {
  43479. constructor: Ci.AnimationObjectGroup,
  43480. add: function(e) {
  43481. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  43482. var u = arguments[c]
  43483. , d = u.uuid
  43484. , p = r[d];
  43485. if (void 0 === p) {
  43486. p = i++,
  43487. r[d] = p,
  43488. t.push(u);
  43489. for (var f = 0, g = l; f !== g; ++f)
  43490. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43491. } else if (p < n) {
  43492. var m = t[p]
  43493. , v = --n
  43494. , y = t[v];
  43495. t[r[y.uuid] = p] = y,
  43496. t[r[d] = v] = u;
  43497. for (f = 0,
  43498. g = l; f !== g; ++f) {
  43499. var A = s[f]
  43500. , C = A[v]
  43501. , I = A[p];
  43502. A[p] = C,
  43503. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43504. A[v] = I
  43505. }
  43506. } else
  43507. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43508. }
  43509. this.nCachedObjects_ = n
  43510. },
  43511. remove: function(e) {
  43512. for (var t = this._objects, i = (t.length,
  43513. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43514. var l = arguments[a]
  43515. , c = l.uuid
  43516. , h = n[c];
  43517. if (void 0 !== h && i <= h) {
  43518. var u = i++
  43519. , d = t[u];
  43520. t[n[d.uuid] = h] = d,
  43521. t[n[c] = u] = l;
  43522. for (var p = 0, f = o; p !== f; ++p) {
  43523. var g = r[p]
  43524. , m = g[u]
  43525. , v = g[h];
  43526. g[h] = m,
  43527. g[u] = v
  43528. }
  43529. }
  43530. }
  43531. this.nCachedObjects_ = i
  43532. },
  43533. uncache: function(e) {
  43534. 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) {
  43535. var c = arguments[s].uuid
  43536. , h = r[c];
  43537. if (void 0 !== h)
  43538. if (delete r[c],
  43539. h < n) {
  43540. var u = --n
  43541. , d = t[u]
  43542. , p = t[y = --i];
  43543. t[r[d.uuid] = h] = d,
  43544. t[r[p.uuid] = u] = p,
  43545. t.pop();
  43546. for (var f = 0, g = a; f !== g; ++f) {
  43547. var m = (A = o[f])[u]
  43548. , v = A[y];
  43549. A[h] = m,
  43550. A[u] = v,
  43551. A.pop()
  43552. }
  43553. } else {
  43554. var y;
  43555. t[r[(p = t[y = --i]).uuid] = h] = p,
  43556. t.pop();
  43557. for (f = 0,
  43558. g = a; f !== g; ++f) {
  43559. var A;
  43560. (A = o[f])[h] = A[y],
  43561. A.pop()
  43562. }
  43563. }
  43564. }
  43565. this.nCachedObjects_ = n
  43566. },
  43567. subscribe_: function(e, t) {
  43568. var i = this._bindingsIndicesByPath
  43569. , n = i[e]
  43570. , r = this._bindings;
  43571. if (void 0 !== n)
  43572. return r[n];
  43573. var o = this._paths
  43574. , a = this._parsedPaths
  43575. , s = this._objects
  43576. , l = s.length
  43577. , c = this.nCachedObjects_
  43578. , h = new Array(l);
  43579. n = r.length,
  43580. i[e] = n,
  43581. o.push(e),
  43582. a.push(t),
  43583. r.push(h);
  43584. for (var u = c, d = s.length; u !== d; ++u) {
  43585. var p = s[u];
  43586. h[u] = new Ci.PropertyBinding(p,e,t)
  43587. }
  43588. return h
  43589. },
  43590. unsubscribe_: function(e) {
  43591. var t = this._bindingsIndicesByPath
  43592. , i = t[e];
  43593. if (void 0 !== i) {
  43594. var n = this._paths
  43595. , r = this._parsedPaths
  43596. , o = this._bindings
  43597. , a = o.length - 1
  43598. , s = o[a];
  43599. o[t[e[a]] = i] = s,
  43600. o.pop(),
  43601. r[i] = r[a],
  43602. r.pop(),
  43603. n[i] = n[a],
  43604. n.pop()
  43605. }
  43606. }
  43607. },
  43608. Ci.AnimationUtils = {
  43609. arraySlice: function(e, t, i) {
  43610. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43611. },
  43612. convertArray: function(e, t, i) {
  43613. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43614. },
  43615. isTypedArray: function(e) {
  43616. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43617. },
  43618. getKeyframeOrder: function(i) {
  43619. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43620. t[n] = n;
  43621. return t.sort(function(e, t) {
  43622. return i[e] - i[t]
  43623. }),
  43624. t
  43625. },
  43626. sortedArray: function(e, t, i) {
  43627. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43628. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43629. r[a++] = e[s + l];
  43630. return r
  43631. },
  43632. flattenJSON: function(e, t, i, n) {
  43633. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43634. o = e[r++];
  43635. if (void 0 !== o) {
  43636. var a = o[n];
  43637. if (void 0 !== a)
  43638. if (Array.isArray(a))
  43639. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43640. i.push.apply(i, a)),
  43641. void 0 !== (o = e[r++]); )
  43642. ;
  43643. else if (void 0 !== a.toArray)
  43644. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43645. a.toArray(i, i.length)),
  43646. void 0 !== (o = e[r++]); )
  43647. ;
  43648. else
  43649. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43650. i.push(a)),
  43651. void 0 !== (o = e[r++]); )
  43652. ;
  43653. }
  43654. }
  43655. },
  43656. Ci.KeyframeTrack = function(e, t, i, n) {
  43657. if (void 0 === e)
  43658. throw new Error("track name is undefined");
  43659. if (void 0 === t || 0 === t.length)
  43660. throw new Error("no keyframes in track named " + e);
  43661. this.name = e,
  43662. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43663. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43664. this.setInterpolation(n || this.DefaultInterpolation),
  43665. this.validate(),
  43666. this.optimize()
  43667. }
  43668. ,
  43669. Ci.KeyframeTrack.prototype = {
  43670. constructor: Ci.KeyframeTrack,
  43671. TimeBufferType: Float32Array,
  43672. ValueBufferType: Float32Array,
  43673. DefaultInterpolation: Ci.InterpolateLinear,
  43674. InterpolantFactoryMethodDiscrete: function(e) {
  43675. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43676. },
  43677. InterpolantFactoryMethodLinear: function(e) {
  43678. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43679. },
  43680. InterpolantFactoryMethodSmooth: function(e) {
  43681. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43682. },
  43683. setInterpolation: function(e) {
  43684. var t = void 0;
  43685. switch (e) {
  43686. case Ci.InterpolateDiscrete:
  43687. t = this.InterpolantFactoryMethodDiscrete;
  43688. break;
  43689. case Ci.InterpolateLinear:
  43690. t = this.InterpolantFactoryMethodLinear;
  43691. break;
  43692. case Ci.InterpolateSmooth:
  43693. t = this.InterpolantFactoryMethodSmooth
  43694. }
  43695. if (void 0 !== t)
  43696. this.createInterpolant = t;
  43697. else {
  43698. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43699. if (void 0 === this.createInterpolant) {
  43700. if (e === this.DefaultInterpolation)
  43701. throw new Error(i);
  43702. this.setInterpolation(this.DefaultInterpolation)
  43703. }
  43704. console.warn(i)
  43705. }
  43706. },
  43707. getInterpolation: function() {
  43708. switch (this.createInterpolant) {
  43709. case this.InterpolantFactoryMethodDiscrete:
  43710. return Ci.InterpolateDiscrete;
  43711. case this.InterpolantFactoryMethodLinear:
  43712. return Ci.InterpolateLinear;
  43713. case this.InterpolantFactoryMethodSmooth:
  43714. return Ci.InterpolateSmooth
  43715. }
  43716. },
  43717. getValueSize: function() {
  43718. return this.values.length / this.times.length
  43719. },
  43720. shift: function(e) {
  43721. if (0 !== e)
  43722. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43723. t[i] += e;
  43724. return this
  43725. },
  43726. scale: function(e) {
  43727. if (1 !== e)
  43728. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43729. t[i] *= e;
  43730. return this
  43731. },
  43732. trim: function(e, t) {
  43733. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43734. ++r;
  43735. for (; -1 !== o && i[o] > t; )
  43736. --o;
  43737. if (++o,
  43738. 0 !== r || o !== n) {
  43739. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43740. var a = this.getValueSize();
  43741. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43742. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43743. }
  43744. return this
  43745. },
  43746. validate: function() {
  43747. var e = !0
  43748. , t = this.getValueSize();
  43749. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43750. e = !1);
  43751. var i = this.times
  43752. , n = this.values
  43753. , r = i.length;
  43754. 0 === r && (console.error("track is empty", this),
  43755. e = !1);
  43756. for (var o = null, a = 0; a !== r; a++) {
  43757. var s = i[a];
  43758. if ("number" == typeof s && isNaN(s)) {
  43759. console.error("time is not a valid number", this, a, s),
  43760. e = !1;
  43761. break
  43762. }
  43763. if (null !== o && s < o) {
  43764. console.error("out of order keys", this, a, s, o),
  43765. e = !1;
  43766. break
  43767. }
  43768. o = s
  43769. }
  43770. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43771. a = 0;
  43772. for (var l = n.length; a !== l; ++a) {
  43773. var c = n[a];
  43774. if (isNaN(c)) {
  43775. console.error("value is not a valid number", this, a, c),
  43776. e = !1;
  43777. break
  43778. }
  43779. }
  43780. }
  43781. return e
  43782. },
  43783. optimize: function() {
  43784. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43785. var a = !1
  43786. , s = e[r];
  43787. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43788. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43789. var d = t[l + u];
  43790. if (d !== t[c + u] || d !== t[h + u]) {
  43791. a = !0;
  43792. break
  43793. }
  43794. }
  43795. if (a) {
  43796. if (r !== n) {
  43797. e[n] = e[r];
  43798. var p = r * i
  43799. , f = n * i;
  43800. for (u = 0; u !== i; ++u)
  43801. t[f + u] = t[p + u]
  43802. }
  43803. ++n
  43804. }
  43805. }
  43806. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43807. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43808. this
  43809. }
  43810. },
  43811. Object.assign(Ci.KeyframeTrack, {
  43812. parse: function(e) {
  43813. if (void 0 === e.type)
  43814. throw new Error("track type undefined, can not parse");
  43815. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43816. if (void 0 === e.times) {
  43817. console.warn("legacy JSON format detected, converting");
  43818. var i = []
  43819. , n = [];
  43820. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43821. e.times = i,
  43822. e.values = n
  43823. }
  43824. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43825. },
  43826. toJSON: function(e) {
  43827. var t, i = e.constructor;
  43828. if (void 0 !== i.toJSON)
  43829. t = i.toJSON(e);
  43830. else {
  43831. t = {
  43832. name: e.name,
  43833. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43834. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43835. };
  43836. var n = e.getInterpolation();
  43837. n !== e.DefaultInterpolation && (t.interpolation = n)
  43838. }
  43839. return t.type = e.ValueTypeName,
  43840. t
  43841. },
  43842. _getTrackTypeForValueTypeName: function(e) {
  43843. switch (e.toLowerCase()) {
  43844. case "scalar":
  43845. case "double":
  43846. case "float":
  43847. case "number":
  43848. case "integer":
  43849. return Ci.NumberKeyframeTrack;
  43850. case "vector":
  43851. case "vector2":
  43852. case "vector3":
  43853. case "vector4":
  43854. return Ci.VectorKeyframeTrack;
  43855. case "color":
  43856. return Ci.ColorKeyframeTrack;
  43857. case "quaternion":
  43858. return Ci.QuaternionKeyframeTrack;
  43859. case "bool":
  43860. case "boolean":
  43861. return Ci.BooleanKeyframeTrack;
  43862. case "string":
  43863. return Ci.StringKeyframeTrack
  43864. }
  43865. throw new Error("Unsupported typeName: " + e)
  43866. }
  43867. }),
  43868. Ci.PropertyBinding = function(e, t, i) {
  43869. this.path = t,
  43870. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43871. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43872. this.rootNode = e
  43873. }
  43874. ,
  43875. Ci.PropertyBinding.prototype = {
  43876. constructor: Ci.PropertyBinding,
  43877. getValue: function(e, t) {
  43878. this.bind(),
  43879. this.getValue(e, t)
  43880. },
  43881. setValue: function(e, t) {
  43882. this.bind(),
  43883. this.setValue(e, t)
  43884. },
  43885. bind: function() {
  43886. var e = this.node
  43887. , t = this.parsedPath
  43888. , i = t.objectName
  43889. , n = t.propertyName
  43890. , r = t.propertyIndex;
  43891. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43892. this.node = e),
  43893. this.getValue = this._getValue_unavailable,
  43894. this.setValue = this._setValue_unavailable,
  43895. e) {
  43896. if (i) {
  43897. var o = t.objectIndex;
  43898. switch (i) {
  43899. case "materials":
  43900. if (!e.material)
  43901. return void console.error(" can not bind to material as node does not have a material", this);
  43902. if (!e.material.materials)
  43903. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43904. e = e.material.materials;
  43905. break;
  43906. case "bones":
  43907. if (!e.skeleton)
  43908. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43909. e = e.skeleton.bones;
  43910. for (var a = 0; a < e.length; a++)
  43911. if (e[a].name === o) {
  43912. o = a;
  43913. break
  43914. }
  43915. break;
  43916. default:
  43917. if (void 0 === e[i])
  43918. return void console.error(" can not bind to objectName of node, undefined", this);
  43919. e = e[i]
  43920. }
  43921. if (void 0 !== o) {
  43922. if (void 0 === e[o])
  43923. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43924. e = e[o]
  43925. }
  43926. }
  43927. var s = e[n];
  43928. if (s) {
  43929. var l = this.Versioning.None;
  43930. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43931. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43932. this.targetObject = e);
  43933. var c = this.BindingType.Direct;
  43934. if (void 0 !== r) {
  43935. if ("morphTargetInfluences" === n) {
  43936. if (!e.geometry)
  43937. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43938. if (!e.geometry.morphTargets)
  43939. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43940. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43941. if (e.geometry.morphTargets[a].name === r) {
  43942. r = a;
  43943. break
  43944. }
  43945. }
  43946. c = this.BindingType.ArrayElement,
  43947. this.resolvedProperty = s,
  43948. this.propertyIndex = r
  43949. } else
  43950. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43951. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43952. this.resolvedProperty = s) : this.propertyName = n;
  43953. this.getValue = this.GetterByBindingType[c],
  43954. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43955. } else {
  43956. var h = t.nodeName;
  43957. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43958. }
  43959. } else
  43960. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43961. },
  43962. unbind: function() {
  43963. this.node = null,
  43964. this.getValue = this._getValue_unbound,
  43965. this.setValue = this._setValue_unbound
  43966. }
  43967. },
  43968. Object.assign(Ci.PropertyBinding.prototype, {
  43969. _getValue_unavailable: function() {},
  43970. _setValue_unavailable: function() {},
  43971. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43972. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43973. BindingType: {
  43974. Direct: 0,
  43975. EntireArray: 1,
  43976. ArrayElement: 2,
  43977. HasFromToArray: 3
  43978. },
  43979. Versioning: {
  43980. None: 0,
  43981. NeedsUpdate: 1,
  43982. MatrixWorldNeedsUpdate: 2
  43983. },
  43984. GetterByBindingType: [function(e, t) {
  43985. e[t] = this.node[this.propertyName]
  43986. }
  43987. , function(e, t) {
  43988. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43989. e[t++] = i[n]
  43990. }
  43991. , function(e, t) {
  43992. e[t] = this.resolvedProperty[this.propertyIndex]
  43993. }
  43994. , function(e, t) {
  43995. this.resolvedProperty.toArray(e, t)
  43996. }
  43997. ],
  43998. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43999. this.node[this.propertyName] = e[t]
  44000. }
  44001. , function(e, t) {
  44002. this.node[this.propertyName] = e[t],
  44003. this.targetObject.needsUpdate = !0
  44004. }
  44005. , function(e, t) {
  44006. this.node[this.propertyName] = e[t],
  44007. this.targetObject.matrixWorldNeedsUpdate = !0
  44008. }
  44009. ], [function(e, t) {
  44010. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44011. i[n] = e[t++]
  44012. }
  44013. , function(e, t) {
  44014. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44015. i[n] = e[t++];
  44016. this.targetObject.needsUpdate = !0
  44017. }
  44018. , function(e, t) {
  44019. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44020. i[n] = e[t++];
  44021. this.targetObject.matrixWorldNeedsUpdate = !0
  44022. }
  44023. ], [function(e, t) {
  44024. this.resolvedProperty[this.propertyIndex] = e[t]
  44025. }
  44026. , function(e, t) {
  44027. this.resolvedProperty[this.propertyIndex] = e[t],
  44028. this.targetObject.needsUpdate = !0
  44029. }
  44030. , function(e, t) {
  44031. this.resolvedProperty[this.propertyIndex] = e[t],
  44032. this.targetObject.matrixWorldNeedsUpdate = !0
  44033. }
  44034. ], [function(e, t) {
  44035. this.resolvedProperty.fromArray(e, t)
  44036. }
  44037. , function(e, t) {
  44038. this.resolvedProperty.fromArray(e, t),
  44039. this.targetObject.needsUpdate = !0
  44040. }
  44041. , function(e, t) {
  44042. this.resolvedProperty.fromArray(e, t),
  44043. this.targetObject.matrixWorldNeedsUpdate = !0
  44044. }
  44045. ]]
  44046. }),
  44047. Ci.PropertyBinding.Composite = function(e, t, i) {
  44048. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44049. this._targetGroup = e,
  44050. this._bindings = e.subscribe_(t, n)
  44051. }
  44052. ,
  44053. Ci.PropertyBinding.Composite.prototype = {
  44054. constructor: Ci.PropertyBinding.Composite,
  44055. getValue: function(e, t) {
  44056. this.bind();
  44057. var i = this._targetGroup.nCachedObjects_
  44058. , n = this._bindings[i];
  44059. void 0 !== n && n.getValue(e, t)
  44060. },
  44061. setValue: function(e, t) {
  44062. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44063. i[n].setValue(e, t)
  44064. },
  44065. bind: function() {
  44066. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44067. e[t].bind()
  44068. },
  44069. unbind: function() {
  44070. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44071. e[t].unbind()
  44072. }
  44073. },
  44074. Ci.PropertyBinding.create = function(e, t, i) {
  44075. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44076. }
  44077. ,
  44078. Ci.PropertyBinding.parseTrackName = function(e) {
  44079. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44080. , i = t.exec(e);
  44081. if (!i)
  44082. throw new Error("cannot parse trackName at all: " + e);
  44083. i.index === t.lastIndex && t.lastIndex++;
  44084. var n = {
  44085. nodeName: i[3],
  44086. objectName: i[5],
  44087. objectIndex: i[7],
  44088. propertyName: i[9],
  44089. propertyIndex: i[11]
  44090. };
  44091. if (null === n.propertyName || 0 === n.propertyName.length)
  44092. throw new Error("can not parse propertyName from trackName: " + e);
  44093. return n
  44094. }
  44095. ,
  44096. Ci.PropertyBinding.findNode = function(e, r) {
  44097. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44098. return e;
  44099. if (e.skeleton) {
  44100. var t = function(e) {
  44101. for (var t = 0; t < e.bones.length; t++) {
  44102. var i = e.bones[t];
  44103. if (i.name === r)
  44104. return i
  44105. }
  44106. return null
  44107. }(e.skeleton);
  44108. if (t)
  44109. return t
  44110. }
  44111. if (e.children) {
  44112. var o = function(e) {
  44113. for (var t = 0; t < e.length; t++) {
  44114. var i = e[t];
  44115. if (i.name === r || i.uuid === r)
  44116. return i;
  44117. var n = o(i.children);
  44118. if (n)
  44119. return n
  44120. }
  44121. return null
  44122. }
  44123. , i = o(e.children);
  44124. if (i)
  44125. return i
  44126. }
  44127. return null
  44128. }
  44129. ,
  44130. Ci.PropertyMixer = function(e, t, i) {
  44131. this.binding = e,
  44132. this.valueSize = i;
  44133. var n, r = Float64Array;
  44134. switch (t) {
  44135. case "quaternion":
  44136. n = this._slerp;
  44137. break;
  44138. case "string":
  44139. case "bool":
  44140. r = Array,
  44141. n = this._select;
  44142. break;
  44143. default:
  44144. n = this._lerp
  44145. }
  44146. this.buffer = new r(4 * i),
  44147. this._mixBufferRegion = n,
  44148. this.cumulativeWeight = 0,
  44149. this.useCount = 0,
  44150. this.referenceCount = 0
  44151. }
  44152. ,
  44153. Ci.PropertyMixer.prototype = {
  44154. constructor: Ci.PropertyMixer,
  44155. accumulate: function(e, t) {
  44156. var i = this.buffer
  44157. , n = this.valueSize
  44158. , r = e * n + n
  44159. , o = this.cumulativeWeight;
  44160. if (0 === o) {
  44161. for (var a = 0; a !== n; ++a)
  44162. i[r + a] = i[a];
  44163. o = t
  44164. } else {
  44165. var s = t / (o += t);
  44166. this._mixBufferRegion(i, r, 0, s, n)
  44167. }
  44168. this.cumulativeWeight = o
  44169. },
  44170. apply: function(e) {
  44171. var t = this.valueSize
  44172. , i = this.buffer
  44173. , n = e * t + t
  44174. , r = this.cumulativeWeight
  44175. , o = this.binding;
  44176. if (this.cumulativeWeight = 0,
  44177. r < 1) {
  44178. var a = 3 * t;
  44179. this._mixBufferRegion(i, n, a, 1 - r, t)
  44180. }
  44181. for (var s = t, l = t + t; s !== l; ++s)
  44182. if (i[s] !== i[s + t]) {
  44183. o.setValue(i, n);
  44184. break
  44185. }
  44186. },
  44187. saveOriginalState: function() {
  44188. var e = this.binding
  44189. , t = this.buffer
  44190. , i = this.valueSize
  44191. , n = 3 * i;
  44192. e.getValue(t, n);
  44193. for (var r = i, o = n; r !== o; ++r)
  44194. t[r] = t[n + r % i];
  44195. this.cumulativeWeight = 0
  44196. },
  44197. restoreOriginalState: function() {
  44198. var e = 3 * this.valueSize;
  44199. this.binding.setValue(this.buffer, e)
  44200. },
  44201. _select: function(e, t, i, n, r) {
  44202. if (.5 <= n)
  44203. for (var o = 0; o !== r; ++o)
  44204. e[t + o] = e[i + o]
  44205. },
  44206. _slerp: function(e, t, i, n, r) {
  44207. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44208. },
  44209. _lerp: function(e, t, i, n, r) {
  44210. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44211. var s = t + a;
  44212. e[s] = e[s] * o + e[i + a] * n
  44213. }
  44214. }
  44215. },
  44216. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44217. Ci.KeyframeTrack.call(this, e, t, i)
  44218. }
  44219. ,
  44220. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44221. constructor: Ci.BooleanKeyframeTrack,
  44222. ValueTypeName: "bool",
  44223. ValueBufferType: Array,
  44224. DefaultInterpolation: Ci.IntepolateDiscrete,
  44225. InterpolantFactoryMethodLinear: void 0,
  44226. InterpolantFactoryMethodSmooth: void 0
  44227. }),
  44228. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44229. Ci.KeyframeTrack.call(this, e, t, i, n)
  44230. }
  44231. ,
  44232. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44233. constructor: Ci.NumberKeyframeTrack,
  44234. ValueTypeName: "number"
  44235. }),
  44236. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44237. Ci.KeyframeTrack.call(this, e, t, i, n)
  44238. }
  44239. ,
  44240. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44241. constructor: Ci.QuaternionKeyframeTrack,
  44242. ValueTypeName: "quaternion",
  44243. DefaultInterpolation: Ci.InterpolateLinear,
  44244. InterpolantFactoryMethodLinear: function(e) {
  44245. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44246. },
  44247. InterpolantFactoryMethodSmooth: void 0
  44248. }),
  44249. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44250. Ci.KeyframeTrack.call(this, e, t, i, n)
  44251. }
  44252. ,
  44253. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44254. constructor: Ci.StringKeyframeTrack,
  44255. ValueTypeName: "string",
  44256. ValueBufferType: Array,
  44257. DefaultInterpolation: Ci.IntepolateDiscrete,
  44258. InterpolantFactoryMethodLinear: void 0,
  44259. InterpolantFactoryMethodSmooth: void 0
  44260. }),
  44261. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44262. Ci.KeyframeTrack.call(this, e, t, i, n)
  44263. }
  44264. ,
  44265. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44266. constructor: Ci.VectorKeyframeTrack,
  44267. ValueTypeName: "vector"
  44268. }),
  44269. Ci.Audio = function(e) {
  44270. Ci.Object3D.call(this),
  44271. this.type = "Audio",
  44272. this.context = e.context,
  44273. this.source = this.context.createBufferSource(),
  44274. this.source.onended = this.onEnded.bind(this),
  44275. this.gain = this.context.createGain(),
  44276. this.gain.connect(e.getInput()),
  44277. this.autoplay = !1,
  44278. this.startTime = 0,
  44279. this.playbackRate = 1,
  44280. this.isPlaying = !1,
  44281. this.hasPlaybackControl = !0,
  44282. this.sourceType = "empty",
  44283. this.filter = null
  44284. }
  44285. ,
  44286. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44287. Ci.Audio.prototype.constructor = Ci.Audio,
  44288. Ci.Audio.prototype.getOutput = function() {
  44289. return this.gain
  44290. }
  44291. ,
  44292. Ci.Audio.prototype.load = function(e) {
  44293. var t = new Ci.AudioBuffer(this.context);
  44294. return t.load(e),
  44295. this.setBuffer(t),
  44296. this
  44297. }
  44298. ,
  44299. Ci.Audio.prototype.setNodeSource = function(e) {
  44300. return this.hasPlaybackControl = !1,
  44301. this.sourceType = "audioNode",
  44302. this.source = e,
  44303. this.connect(),
  44304. this
  44305. }
  44306. ,
  44307. Ci.Audio.prototype.setBuffer = function(e) {
  44308. var t = this;
  44309. return e.onReady(function(e) {
  44310. t.source.buffer = e,
  44311. t.sourceType = "buffer",
  44312. t.autoplay && t.play()
  44313. }),
  44314. this
  44315. }
  44316. ,
  44317. Ci.Audio.prototype.play = function() {
  44318. if (!0 !== this.isPlaying)
  44319. if (!1 !== this.hasPlaybackControl) {
  44320. var e = this.context.createBufferSource();
  44321. e.buffer = this.source.buffer,
  44322. e.loop = this.source.loop,
  44323. e.onended = this.source.onended,
  44324. e.start(0, this.startTime),
  44325. e.playbackRate.value = this.playbackRate,
  44326. this.isPlaying = !0,
  44327. this.source = e,
  44328. this.connect()
  44329. } else
  44330. console.warn("THREE.Audio: this Audio has no playback control.");
  44331. else
  44332. console.warn("THREE.Audio: Audio is already playing.")
  44333. }
  44334. ,
  44335. Ci.Audio.prototype.pause = function() {
  44336. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44337. void (this.startTime = this.context.currentTime))
  44338. }
  44339. ,
  44340. Ci.Audio.prototype.stop = function() {
  44341. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44342. void (this.startTime = 0))
  44343. }
  44344. ,
  44345. Ci.Audio.prototype.connect = function() {
  44346. null !== this.filter ? (this.source.connect(this.filter),
  44347. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44348. }
  44349. ,
  44350. Ci.Audio.prototype.disconnect = function() {
  44351. null !== this.filter ? (this.source.disconnect(this.filter),
  44352. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44353. }
  44354. ,
  44355. Ci.Audio.prototype.getFilter = function() {
  44356. return this.filter
  44357. }
  44358. ,
  44359. Ci.Audio.prototype.setFilter = function(e) {
  44360. void 0 === e && (e = null),
  44361. !0 === this.isPlaying ? (this.disconnect(),
  44362. this.filter = e,
  44363. this.connect()) : this.filter = e
  44364. }
  44365. ,
  44366. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44367. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44368. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44369. }
  44370. ,
  44371. Ci.Audio.prototype.getPlaybackRate = function() {
  44372. return this.playbackRate
  44373. }
  44374. ,
  44375. Ci.Audio.prototype.onEnded = function() {
  44376. this.isPlaying = !1
  44377. }
  44378. ,
  44379. Ci.Audio.prototype.setLoop = function(e) {
  44380. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44381. }
  44382. ,
  44383. Ci.Audio.prototype.getLoop = function() {
  44384. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44385. !1) : this.source.loop
  44386. }
  44387. ,
  44388. Ci.Audio.prototype.setVolume = function(e) {
  44389. this.gain.gain.value = e
  44390. }
  44391. ,
  44392. Ci.Audio.prototype.getVolume = function() {
  44393. return this.gain.gain.value
  44394. }
  44395. ,
  44396. Ci.AudioAnalyser = function(e, t) {
  44397. this.analyser = e.context.createAnalyser(),
  44398. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44399. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44400. e.getOutput().connect(this.analyser)
  44401. }
  44402. ,
  44403. Ci.AudioAnalyser.prototype = {
  44404. constructor: Ci.AudioAnalyser,
  44405. getData: function() {
  44406. return this.analyser.getByteFrequencyData(this.data),
  44407. this.data
  44408. }
  44409. },
  44410. Ci.AudioBuffer = function(e) {
  44411. this.context = e,
  44412. this.ready = !1,
  44413. this.readyCallbacks = []
  44414. }
  44415. ,
  44416. Ci.AudioBuffer.prototype.load = function(e) {
  44417. var i = this
  44418. , t = new XMLHttpRequest;
  44419. return t.open("GET", e, !0),
  44420. t.responseType = "arraybuffer",
  44421. t.onload = function(e) {
  44422. i.context.decodeAudioData(this.response, function(e) {
  44423. i.buffer = e,
  44424. i.ready = !0;
  44425. for (var t = 0; t < i.readyCallbacks.length; t++)
  44426. i.readyCallbacks[t](i.buffer);
  44427. i.readyCallbacks = []
  44428. })
  44429. }
  44430. ,
  44431. t.send(),
  44432. this
  44433. }
  44434. ,
  44435. Ci.AudioBuffer.prototype.onReady = function(e) {
  44436. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44437. }
  44438. ,
  44439. Ci.PositionalAudio = function(e) {
  44440. Ci.Audio.call(this, e),
  44441. this.panner = this.context.createPanner(),
  44442. this.panner.connect(this.gain)
  44443. }
  44444. ,
  44445. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44446. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44447. Ci.PositionalAudio.prototype.getOutput = function() {
  44448. return this.panner
  44449. }
  44450. ,
  44451. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44452. this.panner.refDistance = e
  44453. }
  44454. ,
  44455. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44456. return this.panner.refDistance
  44457. }
  44458. ,
  44459. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44460. this.panner.rolloffFactor = e
  44461. }
  44462. ,
  44463. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44464. return this.panner.rolloffFactor
  44465. }
  44466. ,
  44467. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44468. this.panner.distanceModel = e
  44469. }
  44470. ,
  44471. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44472. return this.panner.distanceModel
  44473. }
  44474. ,
  44475. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44476. this.panner.maxDistance = e
  44477. }
  44478. ,
  44479. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44480. return this.panner.maxDistance
  44481. }
  44482. ,
  44483. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44484. function(e) {
  44485. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44486. it.setFromMatrixPosition(this.matrixWorld),
  44487. this.panner.setPosition(it.x, it.y, it.z)
  44488. }
  44489. ),
  44490. Ci.AudioListener = function() {
  44491. Ci.Object3D.call(this),
  44492. this.type = "AudioListener",
  44493. this.context = new (window.AudioContext || window.webkitAudioContext),
  44494. this.gain = this.context.createGain(),
  44495. this.gain.connect(this.context.destination),
  44496. this.filter = null
  44497. }
  44498. ,
  44499. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44500. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44501. Ci.AudioListener.prototype.getInput = function() {
  44502. return this.gain
  44503. }
  44504. ,
  44505. Ci.AudioListener.prototype.removeFilter = function() {
  44506. null !== this.filter && (this.gain.disconnect(this.filter),
  44507. this.filter.disconnect(this.context.destination),
  44508. this.gain.connect(this.context.destination),
  44509. this.filter = null)
  44510. }
  44511. ,
  44512. Ci.AudioListener.prototype.setFilter = function(e) {
  44513. null !== this.filter ? (this.gain.disconnect(this.filter),
  44514. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44515. this.filter = e,
  44516. this.gain.connect(this.filter),
  44517. this.filter.connect(this.context.destination)
  44518. }
  44519. ,
  44520. Ci.AudioListener.prototype.getFilter = function() {
  44521. return this.filter
  44522. }
  44523. ,
  44524. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44525. this.gain.gain.value = e
  44526. }
  44527. ,
  44528. Ci.AudioListener.prototype.getMasterVolume = function() {
  44529. return this.gain.gain.value
  44530. }
  44531. ,
  44532. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44533. $e = new Ci.Quaternion,
  44534. et = new Ci.Vector3,
  44535. tt = new Ci.Vector3,
  44536. function(e) {
  44537. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44538. var t = this.context.listener
  44539. , i = this.up;
  44540. this.matrixWorld.decompose(Je, $e, et),
  44541. tt.set(0, 0, -1).applyQuaternion($e),
  44542. t.setPosition(Je.x, Je.y, Je.z),
  44543. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44544. }
  44545. ),
  44546. Ci.Camera = function() {
  44547. Ci.Object3D.call(this),
  44548. this.type = "Camera",
  44549. this.matrixWorldInverse = new Ci.Matrix4,
  44550. this.projectionMatrix = new Ci.Matrix4
  44551. }
  44552. ,
  44553. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44554. Ci.Camera.prototype.constructor = Ci.Camera,
  44555. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44556. function(e) {
  44557. var t = e || new Ci.Vector3;
  44558. return this.getWorldQuaternion(Qe),
  44559. t.set(0, 0, -1).applyQuaternion(Qe)
  44560. }
  44561. ),
  44562. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44563. function(e) {
  44564. Ke.lookAt(this.position, e, this.up),
  44565. this.quaternion.setFromRotationMatrix(Ke)
  44566. }
  44567. ),
  44568. Ci.Camera.prototype.clone = function() {
  44569. return (new this.constructor).copy(this)
  44570. }
  44571. ,
  44572. Ci.Camera.prototype.copy = function(e) {
  44573. return Ci.Object3D.prototype.copy.call(this, e),
  44574. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44575. this.projectionMatrix.copy(e.projectionMatrix),
  44576. this
  44577. }
  44578. ,
  44579. Ci.CubeCamera = function(e, t, i) {
  44580. Ci.Object3D.call(this),
  44581. this.type = "CubeCamera";
  44582. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44583. r.up.set(0, -1, 0),
  44584. r.lookAt(new Ci.Vector3(1,0,0)),
  44585. this.add(r);
  44586. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44587. o.up.set(0, -1, 0),
  44588. o.lookAt(new Ci.Vector3(-1,0,0)),
  44589. this.add(o);
  44590. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44591. a.up.set(0, 0, 1),
  44592. a.lookAt(new Ci.Vector3(0,1,0)),
  44593. this.add(a);
  44594. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44595. s.up.set(0, 0, -1),
  44596. s.lookAt(new Ci.Vector3(0,-1,0)),
  44597. this.add(s);
  44598. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44599. l.up.set(0, -1, 0),
  44600. l.lookAt(new Ci.Vector3(0,0,1)),
  44601. this.add(l);
  44602. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44603. c.up.set(0, -1, 0),
  44604. c.lookAt(new Ci.Vector3(0,0,-1)),
  44605. this.add(c);
  44606. var n = {
  44607. format: Ci.RGBFormat,
  44608. magFilter: Ci.LinearFilter,
  44609. minFilter: Ci.LinearFilter
  44610. };
  44611. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44612. this.updateCubeMap = function(e, t) {
  44613. null === this.parent && this.updateMatrixWorld();
  44614. var i = this.renderTarget
  44615. , n = i.texture.generateMipmaps;
  44616. i.texture.generateMipmaps = !1,
  44617. i.activeCubeFace = 0,
  44618. e.render(t, r, i),
  44619. i.activeCubeFace = 1,
  44620. e.render(t, o, i),
  44621. i.activeCubeFace = 2,
  44622. e.render(t, a, i),
  44623. i.activeCubeFace = 3,
  44624. e.render(t, s, i),
  44625. i.activeCubeFace = 4,
  44626. e.render(t, l, i),
  44627. i.texture.generateMipmaps = n,
  44628. i.activeCubeFace = 5,
  44629. e.render(t, c, i),
  44630. e.setRenderTarget(null)
  44631. }
  44632. }
  44633. ,
  44634. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44635. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44636. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44637. Ci.Camera.call(this),
  44638. this.type = "OrthographicCamera",
  44639. this.zoom = 1,
  44640. this.left = e,
  44641. this.right = t,
  44642. this.top = i,
  44643. this.bottom = n,
  44644. this.near = void 0 !== r ? r : .1,
  44645. this.far = void 0 !== o ? o : 2e3,
  44646. this.updateProjectionMatrix()
  44647. }
  44648. ,
  44649. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44650. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44651. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44652. var e = (this.right - this.left) / (2 * this.zoom)
  44653. , t = (this.top - this.bottom) / (2 * this.zoom)
  44654. , i = (this.right + this.left) / 2
  44655. , n = (this.top + this.bottom) / 2;
  44656. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44657. }
  44658. ,
  44659. Ci.OrthographicCamera.prototype.copy = function(e) {
  44660. return Ci.Camera.prototype.copy.call(this, e),
  44661. this.left = e.left,
  44662. this.right = e.right,
  44663. this.top = e.top,
  44664. this.bottom = e.bottom,
  44665. this.near = e.near,
  44666. this.far = e.far,
  44667. this.zoom = e.zoom,
  44668. this
  44669. }
  44670. ,
  44671. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44672. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44673. return t.object.zoom = this.zoom,
  44674. t.object.left = this.left,
  44675. t.object.right = this.right,
  44676. t.object.top = this.top,
  44677. t.object.bottom = this.bottom,
  44678. t.object.near = this.near,
  44679. t.object.far = this.far,
  44680. t
  44681. }
  44682. ,
  44683. Ci.PerspectiveCamera = function(e, t, i, n) {
  44684. Ci.Camera.call(this),
  44685. this.type = "PerspectiveCamera",
  44686. this.focalLength = 10,
  44687. this.zoom = 1,
  44688. this.fov = void 0 !== e ? e : 50,
  44689. this.aspect = void 0 !== t ? t : 1,
  44690. this.near = void 0 !== i ? i : .1,
  44691. this.far = void 0 !== n ? n : 2e3,
  44692. this.updateProjectionMatrix()
  44693. }
  44694. ,
  44695. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44696. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44697. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44698. void 0 === t && (t = 24),
  44699. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44700. this.updateProjectionMatrix()
  44701. }
  44702. ,
  44703. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44704. this.fullWidth = e,
  44705. this.fullHeight = t,
  44706. this.x = i,
  44707. this.y = n,
  44708. this.width = r,
  44709. this.height = o,
  44710. this.updateProjectionMatrix()
  44711. }
  44712. ,
  44713. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44714. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44715. if (this.fullWidth) {
  44716. var t = this.fullWidth / this.fullHeight
  44717. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44718. , n = -i
  44719. , r = t * n
  44720. , o = t * i
  44721. , a = Math.abs(o - r)
  44722. , s = Math.abs(i - n);
  44723. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  44724. } else
  44725. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44726. }
  44727. ,
  44728. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44729. return Ci.Camera.prototype.copy.call(this, e),
  44730. this.focalLength = e.focalLength,
  44731. this.zoom = e.zoom,
  44732. this.fov = e.fov,
  44733. this.aspect = e.aspect,
  44734. this.near = e.near,
  44735. this.far = e.far,
  44736. this
  44737. }
  44738. ,
  44739. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44740. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44741. return t.object.focalLength = this.focalLength,
  44742. t.object.zoom = this.zoom,
  44743. t.object.fov = this.fov,
  44744. t.object.aspect = this.aspect,
  44745. t.object.near = this.near,
  44746. t.object.far = this.far,
  44747. t
  44748. }
  44749. ,
  44750. Ci.StereoCamera = function() {
  44751. this.type = "StereoCamera",
  44752. this.aspect = 1,
  44753. this.cameraL = new Ci.PerspectiveCamera,
  44754. this.cameraL.layers.enable(1),
  44755. this.cameraL.matrixAutoUpdate = !1,
  44756. this.cameraR = new Ci.PerspectiveCamera,
  44757. this.cameraR.layers.enable(2),
  44758. this.cameraR.matrixAutoUpdate = !1
  44759. }
  44760. ,
  44761. Ci.StereoCamera.prototype = {
  44762. constructor: Ci.StereoCamera,
  44763. update: (Xe = new Ci.Matrix4,
  44764. Ze = new Ci.Matrix4,
  44765. function(e) {
  44766. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44767. Ge = e.focalLength,
  44768. We = e.fov,
  44769. je = e.aspect * this.aspect,
  44770. Ye = e.near,
  44771. qe = e.far;
  44772. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44773. Ze.elements[12] = -.032,
  44774. Xe.elements[12] = .032,
  44775. t = -o * je + r,
  44776. i = o * je + r,
  44777. n.elements[0] = 2 * Ye / (i - t),
  44778. n.elements[8] = (i + t) / (i - t),
  44779. this.cameraL.projectionMatrix.copy(n),
  44780. t = -o * je - r,
  44781. i = o * je - r,
  44782. n.elements[0] = 2 * Ye / (i - t),
  44783. n.elements[8] = (i + t) / (i - t),
  44784. this.cameraR.projectionMatrix.copy(n)
  44785. }
  44786. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44787. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44788. }
  44789. )
  44790. },
  44791. Ci.Light = function(e, t) {
  44792. Ci.Object3D.call(this),
  44793. this.type = "Light",
  44794. this.color = new Ci.Color(e),
  44795. this.intensity = void 0 !== t ? t : 1,
  44796. this.receiveShadow = void 0
  44797. }
  44798. ,
  44799. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44800. Ci.Light.prototype.constructor = Ci.Light,
  44801. Ci.Light.prototype.copy = function(e) {
  44802. return Ci.Object3D.prototype.copy.call(this, e),
  44803. this.color.copy(e.color),
  44804. this.intensity = e.intensity,
  44805. this
  44806. }
  44807. ,
  44808. Ci.Light.prototype.toJSON = function(e) {
  44809. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44810. return t.object.color = this.color.getHex(),
  44811. t.object.intensity = this.intensity,
  44812. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44813. void 0 !== this.distance && (t.object.distance = this.distance),
  44814. void 0 !== this.angle && (t.object.angle = this.angle),
  44815. void 0 !== this.decay && (t.object.decay = this.decay),
  44816. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44817. t
  44818. }
  44819. ,
  44820. Ci.LightShadow = function(e) {
  44821. this.camera = e,
  44822. this.bias = 0,
  44823. this.radius = 1,
  44824. this.mapSize = new Ci.Vector2(512,512),
  44825. this.map = null,
  44826. this.matrix = new Ci.Matrix4
  44827. }
  44828. ,
  44829. Ci.LightShadow.prototype = {
  44830. constructor: Ci.LightShadow,
  44831. copy: function(e) {
  44832. return this.camera = e.camera.clone(),
  44833. this.bias = e.bias,
  44834. this.radius = e.radius,
  44835. this.mapSize.copy(e.mapSize),
  44836. this
  44837. },
  44838. clone: function() {
  44839. return (new this.constructor).copy(this)
  44840. }
  44841. },
  44842. Ci.AmbientLight = function(e, t) {
  44843. Ci.Light.call(this, e, t),
  44844. this.type = "AmbientLight",
  44845. this.castShadow = void 0
  44846. }
  44847. ,
  44848. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44849. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44850. Ci.DirectionalLight = function(e, t) {
  44851. Ci.Light.call(this, e, t),
  44852. this.type = "DirectionalLight",
  44853. this.position.set(0, 1, 0),
  44854. this.updateMatrix(),
  44855. this.target = new Ci.Object3D,
  44856. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44857. }
  44858. ,
  44859. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44860. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44861. Ci.DirectionalLight.prototype.copy = function(e) {
  44862. return Ci.Light.prototype.copy.call(this, e),
  44863. this.target = e.target.clone(),
  44864. this.shadow = e.shadow.clone(),
  44865. this
  44866. }
  44867. ,
  44868. Ci.HemisphereLight = function(e, t, i) {
  44869. Ci.Light.call(this, e, i),
  44870. this.type = "HemisphereLight",
  44871. this.castShadow = void 0,
  44872. this.position.set(0, 1, 0),
  44873. this.updateMatrix(),
  44874. this.groundColor = new Ci.Color(t)
  44875. }
  44876. ,
  44877. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44878. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44879. Ci.HemisphereLight.prototype.copy = function(e) {
  44880. return Ci.Light.prototype.copy.call(this, e),
  44881. this.groundColor.copy(e.groundColor),
  44882. this
  44883. }
  44884. ,
  44885. Ci.PointLight = function(e, t, i, n) {
  44886. Ci.Light.call(this, e, t),
  44887. this.type = "PointLight",
  44888. this.distance = void 0 !== i ? i : 0,
  44889. this.decay = void 0 !== n ? n : 1,
  44890. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44891. }
  44892. ,
  44893. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44894. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44895. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44896. get: function() {
  44897. return 4 * this.intensity * Math.PI
  44898. },
  44899. set: function(e) {
  44900. this.intensity = e / (4 * Math.PI)
  44901. }
  44902. }),
  44903. Ci.PointLight.prototype.copy = function(e) {
  44904. return Ci.Light.prototype.copy.call(this, e),
  44905. this.distance = e.distance,
  44906. this.decay = e.decay,
  44907. this.shadow = e.shadow.clone(),
  44908. this
  44909. }
  44910. ,
  44911. Ci.SpotLight = function(e, t, i, n, r, o) {
  44912. Ci.Light.call(this, e, t),
  44913. this.type = "SpotLight",
  44914. this.position.set(0, 1, 0),
  44915. this.updateMatrix(),
  44916. this.target = new Ci.Object3D,
  44917. this.distance = void 0 !== i ? i : 0,
  44918. this.angle = void 0 !== n ? n : Math.PI / 3,
  44919. this.penumbra = void 0 !== r ? r : 0,
  44920. this.decay = void 0 !== o ? o : 1,
  44921. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44922. }
  44923. ,
  44924. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44925. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44926. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44927. get: function() {
  44928. return this.intensity * Math.PI
  44929. },
  44930. set: function(e) {
  44931. this.intensity = e / Math.PI
  44932. }
  44933. }),
  44934. Ci.SpotLight.prototype.copy = function(e) {
  44935. return Ci.Light.prototype.copy.call(this, e),
  44936. this.distance = e.distance,
  44937. this.angle = e.angle,
  44938. this.penumbra = e.penumbra,
  44939. this.decay = e.decay,
  44940. this.target = e.target.clone(),
  44941. this.shadow = e.shadow.clone(),
  44942. this
  44943. }
  44944. ,
  44945. Ci.Cache = {
  44946. enabled: !1,
  44947. files: {},
  44948. add: function(e, t) {
  44949. !1 !== this.enabled && (this.files[e] = t)
  44950. },
  44951. get: function(e) {
  44952. if (!1 !== this.enabled)
  44953. return this.files[e]
  44954. },
  44955. remove: function(e) {
  44956. delete this.files[e]
  44957. },
  44958. clear: function() {
  44959. this.files = {}
  44960. }
  44961. },
  44962. Ci.Loader = function() {
  44963. this.onLoadStart = function() {}
  44964. ,
  44965. this.onLoadProgress = function() {}
  44966. ,
  44967. this.onLoadComplete = function() {}
  44968. }
  44969. ,
  44970. Ci.Loader.prototype = {
  44971. constructor: Ci.Loader,
  44972. crossOrigin: void 0,
  44973. extractUrlBase: function(e) {
  44974. var t = e.split("/");
  44975. return 1 === t.length ? "./" : (t.pop(),
  44976. t.join("/") + "/")
  44977. },
  44978. initMaterials: function(e, t, i) {
  44979. for (var n = [], r = 0; r < e.length; ++r)
  44980. n[r] = this.createMaterial(e[r], t, i);
  44981. return n
  44982. },
  44983. createMaterial: function(e, c, h) {
  44984. function t(e, t, i, n, r) {
  44985. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44986. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44987. He.load(a)),
  44988. void 0 !== t && (o.repeat.fromArray(t),
  44989. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44990. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44991. void 0 !== i && o.offset.fromArray(i),
  44992. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44993. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44994. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44995. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44996. void 0 !== r && (o.anisotropy = r);
  44997. var l = Ci.Math.generateUUID();
  44998. return u[l] = o,
  44999. l
  45000. }
  45001. void 0 === Ue && (Ue = new Ci.Color),
  45002. void 0 === He && (He = new Ci.TextureLoader),
  45003. void 0 === ze && (ze = new Ci.MaterialLoader);
  45004. var u = {}
  45005. , i = {
  45006. uuid: Ci.Math.generateUUID(),
  45007. type: "MeshLambertMaterial"
  45008. };
  45009. for (var n in e) {
  45010. var r = e[n];
  45011. switch (n) {
  45012. case "DbgColor":
  45013. case "DbgIndex":
  45014. case "opticalDensity":
  45015. case "illumination":
  45016. break;
  45017. case "DbgName":
  45018. i.name = r;
  45019. break;
  45020. case "blending":
  45021. i.blending = Ci[r];
  45022. break;
  45023. case "colorAmbient":
  45024. case "mapAmbient":
  45025. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45026. break;
  45027. case "colorDiffuse":
  45028. i.color = Ue.fromArray(r).getHex();
  45029. break;
  45030. case "colorSpecular":
  45031. i.specular = Ue.fromArray(r).getHex();
  45032. break;
  45033. case "colorEmissive":
  45034. i.emissive = Ue.fromArray(r).getHex();
  45035. break;
  45036. case "specularCoef":
  45037. i.shininess = r;
  45038. break;
  45039. case "shading":
  45040. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45041. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45042. break;
  45043. case "mapDiffuse":
  45044. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45045. break;
  45046. case "mapDiffuseRepeat":
  45047. case "mapDiffuseOffset":
  45048. case "mapDiffuseWrap":
  45049. case "mapDiffuseAnisotropy":
  45050. break;
  45051. case "mapLight":
  45052. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45053. break;
  45054. case "mapLightRepeat":
  45055. case "mapLightOffset":
  45056. case "mapLightWrap":
  45057. case "mapLightAnisotropy":
  45058. break;
  45059. case "mapAO":
  45060. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45061. break;
  45062. case "mapAORepeat":
  45063. case "mapAOOffset":
  45064. case "mapAOWrap":
  45065. case "mapAOAnisotropy":
  45066. break;
  45067. case "mapBump":
  45068. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45069. break;
  45070. case "mapBumpScale":
  45071. i.bumpScale = r;
  45072. break;
  45073. case "mapBumpRepeat":
  45074. case "mapBumpOffset":
  45075. case "mapBumpWrap":
  45076. case "mapBumpAnisotropy":
  45077. break;
  45078. case "mapNormal":
  45079. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45080. break;
  45081. case "mapNormalFactor":
  45082. i.normalScale = [r, r];
  45083. break;
  45084. case "mapNormalRepeat":
  45085. case "mapNormalOffset":
  45086. case "mapNormalWrap":
  45087. case "mapNormalAnisotropy":
  45088. break;
  45089. case "mapSpecular":
  45090. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45091. break;
  45092. case "mapSpecularRepeat":
  45093. case "mapSpecularOffset":
  45094. case "mapSpecularWrap":
  45095. case "mapSpecularAnisotropy":
  45096. break;
  45097. case "mapAlpha":
  45098. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45099. break;
  45100. case "mapAlphaRepeat":
  45101. case "mapAlphaOffset":
  45102. case "mapAlphaWrap":
  45103. case "mapAlphaAnisotropy":
  45104. break;
  45105. case "flipSided":
  45106. i.side = Ci.BackSide;
  45107. break;
  45108. case "doubleSided":
  45109. i.side = Ci.DoubleSide;
  45110. break;
  45111. case "transparency":
  45112. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45113. i.opacity = r;
  45114. break;
  45115. case "depthTest":
  45116. case "depthWrite":
  45117. case "colorWrite":
  45118. case "opacity":
  45119. case "reflectivity":
  45120. case "transparent":
  45121. case "visible":
  45122. case "wireframe":
  45123. i[n] = r;
  45124. break;
  45125. case "vertexColors":
  45126. !0 === r && (i.vertexColors = Ci.VertexColors),
  45127. "face" === r && (i.vertexColors = Ci.FaceColors);
  45128. break;
  45129. default:
  45130. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45131. }
  45132. }
  45133. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45134. "MeshPhongMaterial" !== i.type && delete i.specular,
  45135. i.opacity < 1 && (i.transparent = !0),
  45136. ze.setTextures(u),
  45137. ze.parse(i)
  45138. }
  45139. },
  45140. Ci.Loader.Handlers = {
  45141. handlers: [],
  45142. add: function(e, t) {
  45143. this.handlers.push(e, t)
  45144. },
  45145. get: function(e) {
  45146. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45147. var r = t[i]
  45148. , o = t[i + 1];
  45149. if (r.test(e))
  45150. return o
  45151. }
  45152. return null
  45153. }
  45154. },
  45155. Ci.XHRLoader = function(e) {
  45156. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45157. }
  45158. ,
  45159. Ci.XHRLoader.prototype = {
  45160. constructor: Ci.XHRLoader,
  45161. load: function(i, n, t, r) {
  45162. void 0 !== this.path && (i = this.path + i);
  45163. var o = this
  45164. , e = Ci.Cache.get(i);
  45165. if (void 0 !== e)
  45166. return n && setTimeout(function() {
  45167. n(e)
  45168. }, 0),
  45169. e;
  45170. var a = new XMLHttpRequest;
  45171. return a.overrideMimeType("text/plain"),
  45172. a.open("GET", i, !0),
  45173. a.addEventListener("load", function(e) {
  45174. var t = e.target.response;
  45175. Ci.Cache.add(i, t),
  45176. 200 === this.status ? (n && n(t),
  45177. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45178. n && n(t),
  45179. o.manager.itemEnd(i)) : (r && r(e),
  45180. o.manager.itemError(i))
  45181. }, !1),
  45182. void 0 !== t && a.addEventListener("progress", function(e) {
  45183. t(e)
  45184. }, !1),
  45185. a.addEventListener("error", function(e) {
  45186. r && r(e),
  45187. o.manager.itemError(i)
  45188. }, !1),
  45189. void 0 !== this.responseType && (a.responseType = this.responseType),
  45190. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45191. a.send(null),
  45192. o.manager.itemStart(i),
  45193. a
  45194. },
  45195. setPath: function(e) {
  45196. this.path = e
  45197. },
  45198. setResponseType: function(e) {
  45199. this.responseType = e
  45200. },
  45201. setWithCredentials: function(e) {
  45202. this.withCredentials = e
  45203. }
  45204. },
  45205. Ci.FontLoader = function(e) {
  45206. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45207. }
  45208. ,
  45209. Ci.FontLoader.prototype = {
  45210. constructor: Ci.FontLoader,
  45211. load: function(e, t, i, n) {
  45212. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45213. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45214. }, i, n)
  45215. }
  45216. },
  45217. Ci.ImageLoader = function(e) {
  45218. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45219. }
  45220. ,
  45221. Ci.ImageLoader.prototype = {
  45222. constructor: Ci.ImageLoader,
  45223. load: function(t, i, n, r) {
  45224. void 0 !== this.path && (t = this.path + t);
  45225. var o = this
  45226. , e = Ci.Cache.get(t);
  45227. if (void 0 !== e)
  45228. return o.manager.itemStart(t),
  45229. i ? setTimeout(function() {
  45230. i(e),
  45231. o.manager.itemEnd(t)
  45232. }, 0) : o.manager.itemEnd(t),
  45233. e;
  45234. var a = document.createElement("img");
  45235. return a.addEventListener("load", function(e) {
  45236. Ci.Cache.add(t, this),
  45237. i && i(this),
  45238. o.manager.itemEnd(t)
  45239. }, !1),
  45240. void 0 !== n && a.addEventListener("progress", function(e) {
  45241. n(e)
  45242. }, !1),
  45243. a.addEventListener("error", function(e) {
  45244. r && r(e),
  45245. o.manager.itemError(t)
  45246. }, !1),
  45247. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45248. o.manager.itemStart(t),
  45249. a.src = t,
  45250. a
  45251. },
  45252. setCrossOrigin: function(e) {
  45253. this.crossOrigin = e
  45254. },
  45255. setPath: function(e) {
  45256. this.path = e
  45257. }
  45258. },
  45259. Ci.JSONLoader = function(e) {
  45260. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45261. e = void 0),
  45262. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45263. this.withCredentials = !1
  45264. }
  45265. ,
  45266. Ci.JSONLoader.prototype = {
  45267. constructor: Ci.JSONLoader,
  45268. get statusDomElement() {
  45269. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45270. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45271. this._statusDomElement
  45272. },
  45273. load: function(o, a, e, t) {
  45274. var s = this
  45275. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45276. , i = new Ci.XHRLoader(this.manager);
  45277. i.setWithCredentials(this.withCredentials),
  45278. i.load(o, function(e) {
  45279. var t = JSON.parse(e)
  45280. , i = t.metadata;
  45281. if (void 0 !== i) {
  45282. var n = i.type;
  45283. if (void 0 !== n) {
  45284. if ("object" === n.toLowerCase())
  45285. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45286. if ("scene" === n.toLowerCase())
  45287. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45288. }
  45289. }
  45290. var r = s.parse(t, l);
  45291. a(r.geometry, r.materials)
  45292. }, e, t)
  45293. },
  45294. setTexturePath: function(e) {
  45295. this.texturePath = e
  45296. },
  45297. parse: function(D, e) {
  45298. var N = new Ci.Geometry
  45299. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45300. if (function(e) {
  45301. function t(e, t) {
  45302. return e & 1 << t
  45303. }
  45304. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  45305. if (void 0 !== D.uvs) {
  45306. for (i = 0; i < D.uvs.length; i++)
  45307. D.uvs[i].length && L++;
  45308. for (i = 0; i < L; i++)
  45309. N.faceVertexUvs[i] = []
  45310. }
  45311. for (o = 0,
  45312. a = R.length; o < a; )
  45313. (A = new Ci.Vector3).x = R[o++] * e,
  45314. A.y = R[o++] * e,
  45315. A.z = R[o++] * e,
  45316. N.vertices.push(A);
  45317. for (o = 0,
  45318. a = M.length; o < a; )
  45319. if (d = t(u = M[o++], 0),
  45320. p = t(u, 1),
  45321. f = t(u, 3),
  45322. g = t(u, 4),
  45323. m = t(u, 5),
  45324. v = t(u, 6),
  45325. y = t(u, 7),
  45326. d) {
  45327. if ((I = new Ci.Face3).a = M[o],
  45328. I.b = M[o + 1],
  45329. I.c = M[o + 3],
  45330. (E = new Ci.Face3).a = M[o + 1],
  45331. E.b = M[o + 2],
  45332. E.c = M[o + 3],
  45333. o += 4,
  45334. p && (h = M[o++],
  45335. I.materialIndex = h,
  45336. E.materialIndex = h),
  45337. r = N.faces.length,
  45338. f)
  45339. for (i = 0; i < L; i++)
  45340. for (w = D.uvs[i],
  45341. N.faceVertexUvs[i][r] = [],
  45342. N.faceVertexUvs[i][r + 1] = [],
  45343. n = 0; n < 4; n++)
  45344. x = w[2 * (c = M[o++])],
  45345. S = w[2 * c + 1],
  45346. T = new Ci.Vector2(x,S),
  45347. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45348. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45349. if (g && (l = 3 * M[o++],
  45350. I.normal.set(P[l++], P[l++], P[l]),
  45351. E.normal.copy(I.normal)),
  45352. m)
  45353. for (i = 0; i < 4; i++)
  45354. l = 3 * M[o++],
  45355. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45356. 2 !== i && I.vertexNormals.push(b),
  45357. 0 !== i && E.vertexNormals.push(b);
  45358. if (v && (_ = O[s = M[o++]],
  45359. I.color.setHex(_),
  45360. E.color.setHex(_)),
  45361. y)
  45362. for (i = 0; i < 4; i++)
  45363. _ = O[s = M[o++]],
  45364. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45365. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45366. N.faces.push(I),
  45367. N.faces.push(E)
  45368. } else {
  45369. if ((C = new Ci.Face3).a = M[o++],
  45370. C.b = M[o++],
  45371. C.c = M[o++],
  45372. p && (h = M[o++],
  45373. C.materialIndex = h),
  45374. r = N.faces.length,
  45375. f)
  45376. for (i = 0; i < L; i++)
  45377. for (w = D.uvs[i],
  45378. N.faceVertexUvs[i][r] = [],
  45379. n = 0; n < 3; n++)
  45380. x = w[2 * (c = M[o++])],
  45381. S = w[2 * c + 1],
  45382. T = new Ci.Vector2(x,S),
  45383. N.faceVertexUvs[i][r].push(T);
  45384. if (g && (l = 3 * M[o++],
  45385. C.normal.set(P[l++], P[l++], P[l])),
  45386. m)
  45387. for (i = 0; i < 3; i++)
  45388. l = 3 * M[o++],
  45389. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45390. C.vertexNormals.push(b);
  45391. if (v && (s = M[o++],
  45392. C.color.setHex(O[s])),
  45393. y)
  45394. for (i = 0; i < 3; i++)
  45395. s = M[o++],
  45396. C.vertexColors.push(new Ci.Color(O[s]));
  45397. N.faces.push(C)
  45398. }
  45399. }(t),
  45400. function() {
  45401. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45402. if (D.skinWeights)
  45403. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45404. var n = D.skinWeights[t]
  45405. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45406. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45407. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45408. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45409. }
  45410. if (D.skinIndices)
  45411. for (t = 0,
  45412. i = D.skinIndices.length; t < i; t += e) {
  45413. var s = D.skinIndices[t]
  45414. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45415. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45416. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45417. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45418. }
  45419. N.bones = D.bones,
  45420. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  45421. }(),
  45422. function(e) {
  45423. if (void 0 !== D.morphTargets)
  45424. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45425. N.morphTargets[t] = {},
  45426. N.morphTargets[t].name = D.morphTargets[t].name,
  45427. N.morphTargets[t].vertices = [];
  45428. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45429. var s = new Ci.Vector3;
  45430. s.x = r[o] * e,
  45431. s.y = r[o + 1] * e,
  45432. s.z = r[o + 2] * e,
  45433. n.push(s)
  45434. }
  45435. }
  45436. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45437. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45438. var l = N.faces
  45439. , c = D.morphColors[0].colors;
  45440. for (t = 0,
  45441. i = l.length; t < i; t++)
  45442. l[t].color.fromArray(c, 3 * t)
  45443. }
  45444. }(t),
  45445. function() {
  45446. var e = []
  45447. , t = [];
  45448. void 0 !== D.animation && t.push(D.animation),
  45449. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45450. for (var i = 0; i < t.length; i++) {
  45451. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45452. n && e.push(n)
  45453. }
  45454. if (N.morphTargets) {
  45455. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45456. e = e.concat(r)
  45457. }
  45458. 0 < e.length && (N.animations = e)
  45459. }(),
  45460. N.computeFaceNormals(),
  45461. N.computeBoundingSphere(),
  45462. void 0 === D.materials || 0 === D.materials.length)
  45463. return {
  45464. geometry: N
  45465. };
  45466. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45467. return {
  45468. geometry: N,
  45469. materials: i
  45470. }
  45471. }
  45472. },
  45473. Ci.LoadingManager = function(e, t, i) {
  45474. var n = this
  45475. , r = !1
  45476. , o = 0
  45477. , a = 0;
  45478. this.onStart = void 0,
  45479. this.onLoad = e,
  45480. this.onProgress = t,
  45481. this.onError = i,
  45482. this.itemStart = function(e) {
  45483. a++,
  45484. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45485. r = !0
  45486. }
  45487. ,
  45488. this.itemEnd = function(e) {
  45489. o++,
  45490. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45491. o === a && (r = !1,
  45492. void 0 !== n.onLoad && n.onLoad())
  45493. }
  45494. ,
  45495. this.itemError = function(e) {
  45496. void 0 !== n.onError && n.onError(e)
  45497. }
  45498. }
  45499. ,
  45500. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45501. Ci.BufferGeometryLoader = function(e) {
  45502. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45503. }
  45504. ,
  45505. Ci.BufferGeometryLoader.prototype = {
  45506. constructor: Ci.BufferGeometryLoader,
  45507. load: function(e, t, i, n) {
  45508. var r = this;
  45509. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45510. t(r.parse(JSON.parse(e)))
  45511. }, i, n)
  45512. },
  45513. parse: function(e) {
  45514. var t = new Ci.BufferGeometry
  45515. , i = e.data.index
  45516. , n = {
  45517. Int8Array: Int8Array,
  45518. Uint8Array: Uint8Array,
  45519. Uint8ClampedArray: Uint8ClampedArray,
  45520. Int16Array: Int16Array,
  45521. Uint16Array: Uint16Array,
  45522. Int32Array: Int32Array,
  45523. Uint32Array: Uint32Array,
  45524. Float32Array: Float32Array,
  45525. Float64Array: Float64Array
  45526. };
  45527. if (void 0 !== i) {
  45528. var r = new n[i.type](i.array);
  45529. t.setIndex(new Ci.BufferAttribute(r,1))
  45530. }
  45531. var o = e.data.attributes;
  45532. for (var a in o) {
  45533. var s = o[a];
  45534. r = new n[s.type](s.array);
  45535. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45536. }
  45537. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45538. if (void 0 !== l)
  45539. for (var c = 0, h = l.length; c !== h; ++c) {
  45540. var u = l[c];
  45541. t.addGroup(u.start, u.count, u.materialIndex)
  45542. }
  45543. var d = e.data.boundingSphere;
  45544. if (void 0 !== d) {
  45545. var p = new Ci.Vector3;
  45546. void 0 !== d.center && p.fromArray(d.center),
  45547. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45548. }
  45549. return t
  45550. }
  45551. },
  45552. Ci.MaterialLoader = function(e) {
  45553. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45554. this.textures = {}
  45555. }
  45556. ,
  45557. Ci.MaterialLoader.prototype = {
  45558. constructor: Ci.MaterialLoader,
  45559. load: function(e, t, i, n) {
  45560. var r = this;
  45561. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45562. t(r.parse(JSON.parse(e)))
  45563. }, i, n)
  45564. },
  45565. setTextures: function(e) {
  45566. this.textures = e
  45567. },
  45568. getTexture: function(e) {
  45569. var t = this.textures;
  45570. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45571. t[e]
  45572. },
  45573. parse: function(e) {
  45574. var t = new Ci[e.type];
  45575. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45576. void 0 !== e.name && (t.name = e.name),
  45577. void 0 !== e.color && t.color.setHex(e.color),
  45578. void 0 !== e.roughness && (t.roughness = e.roughness),
  45579. void 0 !== e.metalness && (t.metalness = e.metalness),
  45580. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45581. void 0 !== e.specular && t.specular.setHex(e.specular),
  45582. void 0 !== e.shininess && (t.shininess = e.shininess),
  45583. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45584. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45585. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45586. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45587. void 0 !== e.shading && (t.shading = e.shading),
  45588. void 0 !== e.blending && (t.blending = e.blending),
  45589. void 0 !== e.side && (t.side = e.side),
  45590. void 0 !== e.opacity && (t.opacity = e.opacity),
  45591. void 0 !== e.transparent && (t.transparent = e.transparent),
  45592. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45593. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45594. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45595. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45596. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45597. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45598. void 0 !== e.size && (t.size = e.size),
  45599. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45600. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45601. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45602. t.transparent = !0),
  45603. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45604. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45605. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45606. void 0 !== e.normalScale) {
  45607. var i = e.normalScale;
  45608. !1 === Array.isArray(i) && (i = [i, i]),
  45609. t.normalScale = (new Ci.Vector2).fromArray(i)
  45610. }
  45611. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45612. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45613. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45614. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45615. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45616. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45617. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45618. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45619. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45620. t.combine = Ci.MultiplyOperation),
  45621. e.reflectivity && (t.reflectivity = e.reflectivity),
  45622. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45623. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45624. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45625. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45626. void 0 !== e.materials)
  45627. for (var n = 0, r = e.materials.length; n < r; n++)
  45628. t.materials.push(this.parse(e.materials[n]));
  45629. return t
  45630. }
  45631. },
  45632. Ci.ObjectLoader = function(e) {
  45633. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45634. this.texturePath = ""
  45635. }
  45636. ,
  45637. Ci.ObjectLoader.prototype = {
  45638. constructor: Ci.ObjectLoader,
  45639. load: function(e, t, i, n) {
  45640. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45641. var r = this;
  45642. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45643. r.parse(JSON.parse(e), t)
  45644. }, i, n)
  45645. },
  45646. setTexturePath: function(e) {
  45647. this.texturePath = e
  45648. },
  45649. setCrossOrigin: function(e) {
  45650. this.crossOrigin = e
  45651. },
  45652. parse: function(e, t) {
  45653. var i = this.parseGeometries(e.geometries)
  45654. , n = this.parseImages(e.images, function() {
  45655. void 0 !== t && t(a)
  45656. })
  45657. , r = this.parseTextures(e.textures, n)
  45658. , o = this.parseMaterials(e.materials, r)
  45659. , a = this.parseObject(e.object, i, o);
  45660. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45661. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45662. a
  45663. },
  45664. parseGeometries: function(e) {
  45665. var t = {};
  45666. if (void 0 !== e)
  45667. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45668. var a, s = e[r];
  45669. switch (s.type) {
  45670. case "PlaneGeometry":
  45671. case "PlaneBufferGeometry":
  45672. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45673. break;
  45674. case "BoxGeometry":
  45675. case "BoxBufferGeometry":
  45676. case "CubeGeometry":
  45677. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45678. break;
  45679. case "CircleGeometry":
  45680. case "CircleBufferGeometry":
  45681. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45682. break;
  45683. case "CylinderGeometry":
  45684. case "CylinderBufferGeometry":
  45685. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45686. break;
  45687. case "SphereGeometry":
  45688. case "SphereBufferGeometry":
  45689. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45690. break;
  45691. case "DodecahedronGeometry":
  45692. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45693. break;
  45694. case "IcosahedronGeometry":
  45695. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45696. break;
  45697. case "OctahedronGeometry":
  45698. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45699. break;
  45700. case "TetrahedronGeometry":
  45701. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45702. break;
  45703. case "RingGeometry":
  45704. case "RingBufferGeometry":
  45705. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45706. break;
  45707. case "TorusGeometry":
  45708. case "TorusBufferGeometry":
  45709. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45710. break;
  45711. case "TorusKnotGeometry":
  45712. case "TorusKnotBufferGeometry":
  45713. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45714. break;
  45715. case "LatheGeometry":
  45716. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45717. break;
  45718. case "BufferGeometry":
  45719. a = n.parse(s);
  45720. break;
  45721. case "Geometry":
  45722. a = i.parse(s.data, this.texturePath).geometry;
  45723. break;
  45724. default:
  45725. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45726. continue
  45727. }
  45728. a.uuid = s.uuid,
  45729. void 0 !== s.name && (a.name = s.name),
  45730. t[s.uuid] = a
  45731. }
  45732. return t
  45733. },
  45734. parseMaterials: function(e, t) {
  45735. var i = {};
  45736. if (void 0 !== e) {
  45737. var n = new Ci.MaterialLoader;
  45738. n.setTextures(t);
  45739. for (var r = 0, o = e.length; r < o; r++) {
  45740. var a = n.parse(e[r]);
  45741. i[a.uuid] = a
  45742. }
  45743. }
  45744. return i
  45745. },
  45746. parseAnimations: function(e) {
  45747. for (var t = [], i = 0; i < e.length; i++) {
  45748. var n = Ci.AnimationClip.parse(e[i]);
  45749. t.push(n)
  45750. }
  45751. return t
  45752. },
  45753. parseImages: function(e, t) {
  45754. function i(e) {
  45755. return n.manager.itemStart(e),
  45756. a.load(e, function() {
  45757. n.manager.itemEnd(e)
  45758. })
  45759. }
  45760. var n = this
  45761. , r = {};
  45762. if (void 0 !== e && 0 < e.length) {
  45763. var o = new Ci.LoadingManager(t)
  45764. , a = new Ci.ImageLoader(o);
  45765. a.setCrossOrigin(this.crossOrigin);
  45766. for (var s = 0, l = e.length; s < l; s++) {
  45767. var c = e[s]
  45768. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45769. r[c.uuid] = i(h)
  45770. }
  45771. }
  45772. return r
  45773. },
  45774. parseTextures: function(e, t) {
  45775. function i(e) {
  45776. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45777. Ci[e])
  45778. }
  45779. var n = {};
  45780. if (void 0 !== e)
  45781. for (var r = 0, o = e.length; r < o; r++) {
  45782. var a = e[r];
  45783. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45784. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45785. var s = new Ci.Texture(t[a.image]);
  45786. s.needsUpdate = !0,
  45787. s.uuid = a.uuid,
  45788. void 0 !== a.name && (s.name = a.name),
  45789. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45790. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45791. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45792. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45793. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45794. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45795. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45796. s.wrapT = i(a.wrap[1])),
  45797. n[a.uuid] = s
  45798. }
  45799. return n
  45800. },
  45801. parseObject: (ke = new Ci.Matrix4,
  45802. function(e, t, i) {
  45803. function n(e) {
  45804. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45805. t[e]
  45806. }
  45807. function r(e) {
  45808. if (void 0 !== e)
  45809. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45810. i[e]
  45811. }
  45812. var o;
  45813. switch (e.type) {
  45814. case "Scene":
  45815. o = new Ci.Scene;
  45816. break;
  45817. case "PerspectiveCamera":
  45818. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45819. break;
  45820. case "OrthographicCamera":
  45821. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45822. break;
  45823. case "AmbientLight":
  45824. o = new Ci.AmbientLight(e.color,e.intensity);
  45825. break;
  45826. case "DirectionalLight":
  45827. o = new Ci.DirectionalLight(e.color,e.intensity);
  45828. break;
  45829. case "PointLight":
  45830. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45831. break;
  45832. case "SpotLight":
  45833. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45834. break;
  45835. case "HemisphereLight":
  45836. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45837. break;
  45838. case "Mesh":
  45839. var a = n(e.geometry)
  45840. , s = r(e.material);
  45841. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45842. break;
  45843. case "LOD":
  45844. o = new Ci.LOD;
  45845. break;
  45846. case "Line":
  45847. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45848. break;
  45849. case "PointCloud":
  45850. case "Points":
  45851. o = new Ci.Points(n(e.geometry),r(e.material));
  45852. break;
  45853. case "Sprite":
  45854. o = new Ci.Sprite(r(e.material));
  45855. break;
  45856. case "Group":
  45857. o = new Ci.Group;
  45858. break;
  45859. default:
  45860. o = new Ci.Object3D
  45861. }
  45862. if (o.uuid = e.uuid,
  45863. void 0 !== e.name && (o.name = e.name),
  45864. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45865. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45866. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45867. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45868. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45869. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45870. void 0 !== e.visible && (o.visible = e.visible),
  45871. void 0 !== e.userData && (o.userData = e.userData),
  45872. void 0 !== e.children)
  45873. for (var l in e.children)
  45874. o.add(this.parseObject(e.children[l], t, i));
  45875. if ("LOD" === e.type)
  45876. for (var c = e.levels, h = 0; h < c.length; h++) {
  45877. var u = c[h];
  45878. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45879. }
  45880. return o
  45881. }
  45882. )
  45883. },
  45884. Ci.TextureLoader = function(e) {
  45885. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45886. }
  45887. ,
  45888. Ci.TextureLoader.prototype = {
  45889. constructor: Ci.TextureLoader,
  45890. load: function(e, t, i, n) {
  45891. var r = new Ci.Texture
  45892. , o = new Ci.ImageLoader(this.manager);
  45893. return o.setCrossOrigin(this.crossOrigin),
  45894. o.setPath(this.path),
  45895. o.load(e, function(e) {
  45896. r.image = e,
  45897. r.needsUpdate = !0,
  45898. void 0 !== t && t(r)
  45899. }, i, n),
  45900. r
  45901. },
  45902. setCrossOrigin: function(e) {
  45903. this.crossOrigin = e
  45904. },
  45905. setPath: function(e) {
  45906. this.path = e
  45907. }
  45908. },
  45909. Ci.CubeTextureLoader = function(e) {
  45910. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45911. }
  45912. ,
  45913. Ci.CubeTextureLoader.prototype = {
  45914. constructor: Ci.CubeTextureLoader,
  45915. load: function(e, i, t, n) {
  45916. function r(t) {
  45917. a.load(e[t], function(e) {
  45918. o.images[t] = e,
  45919. 6 === ++s && (o.needsUpdate = !0,
  45920. i && i(o))
  45921. }, void 0, n)
  45922. }
  45923. var o = new Ci.CubeTexture
  45924. , a = new Ci.ImageLoader(this.manager);
  45925. a.setCrossOrigin(this.crossOrigin),
  45926. a.setPath(this.path);
  45927. for (var s = 0, l = 0; l < e.length; ++l)
  45928. r(l);
  45929. return o
  45930. },
  45931. setCrossOrigin: function(e) {
  45932. this.crossOrigin = e
  45933. },
  45934. setPath: function(e) {
  45935. this.path = e
  45936. }
  45937. },
  45938. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45939. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45940. this._parser = null
  45941. }
  45942. ,
  45943. Ci.BinaryTextureLoader.prototype = {
  45944. constructor: Ci.BinaryTextureLoader,
  45945. load: function(e, i, t, n) {
  45946. var r = this
  45947. , o = new Ci.DataTexture
  45948. , a = new Ci.XHRLoader(this.manager);
  45949. return a.setResponseType("arraybuffer"),
  45950. a.load(e, function(e) {
  45951. var t = r._parser(e);
  45952. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45953. o.image.height = t.height,
  45954. o.image.data = t.data),
  45955. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45956. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45957. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45958. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45959. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45960. void 0 !== t.format && (o.format = t.format),
  45961. void 0 !== t.type && (o.type = t.type),
  45962. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45963. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45964. o.needsUpdate = !0,
  45965. i && i(o, t))
  45966. }, t, n),
  45967. o
  45968. }
  45969. },
  45970. Ci.CompressedTextureLoader = function(e) {
  45971. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45972. this._parser = null
  45973. }
  45974. ,
  45975. Ci.CompressedTextureLoader.prototype = {
  45976. constructor: Ci.CompressedTextureLoader,
  45977. load: function(e, o, t, n) {
  45978. function i(i) {
  45979. r.load(e[i], function(e) {
  45980. var t = a._parser(e, !0);
  45981. s[i] = {
  45982. width: t.width,
  45983. height: t.height,
  45984. format: t.format,
  45985. mipmaps: t.mipmaps
  45986. },
  45987. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45988. l.format = t.format,
  45989. l.needsUpdate = !0,
  45990. o && o(l))
  45991. }, t, n)
  45992. }
  45993. var a = this
  45994. , s = []
  45995. , l = new Ci.CompressedTexture;
  45996. l.image = s;
  45997. var r = new Ci.XHRLoader(this.manager);
  45998. if (r.setPath(this.path),
  45999. r.setResponseType("arraybuffer"),
  46000. Array.isArray(e))
  46001. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46002. i(h);
  46003. else
  46004. r.load(e, function(e) {
  46005. var t = a._parser(e, !0);
  46006. if (t.isCubemap)
  46007. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46008. s[n] = {
  46009. mipmaps: []
  46010. };
  46011. for (var r = 0; r < t.mipmapCount; r++)
  46012. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46013. s[n].format = t.format,
  46014. s[n].width = t.width,
  46015. s[n].height = t.height
  46016. }
  46017. else
  46018. l.image.width = t.width,
  46019. l.image.height = t.height,
  46020. l.mipmaps = t.mipmaps;
  46021. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46022. l.format = t.format,
  46023. l.needsUpdate = !0,
  46024. o && o(l)
  46025. }, t, n);
  46026. return l
  46027. },
  46028. setPath: function(e) {
  46029. this.path = e
  46030. }
  46031. },
  46032. Ci.Material = function() {
  46033. Object.defineProperty(this, "id", {
  46034. value: Ci.MaterialIdCount++
  46035. }),
  46036. this.uuid = Ci.Math.generateUUID(),
  46037. this.name = "",
  46038. this.type = "Material",
  46039. this.side = Ci.FrontSide,
  46040. this.opacity = 1,
  46041. this.transparent = !1,
  46042. this.blending = Ci.NormalBlending,
  46043. this.blendSrc = Ci.SrcAlphaFactor,
  46044. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46045. this.blendEquation = Ci.AddEquation,
  46046. this.blendSrcAlpha = null,
  46047. this.blendDstAlpha = null,
  46048. this.blendEquationAlpha = null,
  46049. this.depthFunc = Ci.LessEqualDepth,
  46050. this.depthTest = !0,
  46051. this.depthWrite = !0,
  46052. this.colorWrite = !0,
  46053. this.precision = null,
  46054. this.polygonOffset = !1,
  46055. this.polygonOffsetFactor = 0,
  46056. this.polygonOffsetUnits = 0,
  46057. this.alphaTest = 0,
  46058. this.premultipliedAlpha = !1,
  46059. this.overdraw = 0,
  46060. this.visible = !0,
  46061. this._needsUpdate = !0
  46062. }
  46063. ,
  46064. Ci.Material.prototype = {
  46065. constructor: Ci.Material,
  46066. get needsUpdate() {
  46067. return this._needsUpdate
  46068. },
  46069. set needsUpdate(e) {
  46070. !0 === e && this.update(),
  46071. this._needsUpdate = e
  46072. },
  46073. setValues: function(e) {
  46074. if (void 0 !== e)
  46075. for (var t in e) {
  46076. var i = e[t];
  46077. if (void 0 !== i) {
  46078. var n = this[t];
  46079. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46080. } else
  46081. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46082. }
  46083. },
  46084. toJSON: function(e) {
  46085. function t(e) {
  46086. var t = [];
  46087. for (var i in e) {
  46088. var n = e[i];
  46089. delete n.metadata,
  46090. t.push(n)
  46091. }
  46092. return t
  46093. }
  46094. var i = void 0 === e;
  46095. i && (e = {
  46096. textures: {},
  46097. images: {}
  46098. });
  46099. var n = {
  46100. metadata: {
  46101. version: 4.4,
  46102. type: "Material",
  46103. generator: "Material.toJSON"
  46104. }
  46105. };
  46106. if (n.uuid = this.uuid,
  46107. n.type = this.type,
  46108. "" !== this.name && (n.name = this.name),
  46109. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46110. .5 !== this.roughness && (n.roughness = this.roughness),
  46111. .5 !== this.metalness && (n.metalness = this.metalness),
  46112. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46113. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46114. void 0 !== this.shininess && (n.shininess = this.shininess),
  46115. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46116. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46117. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46118. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46119. n.bumpScale = this.bumpScale),
  46120. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46121. n.normalScale = this.normalScale.toArray()),
  46122. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46123. n.displacementScale = this.displacementScale,
  46124. n.displacementBias = this.displacementBias),
  46125. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46126. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46127. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46128. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46129. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46130. n.reflectivity = this.reflectivity),
  46131. void 0 !== this.size && (n.size = this.size),
  46132. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46133. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46134. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46135. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46136. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46137. this.opacity < 1 && (n.opacity = this.opacity),
  46138. !0 === this.transparent && (n.transparent = this.transparent),
  46139. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46140. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46141. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46142. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46143. i) {
  46144. var r = t(e.textures)
  46145. , o = t(e.images);
  46146. 0 < r.length && (n.textures = r),
  46147. 0 < o.length && (n.images = o)
  46148. }
  46149. return n
  46150. },
  46151. clone: function() {
  46152. return (new this.constructor).copy(this)
  46153. },
  46154. copy: function(e) {
  46155. return this.name = e.name,
  46156. this.side = e.side,
  46157. this.opacity = e.opacity,
  46158. this.transparent = e.transparent,
  46159. this.blending = e.blending,
  46160. this.blendSrc = e.blendSrc,
  46161. this.blendDst = e.blendDst,
  46162. this.blendEquation = e.blendEquation,
  46163. this.blendSrcAlpha = e.blendSrcAlpha,
  46164. this.blendDstAlpha = e.blendDstAlpha,
  46165. this.blendEquationAlpha = e.blendEquationAlpha,
  46166. this.depthFunc = e.depthFunc,
  46167. this.depthTest = e.depthTest,
  46168. this.depthWrite = e.depthWrite,
  46169. this.colorWrite = e.colorWrite,
  46170. this.precision = e.precision,
  46171. this.polygonOffset = e.polygonOffset,
  46172. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46173. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46174. this.alphaTest = e.alphaTest,
  46175. this.premultipliedAlpha = e.premultipliedAlpha,
  46176. this.overdraw = e.overdraw,
  46177. this.visible = e.visible,
  46178. this
  46179. },
  46180. update: function() {
  46181. this.dispatchEvent({
  46182. type: "update"
  46183. })
  46184. },
  46185. dispose: function() {
  46186. this.dispatchEvent({
  46187. type: "dispose"
  46188. })
  46189. }
  46190. },
  46191. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46192. Ci.MaterialIdCount = 0,
  46193. Ci.LineBasicMaterial = function(e) {
  46194. Ci.Material.call(this),
  46195. this.type = "LineBasicMaterial",
  46196. this.color = new Ci.Color(16777215),
  46197. this.linewidth = 1,
  46198. this.linecap = "round",
  46199. this.linejoin = "round",
  46200. this.blending = Ci.NormalBlending,
  46201. this.vertexColors = Ci.NoColors,
  46202. this.fog = !0,
  46203. this.setValues(e)
  46204. }
  46205. ,
  46206. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46207. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46208. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46209. return Ci.Material.prototype.copy.call(this, e),
  46210. this.color.copy(e.color),
  46211. this.linewidth = e.linewidth,
  46212. this.linecap = e.linecap,
  46213. this.linejoin = e.linejoin,
  46214. this.vertexColors = e.vertexColors,
  46215. this.fog = e.fog,
  46216. this
  46217. }
  46218. ,
  46219. Ci.LineDashedMaterial = function(e) {
  46220. Ci.Material.call(this),
  46221. this.type = "LineDashedMaterial",
  46222. this.color = new Ci.Color(16777215),
  46223. this.linewidth = 1,
  46224. this.scale = 1,
  46225. this.dashSize = 3,
  46226. this.gapSize = 1,
  46227. this.blending = Ci.NormalBlending,
  46228. this.vertexColors = Ci.NoColors,
  46229. this.fog = !0,
  46230. this.setValues(e)
  46231. }
  46232. ,
  46233. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46234. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46235. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46236. return Ci.Material.prototype.copy.call(this, e),
  46237. this.color.copy(e.color),
  46238. this.linewidth = e.linewidth,
  46239. this.scale = e.scale,
  46240. this.dashSize = e.dashSize,
  46241. this.gapSize = e.gapSize,
  46242. this.vertexColors = e.vertexColors,
  46243. this.fog = e.fog,
  46244. this
  46245. }
  46246. ,
  46247. Ci.MeshBasicMaterial = function(e) {
  46248. Ci.Material.call(this),
  46249. this.type = "MeshBasicMaterial",
  46250. this.color = new Ci.Color(16777215),
  46251. this.map = null,
  46252. this.aoMap = null,
  46253. this.aoMapIntensity = 1,
  46254. this.specularMap = null,
  46255. this.alphaMap = null,
  46256. this.envMap = null,
  46257. this.combine = Ci.MultiplyOperation,
  46258. this.reflectivity = 1,
  46259. this.refractionRatio = .98,
  46260. this.fog = !0,
  46261. this.shading = Ci.SmoothShading,
  46262. this.blending = Ci.NormalBlending,
  46263. this.wireframe = !1,
  46264. this.wireframeLinewidth = 1,
  46265. this.wireframeLinecap = "round",
  46266. this.wireframeLinejoin = "round",
  46267. this.vertexColors = Ci.NoColors,
  46268. this.skinning = !1,
  46269. this.morphTargets = !1,
  46270. this.setValues(e)
  46271. }
  46272. ,
  46273. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46274. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46275. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46276. return Ci.Material.prototype.copy.call(this, e),
  46277. this.color.copy(e.color),
  46278. this.map = e.map,
  46279. this.aoMap = e.aoMap,
  46280. this.aoMapIntensity = e.aoMapIntensity,
  46281. this.specularMap = e.specularMap,
  46282. this.alphaMap = e.alphaMap,
  46283. this.envMap = e.envMap,
  46284. this.combine = e.combine,
  46285. this.reflectivity = e.reflectivity,
  46286. this.refractionRatio = e.refractionRatio,
  46287. this.fog = e.fog,
  46288. this.shading = e.shading,
  46289. this.wireframe = e.wireframe,
  46290. this.wireframeLinewidth = e.wireframeLinewidth,
  46291. this.wireframeLinecap = e.wireframeLinecap,
  46292. this.wireframeLinejoin = e.wireframeLinejoin,
  46293. this.vertexColors = e.vertexColors,
  46294. this.skinning = e.skinning,
  46295. this.morphTargets = e.morphTargets,
  46296. this
  46297. }
  46298. ,
  46299. Ci.MeshLambertMaterial = function(e) {
  46300. Ci.Material.call(this),
  46301. this.type = "MeshLambertMaterial",
  46302. this.color = new Ci.Color(16777215),
  46303. this.map = null,
  46304. this.lightMap = null,
  46305. this.lightMapIntensity = 1,
  46306. this.aoMap = null,
  46307. this.aoMapIntensity = 1,
  46308. this.emissive = new Ci.Color(0),
  46309. this.emissiveIntensity = 1,
  46310. this.emissiveMap = null,
  46311. this.specularMap = null,
  46312. this.alphaMap = null,
  46313. this.envMap = null,
  46314. this.combine = Ci.MultiplyOperation,
  46315. this.reflectivity = 1,
  46316. this.refractionRatio = .98,
  46317. this.fog = !0,
  46318. this.blending = Ci.NormalBlending,
  46319. this.wireframe = !1,
  46320. this.wireframeLinewidth = 1,
  46321. this.wireframeLinecap = "round",
  46322. this.wireframeLinejoin = "round",
  46323. this.vertexColors = Ci.NoColors,
  46324. this.skinning = !1,
  46325. this.morphTargets = !1,
  46326. this.morphNormals = !1,
  46327. this.setValues(e)
  46328. }
  46329. ,
  46330. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46331. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46332. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46333. return Ci.Material.prototype.copy.call(this, e),
  46334. this.color.copy(e.color),
  46335. this.map = e.map,
  46336. this.lightMap = e.lightMap,
  46337. this.lightMapIntensity = e.lightMapIntensity,
  46338. this.aoMap = e.aoMap,
  46339. this.aoMapIntensity = e.aoMapIntensity,
  46340. this.emissive.copy(e.emissive),
  46341. this.emissiveMap = e.emissiveMap,
  46342. this.emissiveIntensity = e.emissiveIntensity,
  46343. this.specularMap = e.specularMap,
  46344. this.alphaMap = e.alphaMap,
  46345. this.envMap = e.envMap,
  46346. this.combine = e.combine,
  46347. this.reflectivity = e.reflectivity,
  46348. this.refractionRatio = e.refractionRatio,
  46349. this.fog = e.fog,
  46350. this.wireframe = e.wireframe,
  46351. this.wireframeLinewidth = e.wireframeLinewidth,
  46352. this.wireframeLinecap = e.wireframeLinecap,
  46353. this.wireframeLinejoin = e.wireframeLinejoin,
  46354. this.vertexColors = e.vertexColors,
  46355. this.skinning = e.skinning,
  46356. this.morphTargets = e.morphTargets,
  46357. this.morphNormals = e.morphNormals,
  46358. this
  46359. }
  46360. ,
  46361. Ci.MeshPhongMaterial = function(e) {
  46362. Ci.Material.call(this),
  46363. this.type = "MeshPhongMaterial",
  46364. this.color = new Ci.Color(16777215),
  46365. this.specular = new Ci.Color(1118481),
  46366. this.shininess = 30,
  46367. this.map = null,
  46368. this.lightMap = null,
  46369. this.lightMapIntensity = 1,
  46370. this.aoMap = null,
  46371. this.aoMapIntensity = 1,
  46372. this.emissive = new Ci.Color(0),
  46373. this.emissiveIntensity = 1,
  46374. this.emissiveMap = null,
  46375. this.bumpMap = null,
  46376. this.bumpScale = 1,
  46377. this.normalMap = null,
  46378. this.normalScale = new Ci.Vector2(1,1),
  46379. this.displacementMap = null,
  46380. this.displacementScale = 1,
  46381. this.displacementBias = 0,
  46382. this.specularMap = null,
  46383. this.alphaMap = null,
  46384. this.envMap = null,
  46385. this.combine = Ci.MultiplyOperation,
  46386. this.reflectivity = 1,
  46387. this.refractionRatio = .98,
  46388. this.fog = !0,
  46389. this.shading = Ci.SmoothShading,
  46390. this.blending = Ci.NormalBlending,
  46391. this.wireframe = !1,
  46392. this.wireframeLinewidth = 1,
  46393. this.wireframeLinecap = "round",
  46394. this.wireframeLinejoin = "round",
  46395. this.vertexColors = Ci.NoColors,
  46396. this.skinning = !1,
  46397. this.morphTargets = !1,
  46398. this.morphNormals = !1,
  46399. this.setValues(e)
  46400. }
  46401. ,
  46402. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46403. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46404. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46405. return Ci.Material.prototype.copy.call(this, e),
  46406. this.color.copy(e.color),
  46407. this.specular.copy(e.specular),
  46408. this.shininess = e.shininess,
  46409. this.map = e.map,
  46410. this.lightMap = e.lightMap,
  46411. this.lightMapIntensity = e.lightMapIntensity,
  46412. this.aoMap = e.aoMap,
  46413. this.aoMapIntensity = e.aoMapIntensity,
  46414. this.emissive.copy(e.emissive),
  46415. this.emissiveMap = e.emissiveMap,
  46416. this.emissiveIntensity = e.emissiveIntensity,
  46417. this.bumpMap = e.bumpMap,
  46418. this.bumpScale = e.bumpScale,
  46419. this.normalMap = e.normalMap,
  46420. this.normalScale.copy(e.normalScale),
  46421. this.displacementMap = e.displacementMap,
  46422. this.displacementScale = e.displacementScale,
  46423. this.displacementBias = e.displacementBias,
  46424. this.specularMap = e.specularMap,
  46425. this.alphaMap = e.alphaMap,
  46426. this.envMap = e.envMap,
  46427. this.combine = e.combine,
  46428. this.reflectivity = e.reflectivity,
  46429. this.refractionRatio = e.refractionRatio,
  46430. this.fog = e.fog,
  46431. this.shading = e.shading,
  46432. this.wireframe = e.wireframe,
  46433. this.wireframeLinewidth = e.wireframeLinewidth,
  46434. this.wireframeLinecap = e.wireframeLinecap,
  46435. this.wireframeLinejoin = e.wireframeLinejoin,
  46436. this.vertexColors = e.vertexColors,
  46437. this.skinning = e.skinning,
  46438. this.morphTargets = e.morphTargets,
  46439. this.morphNormals = e.morphNormals,
  46440. this
  46441. }
  46442. ,
  46443. Ci.MeshStandardMaterial = function(e) {
  46444. Ci.Material.call(this),
  46445. this.type = "MeshStandardMaterial",
  46446. this.color = new Ci.Color(16777215),
  46447. this.roughness = .5,
  46448. this.metalness = .5,
  46449. this.map = null,
  46450. this.lightMap = null,
  46451. this.lightMapIntensity = 1,
  46452. this.aoMap = null,
  46453. this.aoMapIntensity = 1,
  46454. this.emissive = new Ci.Color(0),
  46455. this.emissiveIntensity = 1,
  46456. this.emissiveMap = null,
  46457. this.bumpMap = null,
  46458. this.bumpScale = 1,
  46459. this.normalMap = null,
  46460. this.normalScale = new Ci.Vector2(1,1),
  46461. this.displacementMap = null,
  46462. this.displacementScale = 1,
  46463. this.displacementBias = 0,
  46464. this.roughnessMap = null,
  46465. this.metalnessMap = null,
  46466. this.alphaMap = null,
  46467. this.envMap = null,
  46468. this.envMapIntensity = 1,
  46469. this.refractionRatio = .98,
  46470. this.fog = !0,
  46471. this.shading = Ci.SmoothShading,
  46472. this.blending = Ci.NormalBlending,
  46473. this.wireframe = !1,
  46474. this.wireframeLinewidth = 1,
  46475. this.wireframeLinecap = "round",
  46476. this.wireframeLinejoin = "round",
  46477. this.vertexColors = Ci.NoColors,
  46478. this.skinning = !1,
  46479. this.morphTargets = !1,
  46480. this.morphNormals = !1,
  46481. this.setValues(e)
  46482. }
  46483. ,
  46484. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46485. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46486. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46487. return Ci.Material.prototype.copy.call(this, e),
  46488. this.color.copy(e.color),
  46489. this.roughness = e.roughness,
  46490. this.metalness = e.metalness,
  46491. this.map = e.map,
  46492. this.lightMap = e.lightMap,
  46493. this.lightMapIntensity = e.lightMapIntensity,
  46494. this.aoMap = e.aoMap,
  46495. this.aoMapIntensity = e.aoMapIntensity,
  46496. this.emissive.copy(e.emissive),
  46497. this.emissiveMap = e.emissiveMap,
  46498. this.emissiveIntensity = e.emissiveIntensity,
  46499. this.bumpMap = e.bumpMap,
  46500. this.bumpScale = e.bumpScale,
  46501. this.normalMap = e.normalMap,
  46502. this.normalScale.copy(e.normalScale),
  46503. this.displacementMap = e.displacementMap,
  46504. this.displacementScale = e.displacementScale,
  46505. this.displacementBias = e.displacementBias,
  46506. this.roughnessMap = e.roughnessMap,
  46507. this.metalnessMap = e.metalnessMap,
  46508. this.alphaMap = e.alphaMap,
  46509. this.envMap = e.envMap,
  46510. this.envMapIntensity = e.envMapIntensity,
  46511. this.refractionRatio = e.refractionRatio,
  46512. this.fog = e.fog,
  46513. this.shading = e.shading,
  46514. this.wireframe = e.wireframe,
  46515. this.wireframeLinewidth = e.wireframeLinewidth,
  46516. this.wireframeLinecap = e.wireframeLinecap,
  46517. this.wireframeLinejoin = e.wireframeLinejoin,
  46518. this.vertexColors = e.vertexColors,
  46519. this.skinning = e.skinning,
  46520. this.morphTargets = e.morphTargets,
  46521. this.morphNormals = e.morphNormals,
  46522. this
  46523. }
  46524. ,
  46525. Ci.MeshDepthMaterial = function(e) {
  46526. Ci.Material.call(this),
  46527. this.type = "MeshDepthMaterial",
  46528. this.morphTargets = !1,
  46529. this.wireframe = !1,
  46530. this.wireframeLinewidth = 1,
  46531. this.setValues(e)
  46532. }
  46533. ,
  46534. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46535. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46536. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46537. return Ci.Material.prototype.copy.call(this, e),
  46538. this.wireframe = e.wireframe,
  46539. this.wireframeLinewidth = e.wireframeLinewidth,
  46540. this
  46541. }
  46542. ,
  46543. Ci.MeshNormalMaterial = function(e) {
  46544. Ci.Material.call(this, e),
  46545. this.type = "MeshNormalMaterial",
  46546. this.wireframe = !1,
  46547. this.wireframeLinewidth = 1,
  46548. this.morphTargets = !1,
  46549. this.setValues(e)
  46550. }
  46551. ,
  46552. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46553. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46554. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46555. return Ci.Material.prototype.copy.call(this, e),
  46556. this.wireframe = e.wireframe,
  46557. this.wireframeLinewidth = e.wireframeLinewidth,
  46558. this
  46559. }
  46560. ,
  46561. Ci.MultiMaterial = function(e) {
  46562. this.uuid = Ci.Math.generateUUID(),
  46563. this.type = "MultiMaterial",
  46564. this.materials = e instanceof Array ? e : [],
  46565. this.visible = !0
  46566. }
  46567. ,
  46568. Ci.MultiMaterial.prototype = {
  46569. constructor: Ci.MultiMaterial,
  46570. toJSON: function(e) {
  46571. for (var t = {
  46572. metadata: {
  46573. version: 4.2,
  46574. type: "material",
  46575. generator: "MaterialExporter"
  46576. },
  46577. uuid: this.uuid,
  46578. type: this.type,
  46579. materials: []
  46580. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46581. var o = i[n].toJSON(e);
  46582. delete o.metadata,
  46583. t.materials.push(o)
  46584. }
  46585. return t.visible = this.visible,
  46586. t
  46587. },
  46588. clone: function() {
  46589. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46590. e.materials.push(this.materials[t].clone());
  46591. return e.visible = this.visible,
  46592. e
  46593. }
  46594. },
  46595. Ci.PointsMaterial = function(e) {
  46596. Ci.Material.call(this),
  46597. this.type = "PointsMaterial",
  46598. this.color = new Ci.Color(16777215),
  46599. this.map = null,
  46600. this.size = 1,
  46601. this.sizeAttenuation = !0,
  46602. this.blending = Ci.NormalBlending,
  46603. this.vertexColors = Ci.NoColors,
  46604. this.fog = !0,
  46605. this.setValues(e)
  46606. }
  46607. ,
  46608. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46609. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46610. Ci.PointsMaterial.prototype.copy = function(e) {
  46611. return Ci.Material.prototype.copy.call(this, e),
  46612. this.color.copy(e.color),
  46613. this.map = e.map,
  46614. this.size = e.size,
  46615. this.sizeAttenuation = e.sizeAttenuation,
  46616. this.vertexColors = e.vertexColors,
  46617. this.fog = e.fog,
  46618. this
  46619. }
  46620. ,
  46621. Ci.ShaderMaterial = function(e) {
  46622. Ci.Material.call(this),
  46623. this.type = "ShaderMaterial",
  46624. this.defines = {},
  46625. this.uniforms = {},
  46626. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46627. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46628. this.shading = Ci.SmoothShading,
  46629. this.linewidth = 1,
  46630. this.wireframe = !1,
  46631. this.wireframeLinewidth = 1,
  46632. this.fog = !1,
  46633. this.lights = !1,
  46634. this.vertexColors = Ci.NoColors,
  46635. this.skinning = !1,
  46636. this.morphTargets = !1,
  46637. this.morphNormals = !1,
  46638. this.extensions = {
  46639. derivatives: !1,
  46640. fragDepth: !1,
  46641. drawBuffers: !1,
  46642. shaderTextureLOD: !1
  46643. },
  46644. this.defaultAttributeValues = {
  46645. color: [1, 1, 1],
  46646. uv: [0, 0],
  46647. uv2: [0, 0]
  46648. },
  46649. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46650. this.setValues(e))
  46651. }
  46652. ,
  46653. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46654. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46655. Ci.ShaderMaterial.prototype.copy = function(e) {
  46656. return Ci.Material.prototype.copy.call(this, e),
  46657. this.fragmentShader = e.fragmentShader,
  46658. this.vertexShader = e.vertexShader,
  46659. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46660. this.defines = e.defines,
  46661. this.shading = e.shading,
  46662. this.wireframe = e.wireframe,
  46663. this.wireframeLinewidth = e.wireframeLinewidth,
  46664. this.fog = e.fog,
  46665. this.lights = e.lights,
  46666. this.vertexColors = e.vertexColors,
  46667. this.skinning = e.skinning,
  46668. this.morphTargets = e.morphTargets,
  46669. this.morphNormals = e.morphNormals,
  46670. this.extensions = e.extensions,
  46671. this
  46672. }
  46673. ,
  46674. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46675. var t = Ci.Material.prototype.toJSON.call(this, e);
  46676. return t.uniforms = this.uniforms,
  46677. t.vertexShader = this.vertexShader,
  46678. t.fragmentShader = this.fragmentShader,
  46679. t
  46680. }
  46681. ,
  46682. Ci.RawShaderMaterial = function(e) {
  46683. Ci.ShaderMaterial.call(this, e),
  46684. this.type = "RawShaderMaterial"
  46685. }
  46686. ,
  46687. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46688. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46689. Ci.SpriteMaterial = function(e) {
  46690. Ci.Material.call(this),
  46691. this.type = "SpriteMaterial",
  46692. this.color = new Ci.Color(16777215),
  46693. this.map = null,
  46694. this.rotation = 0,
  46695. this.fog = !1,
  46696. this.setValues(e)
  46697. }
  46698. ,
  46699. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46700. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46701. Ci.SpriteMaterial.prototype.copy = function(e) {
  46702. return Ci.Material.prototype.copy.call(this, e),
  46703. this.color.copy(e.color),
  46704. this.map = e.map,
  46705. this.rotation = e.rotation,
  46706. this.fog = e.fog,
  46707. this
  46708. }
  46709. ,
  46710. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46711. Object.defineProperty(this, "id", {
  46712. value: Ci.TextureIdCount++
  46713. }),
  46714. this.uuid = Ci.Math.generateUUID(),
  46715. this.name = "",
  46716. this.sourceFile = "",
  46717. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46718. this.mipmaps = [],
  46719. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46720. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46721. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46722. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46723. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46724. this.anisotropy = void 0 !== l ? l : 1,
  46725. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46726. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46727. this.offset = new Ci.Vector2(0,0),
  46728. this.repeat = new Ci.Vector2(1,1),
  46729. this.generateMipmaps = !0,
  46730. this.premultiplyAlpha = !1,
  46731. this.flipY = !0,
  46732. this.unpackAlignment = 4,
  46733. this.encoding = Ci.LinearEncoding,
  46734. this.version = 0,
  46735. this.onUpdate = null
  46736. }
  46737. ,
  46738. Ci.Texture.DEFAULT_IMAGE = void 0,
  46739. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46740. Ci.Texture.prototype = {
  46741. constructor: Ci.Texture,
  46742. set needsUpdate(e) {
  46743. !0 === e && this.version++
  46744. },
  46745. clone: function() {
  46746. return (new this.constructor).copy(this)
  46747. },
  46748. copy: function(e) {
  46749. return this.image = e.image,
  46750. this.mipmaps = e.mipmaps.slice(0),
  46751. this.mapping = e.mapping,
  46752. this.wrapS = e.wrapS,
  46753. this.wrapT = e.wrapT,
  46754. this.magFilter = e.magFilter,
  46755. this.minFilter = e.minFilter,
  46756. this.anisotropy = e.anisotropy,
  46757. this.format = e.format,
  46758. this.type = e.type,
  46759. this.offset.copy(e.offset),
  46760. this.repeat.copy(e.repeat),
  46761. this.generateMipmaps = e.generateMipmaps,
  46762. this.premultiplyAlpha = e.premultiplyAlpha,
  46763. this.flipY = e.flipY,
  46764. this.unpackAlignment = e.unpackAlignment,
  46765. this.encoding = e.encoding,
  46766. this
  46767. },
  46768. toJSON: function(e) {
  46769. if (void 0 !== e.textures[this.uuid])
  46770. return e.textures[this.uuid];
  46771. var t, i, n = {
  46772. metadata: {
  46773. version: 4.4,
  46774. type: "Texture",
  46775. generator: "Texture.toJSON"
  46776. },
  46777. uuid: this.uuid,
  46778. name: this.name,
  46779. mapping: this.mapping,
  46780. repeat: [this.repeat.x, this.repeat.y],
  46781. offset: [this.offset.x, this.offset.y],
  46782. wrap: [this.wrapS, this.wrapT],
  46783. minFilter: this.minFilter,
  46784. magFilter: this.magFilter,
  46785. anisotropy: this.anisotropy
  46786. };
  46787. if (void 0 !== this.image) {
  46788. var r = this.image;
  46789. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46790. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46791. uuid: r.uuid,
  46792. url: (t = r,
  46793. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46794. i.height = t.height,
  46795. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46796. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46797. }),
  46798. n.image = r.uuid
  46799. }
  46800. return e.textures[this.uuid] = n
  46801. },
  46802. dispose: function() {
  46803. this.dispatchEvent({
  46804. type: "dispose"
  46805. })
  46806. },
  46807. transformUv: function(e) {
  46808. if (this.mapping === Ci.UVMapping) {
  46809. if (e.multiply(this.repeat),
  46810. e.add(this.offset),
  46811. e.x < 0 || 1 < e.x)
  46812. switch (this.wrapS) {
  46813. case Ci.RepeatWrapping:
  46814. e.x = e.x - Math.floor(e.x);
  46815. break;
  46816. case Ci.ClampToEdgeWrapping:
  46817. e.x = e.x < 0 ? 0 : 1;
  46818. break;
  46819. case Ci.MirroredRepeatWrapping:
  46820. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46821. }
  46822. if (e.y < 0 || 1 < e.y)
  46823. switch (this.wrapT) {
  46824. case Ci.RepeatWrapping:
  46825. e.y = e.y - Math.floor(e.y);
  46826. break;
  46827. case Ci.ClampToEdgeWrapping:
  46828. e.y = e.y < 0 ? 0 : 1;
  46829. break;
  46830. case Ci.MirroredRepeatWrapping:
  46831. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46832. }
  46833. this.flipY && (e.y = 1 - e.y)
  46834. }
  46835. }
  46836. },
  46837. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46838. Ci.TextureIdCount = 0,
  46839. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46840. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46841. this.needsUpdate = !0
  46842. }
  46843. ,
  46844. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46845. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46846. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46847. e = void 0 !== e ? e : [],
  46848. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46849. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46850. this.flipY = !1
  46851. }
  46852. ,
  46853. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46854. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46855. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46856. get: function() {
  46857. return this.image
  46858. },
  46859. set: function(e) {
  46860. this.image = e
  46861. }
  46862. }),
  46863. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46864. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46865. this.image = {
  46866. width: t,
  46867. height: i
  46868. },
  46869. this.mipmaps = e,
  46870. this.flipY = !1,
  46871. this.generateMipmaps = !1
  46872. }
  46873. ,
  46874. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46875. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46876. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46877. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46878. this.image = {
  46879. data: e,
  46880. width: t,
  46881. height: i
  46882. },
  46883. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46884. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46885. this.flipY = !1,
  46886. this.generateMipmaps = !1
  46887. }
  46888. ,
  46889. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46890. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46891. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46892. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46893. this.generateMipmaps = !1;
  46894. var c = this;
  46895. !function e() {
  46896. requestAnimationFrame(e),
  46897. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46898. }()
  46899. }
  46900. ,
  46901. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46902. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46903. Ci.Group = function() {
  46904. Ci.Object3D.call(this),
  46905. this.type = "Group"
  46906. }
  46907. ,
  46908. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46909. Ci.Group.prototype.constructor = Ci.Group,
  46910. Ci.Points = function(e, t) {
  46911. Ci.Object3D.call(this),
  46912. this.type = "Points",
  46913. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46914. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46915. color: 16777215 * Math.random()
  46916. })
  46917. }
  46918. ,
  46919. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46920. Ci.Points.prototype.constructor = Ci.Points,
  46921. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46922. jt = new Ci.Ray,
  46923. Yt = new Ci.Sphere,
  46924. function(o, a) {
  46925. function e(e, t) {
  46926. var i = jt.distanceSqToPoint(e);
  46927. if (i < c) {
  46928. var n = jt.closestPointToPoint(e);
  46929. n.applyMatrix4(l);
  46930. var r = o.ray.origin.distanceTo(n);
  46931. if (r < o.near || r > o.far)
  46932. return;
  46933. a.push({
  46934. distance: r,
  46935. distanceToRay: Math.sqrt(i),
  46936. point: n.clone(),
  46937. index: t,
  46938. face: null,
  46939. object: s
  46940. })
  46941. }
  46942. }
  46943. var s = this
  46944. , t = this.geometry
  46945. , l = this.matrixWorld
  46946. , i = o.params.Points.threshold;
  46947. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46948. Yt.copy(t.boundingSphere),
  46949. Yt.applyMatrix4(l),
  46950. !1 !== o.ray.intersectsSphere(Yt)) {
  46951. Wt.getInverse(l),
  46952. jt.copy(o.ray).applyMatrix4(Wt);
  46953. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46954. , c = n * n
  46955. , r = new Ci.Vector3;
  46956. if (t instanceof Ci.BufferGeometry) {
  46957. var h = t.index
  46958. , u = t.attributes.position.array;
  46959. if (null !== h)
  46960. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46961. var g = d[p];
  46962. r.fromArray(u, 3 * g),
  46963. e(r, g)
  46964. }
  46965. else {
  46966. p = 0;
  46967. for (var m = u.length / 3; p < m; p++)
  46968. r.fromArray(u, 3 * p),
  46969. e(r, p)
  46970. }
  46971. } else {
  46972. var v = t.vertices;
  46973. for (p = 0,
  46974. m = v.length; p < m; p++)
  46975. e(v[p], p)
  46976. }
  46977. }
  46978. }
  46979. ),
  46980. Ci.Points.prototype.clone = function() {
  46981. return new this.constructor(this.geometry,this.material).copy(this)
  46982. }
  46983. ,
  46984. Ci.Line = function(e, t, i) {
  46985. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46986. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46987. this.type = "Line",
  46988. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46989. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46990. color: 16777215 * Math.random()
  46991. })))
  46992. }
  46993. ,
  46994. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46995. Ci.Line.prototype.constructor = Ci.Line,
  46996. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46997. zt = new Ci.Ray,
  46998. Gt = new Ci.Sphere,
  46999. function(e, t) {
  47000. var i = e.linePrecision
  47001. , n = i * i
  47002. , r = this.geometry
  47003. , o = this.matrixWorld;
  47004. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47005. Gt.copy(r.boundingSphere),
  47006. Gt.applyMatrix4(o),
  47007. !1 !== e.ray.intersectsSphere(Gt)) {
  47008. Ht.getInverse(o),
  47009. zt.copy(e.ray).applyMatrix4(Ht);
  47010. var a = new Ci.Vector3
  47011. , s = new Ci.Vector3
  47012. , l = new Ci.Vector3
  47013. , c = new Ci.Vector3
  47014. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47015. if (r instanceof Ci.BufferGeometry) {
  47016. var u = r.index
  47017. , d = r.attributes.position.array;
  47018. if (null !== u)
  47019. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47020. var m = p[f]
  47021. , v = p[f + 1];
  47022. a.fromArray(d, 3 * m),
  47023. s.fromArray(d, 3 * v),
  47024. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47025. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47026. distance: C,
  47027. point: l.clone().applyMatrix4(this.matrixWorld),
  47028. index: f,
  47029. face: null,
  47030. faceIndex: null,
  47031. object: this
  47032. }))
  47033. }
  47034. else
  47035. for (f = 0,
  47036. g = d.length / 3 - 1; f < g; f += h)
  47037. a.fromArray(d, 3 * f),
  47038. s.fromArray(d, 3 * f + 3),
  47039. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47040. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47041. distance: C,
  47042. point: l.clone().applyMatrix4(this.matrixWorld),
  47043. index: f,
  47044. face: null,
  47045. faceIndex: null,
  47046. object: this
  47047. }))
  47048. } else if (r instanceof Ci.Geometry) {
  47049. var y = r.vertices
  47050. , A = y.length;
  47051. for (f = 0; f < A - 1; f += h) {
  47052. var C;
  47053. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47054. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47055. distance: C,
  47056. point: l.clone().applyMatrix4(this.matrixWorld),
  47057. index: f,
  47058. face: null,
  47059. faceIndex: null,
  47060. object: this
  47061. }))
  47062. }
  47063. }
  47064. }
  47065. }
  47066. ),
  47067. Ci.Line.prototype.clone = function() {
  47068. return new this.constructor(this.geometry,this.material).copy(this)
  47069. }
  47070. ,
  47071. Ci.LineStrip = 0,
  47072. Ci.LinePieces = 1,
  47073. Ci.LineSegments = function(e, t) {
  47074. Ci.Line.call(this, e, t),
  47075. this.type = "LineSegments"
  47076. }
  47077. ,
  47078. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47079. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47080. Ci.Mesh = function(e, t) {
  47081. Ci.Object3D.call(this),
  47082. this.type = "Mesh",
  47083. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47084. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47085. color: 16777215 * Math.random()
  47086. }),
  47087. this.drawMode = Ci.TrianglesDrawMode,
  47088. this.updateMorphTargets()
  47089. }
  47090. ,
  47091. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47092. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47093. Ci.Mesh.prototype.setDrawMode = function(e) {
  47094. this.drawMode = e
  47095. }
  47096. ,
  47097. Ci.Mesh.prototype.updateMorphTargets = function() {
  47098. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47099. this.morphTargetBase = -1,
  47100. this.morphTargetInfluences = [],
  47101. this.morphTargetDictionary = {};
  47102. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47103. this.morphTargetInfluences.push(0),
  47104. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47105. }
  47106. }
  47107. ,
  47108. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47109. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47110. 0)
  47111. }
  47112. ,
  47113. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47114. xt = new Ci.Ray,
  47115. St = new Ci.Sphere,
  47116. Mt = new Ci.Vector3,
  47117. Rt = new Ci.Vector3,
  47118. Pt = new Ci.Vector3,
  47119. Ot = new Ci.Vector3,
  47120. Lt = new Ci.Vector3,
  47121. Dt = new Ci.Vector3,
  47122. Nt = new Ci.Vector2,
  47123. Ft = new Ci.Vector2,
  47124. Bt = new Ci.Vector2,
  47125. Vt = new Ci.Vector3,
  47126. kt = new Ci.Vector3,
  47127. Ut = new Ci.Vector3,
  47128. function(e, t) {
  47129. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47130. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47131. St.copy(r.boundingSphere),
  47132. St.applyMatrix4(a),
  47133. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47134. xt.copy(e.ray).applyMatrix4(Tt),
  47135. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47136. if (r instanceof Ci.BufferGeometry) {
  47137. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47138. if (void 0 !== u.uv && (i = u.uv.array),
  47139. null !== h)
  47140. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47141. s = p[f],
  47142. l = p[f + 1],
  47143. c = p[f + 2],
  47144. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47145. t.push(n));
  47146. else
  47147. for (f = 0,
  47148. g = d.length; f < g; f += 9)
  47149. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47150. t.push(n))
  47151. } else if (r instanceof Ci.Geometry) {
  47152. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47153. 0 < _.length && (i = _);
  47154. for (var b = 0, w = E.length; b < w; b++) {
  47155. var T = E[b]
  47156. , x = 1 == A ? C[T.materialIndex] : o;
  47157. if (void 0 !== x) {
  47158. if (m = I[T.a],
  47159. v = I[T.b],
  47160. y = I[T.c],
  47161. !0 === x.morphTargets) {
  47162. var S = r.morphTargets
  47163. , M = this.morphTargetInfluences;
  47164. Mt.set(0, 0, 0),
  47165. Rt.set(0, 0, 0),
  47166. Pt.set(0, 0, 0);
  47167. for (var R = 0, P = S.length; R < P; R++) {
  47168. var O = M[R];
  47169. if (0 !== O) {
  47170. var L = S[R].vertices;
  47171. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47172. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47173. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47174. }
  47175. }
  47176. Mt.add(m),
  47177. Rt.add(v),
  47178. Pt.add(y),
  47179. m = Mt,
  47180. v = Rt,
  47181. y = Pt
  47182. }
  47183. if (n = wi(this, e, xt, m, v, y, kt)) {
  47184. if (i) {
  47185. var D = i[b];
  47186. Nt.copy(D[0]),
  47187. Ft.copy(D[1]),
  47188. Bt.copy(D[2]),
  47189. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47190. }
  47191. n.face = T,
  47192. n.faceIndex = b,
  47193. t.push(n)
  47194. }
  47195. }
  47196. }
  47197. }
  47198. }
  47199. ),
  47200. Ci.Mesh.prototype.clone = function() {
  47201. return new this.constructor(this.geometry,this.material).copy(this)
  47202. }
  47203. ,
  47204. Ci.Bone = function(e) {
  47205. Ci.Object3D.call(this),
  47206. this.type = "Bone",
  47207. this.skin = e
  47208. }
  47209. ,
  47210. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47211. Ci.Bone.prototype.constructor = Ci.Bone,
  47212. Ci.Bone.prototype.copy = function(e) {
  47213. return Ci.Object3D.prototype.copy.call(this, e),
  47214. this.skin = e.skin,
  47215. this
  47216. }
  47217. ,
  47218. Ci.Skeleton = function(e, t, i) {
  47219. if (this.useVertexTexture = void 0 === i || i,
  47220. this.identityMatrix = new Ci.Matrix4,
  47221. e = e || [],
  47222. this.bones = e.slice(0),
  47223. this.useVertexTexture) {
  47224. var n = Math.sqrt(4 * this.bones.length);
  47225. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47226. n = Math.max(n, 4),
  47227. this.boneTextureWidth = n,
  47228. this.boneTextureHeight = n,
  47229. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47230. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47231. } else
  47232. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47233. if (void 0 === t)
  47234. this.calculateInverses();
  47235. else if (this.bones.length === t.length)
  47236. this.boneInverses = t.slice(0);
  47237. else {
  47238. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47239. this.boneInverses = [];
  47240. for (var r = 0, o = this.bones.length; r < o; r++)
  47241. this.boneInverses.push(new Ci.Matrix4)
  47242. }
  47243. }
  47244. ,
  47245. Ci.Skeleton.prototype.calculateInverses = function() {
  47246. this.boneInverses = [];
  47247. for (var e = 0, t = this.bones.length; e < t; e++) {
  47248. var i = new Ci.Matrix4;
  47249. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47250. this.boneInverses.push(i)
  47251. }
  47252. }
  47253. ,
  47254. Ci.Skeleton.prototype.pose = function() {
  47255. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47256. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47257. for (t = 0,
  47258. i = this.bones.length; t < i; t++)
  47259. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47260. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47261. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47262. }
  47263. ,
  47264. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47265. function() {
  47266. for (var e = 0, t = this.bones.length; e < t; e++) {
  47267. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47268. wt.multiplyMatrices(i, this.boneInverses[e]),
  47269. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47270. }
  47271. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47272. }
  47273. ),
  47274. Ci.Skeleton.prototype.clone = function() {
  47275. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47276. }
  47277. ,
  47278. Ci.SkinnedMesh = function(e, t, i) {
  47279. Ci.Mesh.call(this, e, t),
  47280. this.type = "SkinnedMesh",
  47281. this.bindMode = "attached",
  47282. this.bindMatrix = new Ci.Matrix4,
  47283. this.bindMatrixInverse = new Ci.Matrix4;
  47284. var n = [];
  47285. if (this.geometry && void 0 !== this.geometry.bones) {
  47286. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47287. o = this.geometry.bones[a],
  47288. r = new Ci.Bone(this),
  47289. n.push(r),
  47290. r.name = o.name,
  47291. r.position.fromArray(o.pos),
  47292. r.quaternion.fromArray(o.rotq),
  47293. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47294. for (a = 0,
  47295. s = this.geometry.bones.length; a < s; ++a)
  47296. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47297. }
  47298. this.normalizeSkinWeights(),
  47299. this.updateMatrixWorld(!0),
  47300. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47301. }
  47302. ,
  47303. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47304. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47305. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47306. this.skeleton = e,
  47307. void 0 === t && (this.updateMatrixWorld(!0),
  47308. this.skeleton.calculateInverses(),
  47309. t = this.matrixWorld),
  47310. this.bindMatrix.copy(t),
  47311. this.bindMatrixInverse.getInverse(t)
  47312. }
  47313. ,
  47314. Ci.SkinnedMesh.prototype.pose = function() {
  47315. this.skeleton.pose()
  47316. }
  47317. ,
  47318. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47319. if (this.geometry instanceof Ci.Geometry)
  47320. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47321. var t = this.geometry.skinWeights[e];
  47322. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47323. }
  47324. else if (this.geometry instanceof Ci.BufferGeometry) {
  47325. var i = new Ci.Vector4
  47326. , n = this.geometry.attributes.skinWeight;
  47327. for (e = 0; e < n.count; e++) {
  47328. var r;
  47329. i.x = n.getX(e),
  47330. i.y = n.getY(e),
  47331. i.z = n.getZ(e),
  47332. i.w = n.getW(e),
  47333. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47334. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47335. }
  47336. }
  47337. }
  47338. ,
  47339. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47340. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47341. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47342. }
  47343. ,
  47344. Ci.SkinnedMesh.prototype.clone = function() {
  47345. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47346. }
  47347. ,
  47348. Ci.LOD = function() {
  47349. Ci.Object3D.call(this),
  47350. this.type = "LOD",
  47351. Object.defineProperties(this, {
  47352. levels: {
  47353. enumerable: !0,
  47354. value: []
  47355. },
  47356. objects: {
  47357. get: function() {
  47358. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47359. this.levels
  47360. }
  47361. }
  47362. })
  47363. }
  47364. ,
  47365. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47366. Ci.LOD.prototype.constructor = Ci.LOD,
  47367. Ci.LOD.prototype.addLevel = function(e, t) {
  47368. void 0 === t && (t = 0),
  47369. t = Math.abs(t);
  47370. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47371. ;
  47372. i.splice(n, 0, {
  47373. distance: t,
  47374. object: e
  47375. }),
  47376. this.add(e)
  47377. }
  47378. ,
  47379. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47380. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47381. ;
  47382. return t[i - 1].object
  47383. }
  47384. ,
  47385. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47386. function(e, t) {
  47387. bt.setFromMatrixPosition(this.matrixWorld);
  47388. var i = e.ray.origin.distanceTo(bt);
  47389. this.getObjectForDistance(i).raycast(e, t)
  47390. }
  47391. ),
  47392. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47393. _t = new Ci.Vector3,
  47394. function(e) {
  47395. var t = this.levels;
  47396. if (1 < t.length) {
  47397. Et.setFromMatrixPosition(e.matrixWorld),
  47398. _t.setFromMatrixPosition(this.matrixWorld);
  47399. var i = Et.distanceTo(_t);
  47400. t[0].object.visible = !0;
  47401. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47402. t[n - 1].object.visible = !1,
  47403. t[n].object.visible = !0;
  47404. for (; n < r; n++)
  47405. t[n].object.visible = !1
  47406. }
  47407. }
  47408. ),
  47409. Ci.LOD.prototype.copy = function(e) {
  47410. Ci.Object3D.prototype.copy.call(this, e, !1);
  47411. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47412. var r = t[i];
  47413. this.addLevel(r.object.clone(), r.distance)
  47414. }
  47415. return this
  47416. }
  47417. ,
  47418. Ci.LOD.prototype.toJSON = function(e) {
  47419. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47420. t.object.levels = [];
  47421. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47422. var o = i[n];
  47423. t.object.levels.push({
  47424. object: o.object.uuid,
  47425. distance: o.distance
  47426. })
  47427. }
  47428. return t
  47429. }
  47430. ,
  47431. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47432. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47433. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47434. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47435. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47436. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47437. function(e) {
  47438. Ci.Object3D.call(this),
  47439. this.type = "Sprite",
  47440. this.geometry = It,
  47441. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47442. }
  47443. ),
  47444. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47445. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47446. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47447. function(e, t) {
  47448. vt.setFromMatrixPosition(this.matrixWorld);
  47449. var i = e.ray.distanceSqToPoint(vt);
  47450. this.scale.x * this.scale.y < i || t.push({
  47451. distance: Math.sqrt(i),
  47452. point: this.position,
  47453. face: null,
  47454. object: this
  47455. })
  47456. }
  47457. ),
  47458. Ci.Sprite.prototype.clone = function() {
  47459. return new this.constructor(this.material).copy(this)
  47460. }
  47461. ,
  47462. Ci.Particle = Ci.Sprite,
  47463. Ci.LensFlare = function(e, t, i, n, r) {
  47464. Ci.Object3D.call(this),
  47465. this.lensFlares = [],
  47466. this.positionScreen = new Ci.Vector3,
  47467. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47468. }
  47469. ,
  47470. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47471. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47472. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47473. void 0 === t && (t = -1),
  47474. void 0 === i && (i = 0),
  47475. void 0 === o && (o = 1),
  47476. void 0 === r && (r = new Ci.Color(16777215)),
  47477. void 0 === n && (n = Ci.NormalBlending),
  47478. i = Math.min(i, Math.max(0, i)),
  47479. this.lensFlares.push({
  47480. texture: e,
  47481. size: t,
  47482. distance: i,
  47483. x: 0,
  47484. y: 0,
  47485. z: 0,
  47486. scale: 1,
  47487. rotation: 0,
  47488. opacity: o,
  47489. color: r,
  47490. blending: n
  47491. })
  47492. }
  47493. ,
  47494. Ci.LensFlare.prototype.updateLensFlares = function() {
  47495. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47496. for (e = 0; e < i; e++)
  47497. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47498. t.y = this.positionScreen.y + r * t.distance,
  47499. t.wantedRotation = t.x * Math.PI * .25,
  47500. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47501. }
  47502. ,
  47503. Ci.LensFlare.prototype.copy = function(e) {
  47504. Ci.Object3D.prototype.copy.call(this, e),
  47505. this.positionScreen.copy(e.positionScreen),
  47506. this.customUpdateCallback = e.customUpdateCallback;
  47507. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47508. this.lensFlares.push(e.lensFlares[t]);
  47509. return this
  47510. }
  47511. ,
  47512. Ci.Scene = function() {
  47513. Ci.Object3D.call(this),
  47514. this.type = "Scene",
  47515. this.fog = null,
  47516. this.overrideMaterial = null,
  47517. this.autoUpdate = !0
  47518. }
  47519. ,
  47520. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47521. Ci.Scene.prototype.constructor = Ci.Scene,
  47522. Ci.Scene.prototype.copy = function(e, t) {
  47523. return Ci.Object3D.prototype.copy.call(this, e, t),
  47524. null !== e.fog && (this.fog = e.fog.clone()),
  47525. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47526. this.autoUpdate = e.autoUpdate,
  47527. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47528. this
  47529. }
  47530. ,
  47531. Ci.Fog = function(e, t, i) {
  47532. this.name = "",
  47533. this.color = new Ci.Color(e),
  47534. this.near = void 0 !== t ? t : 1,
  47535. this.far = void 0 !== i ? i : 1e3
  47536. }
  47537. ,
  47538. Ci.Fog.prototype.clone = function() {
  47539. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47540. }
  47541. ,
  47542. Ci.FogExp2 = function(e, t) {
  47543. this.name = "",
  47544. this.color = new Ci.Color(e),
  47545. this.density = void 0 !== t ? t : 25e-5
  47546. }
  47547. ,
  47548. Ci.FogExp2.prototype.clone = function() {
  47549. return new Ci.FogExp2(this.color.getHex(),this.density)
  47550. }
  47551. ,
  47552. Ci.ShaderChunk = {},
  47553. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47554. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47555. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47556. Ci.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  47557. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47558. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47559. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47560. Ci.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  47561. Ci.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  47562. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47563. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47564. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47565. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47566. Ci.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  47567. Ci.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  47568. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47569. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47570. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47571. Ci.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  47572. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47573. Ci.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  47574. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47575. Ci.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  47576. Ci.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  47577. Ci.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  47578. Ci.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  47579. Ci.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  47580. Ci.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  47581. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47582. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47583. Ci.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  47584. Ci.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  47585. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47586. Ci.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  47587. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47588. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47589. Ci.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  47590. Ci.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  47591. Ci.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  47592. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47593. Ci.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  47594. Ci.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  47595. Ci.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  47596. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47597. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47598. Ci.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  47599. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47600. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47601. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47602. Ci.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  47603. Ci.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",
  47604. Ci.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",
  47605. Ci.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  47606. Ci.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  47607. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47608. Ci.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  47609. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47610. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47611. Ci.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  47612. Ci.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  47613. Ci.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  47614. Ci.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  47615. Ci.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  47616. Ci.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  47617. Ci.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  47618. Ci.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  47619. Ci.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  47620. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47621. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47622. Ci.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  47623. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47624. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47625. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47626. Ci.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  47627. Ci.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  47628. Ci.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  47629. Ci.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  47630. Ci.UniformsUtils = {
  47631. merge: function(e) {
  47632. for (var t = {}, i = 0; i < e.length; i++) {
  47633. var n = this.clone(e[i]);
  47634. for (var r in n)
  47635. t[r] = n[r]
  47636. }
  47637. return t
  47638. },
  47639. clone: function(e) {
  47640. var t = {};
  47641. for (var i in e)
  47642. for (var n in t[i] = {},
  47643. e[i]) {
  47644. var r = e[i][n];
  47645. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  47646. }
  47647. return t
  47648. }
  47649. },
  47650. Ci.UniformsLib = {
  47651. common: {
  47652. diffuse: {
  47653. type: "c",
  47654. value: new Ci.Color(15658734)
  47655. },
  47656. opacity: {
  47657. type: "f",
  47658. value: 1
  47659. },
  47660. map: {
  47661. type: "t",
  47662. value: null
  47663. },
  47664. offsetRepeat: {
  47665. type: "v4",
  47666. value: new Ci.Vector4(0,0,1,1)
  47667. },
  47668. specularMap: {
  47669. type: "t",
  47670. value: null
  47671. },
  47672. alphaMap: {
  47673. type: "t",
  47674. value: null
  47675. },
  47676. envMap: {
  47677. type: "t",
  47678. value: null
  47679. },
  47680. flipEnvMap: {
  47681. type: "f",
  47682. value: -1
  47683. },
  47684. reflectivity: {
  47685. type: "f",
  47686. value: 1
  47687. },
  47688. refractionRatio: {
  47689. type: "f",
  47690. value: .98
  47691. }
  47692. },
  47693. aomap: {
  47694. aoMap: {
  47695. type: "t",
  47696. value: null
  47697. },
  47698. aoMapIntensity: {
  47699. type: "f",
  47700. value: 1
  47701. }
  47702. },
  47703. lightmap: {
  47704. lightMap: {
  47705. type: "t",
  47706. value: null
  47707. },
  47708. lightMapIntensity: {
  47709. type: "f",
  47710. value: 1
  47711. }
  47712. },
  47713. emissivemap: {
  47714. emissiveMap: {
  47715. type: "t",
  47716. value: null
  47717. }
  47718. },
  47719. bumpmap: {
  47720. bumpMap: {
  47721. type: "t",
  47722. value: null
  47723. },
  47724. bumpScale: {
  47725. type: "f",
  47726. value: 1
  47727. }
  47728. },
  47729. normalmap: {
  47730. normalMap: {
  47731. type: "t",
  47732. value: null
  47733. },
  47734. normalScale: {
  47735. type: "v2",
  47736. value: new Ci.Vector2(1,1)
  47737. }
  47738. },
  47739. displacementmap: {
  47740. displacementMap: {
  47741. type: "t",
  47742. value: null
  47743. },
  47744. displacementScale: {
  47745. type: "f",
  47746. value: 1
  47747. },
  47748. displacementBias: {
  47749. type: "f",
  47750. value: 0
  47751. }
  47752. },
  47753. roughnessmap: {
  47754. roughnessMap: {
  47755. type: "t",
  47756. value: null
  47757. }
  47758. },
  47759. metalnessmap: {
  47760. metalnessMap: {
  47761. type: "t",
  47762. value: null
  47763. }
  47764. },
  47765. fog: {
  47766. fogDensity: {
  47767. type: "f",
  47768. value: 25e-5
  47769. },
  47770. fogNear: {
  47771. type: "f",
  47772. value: 1
  47773. },
  47774. fogFar: {
  47775. type: "f",
  47776. value: 2e3
  47777. },
  47778. fogColor: {
  47779. type: "c",
  47780. value: new Ci.Color(16777215)
  47781. }
  47782. },
  47783. lights: {
  47784. ambientLightColor: {
  47785. type: "fv",
  47786. value: []
  47787. },
  47788. directionalLights: {
  47789. type: "sa",
  47790. value: [],
  47791. properties: {
  47792. direction: {
  47793. type: "v3"
  47794. },
  47795. color: {
  47796. type: "c"
  47797. },
  47798. shadow: {
  47799. type: "i"
  47800. },
  47801. shadowBias: {
  47802. type: "f"
  47803. },
  47804. shadowRadius: {
  47805. type: "f"
  47806. },
  47807. shadowMapSize: {
  47808. type: "v2"
  47809. }
  47810. }
  47811. },
  47812. directionalShadowMap: {
  47813. type: "tv",
  47814. value: []
  47815. },
  47816. directionalShadowMatrix: {
  47817. type: "m4v",
  47818. value: []
  47819. },
  47820. spotLights: {
  47821. type: "sa",
  47822. value: [],
  47823. properties: {
  47824. color: {
  47825. type: "c"
  47826. },
  47827. position: {
  47828. type: "v3"
  47829. },
  47830. direction: {
  47831. type: "v3"
  47832. },
  47833. distance: {
  47834. type: "f"
  47835. },
  47836. coneCos: {
  47837. type: "f"
  47838. },
  47839. penumbraCos: {
  47840. type: "f"
  47841. },
  47842. decay: {
  47843. type: "f"
  47844. },
  47845. shadow: {
  47846. type: "i"
  47847. },
  47848. shadowBias: {
  47849. type: "f"
  47850. },
  47851. shadowRadius: {
  47852. type: "f"
  47853. },
  47854. shadowMapSize: {
  47855. type: "v2"
  47856. }
  47857. }
  47858. },
  47859. spotShadowMap: {
  47860. type: "tv",
  47861. value: []
  47862. },
  47863. spotShadowMatrix: {
  47864. type: "m4v",
  47865. value: []
  47866. },
  47867. pointLights: {
  47868. type: "sa",
  47869. value: [],
  47870. properties: {
  47871. color: {
  47872. type: "c"
  47873. },
  47874. position: {
  47875. type: "v3"
  47876. },
  47877. decay: {
  47878. type: "f"
  47879. },
  47880. distance: {
  47881. type: "f"
  47882. },
  47883. shadow: {
  47884. type: "i"
  47885. },
  47886. shadowBias: {
  47887. type: "f"
  47888. },
  47889. shadowRadius: {
  47890. type: "f"
  47891. },
  47892. shadowMapSize: {
  47893. type: "v2"
  47894. }
  47895. }
  47896. },
  47897. pointShadowMap: {
  47898. type: "tv",
  47899. value: []
  47900. },
  47901. pointShadowMatrix: {
  47902. type: "m4v",
  47903. value: []
  47904. },
  47905. hemisphereLights: {
  47906. type: "sa",
  47907. value: [],
  47908. properties: {
  47909. direction: {
  47910. type: "v3"
  47911. },
  47912. skyColor: {
  47913. type: "c"
  47914. },
  47915. groundColor: {
  47916. type: "c"
  47917. }
  47918. }
  47919. }
  47920. },
  47921. points: {
  47922. diffuse: {
  47923. type: "c",
  47924. value: new Ci.Color(15658734)
  47925. },
  47926. opacity: {
  47927. type: "f",
  47928. value: 1
  47929. },
  47930. size: {
  47931. type: "f",
  47932. value: 1
  47933. },
  47934. scale: {
  47935. type: "f",
  47936. value: 1
  47937. },
  47938. map: {
  47939. type: "t",
  47940. value: null
  47941. },
  47942. offsetRepeat: {
  47943. type: "v4",
  47944. value: new Ci.Vector4(0,0,1,1)
  47945. }
  47946. }
  47947. },
  47948. Ci.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  47949. Ci.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  47950. Ci.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  47951. Ci.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47952. Ci.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  47953. Ci.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47954. Ci.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  47955. Ci.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  47956. Ci.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  47957. Ci.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  47958. Ci.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47959. Ci.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  47960. Ci.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47961. Ci.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  47962. Ci.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47963. Ci.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47964. Ci.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47965. Ci.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47966. Ci.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47967. Ci.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47968. Ci.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  47969. Ci.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47970. Ci.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47971. Ci.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47972. Ci.ShaderLib = {
  47973. basic: {
  47974. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47975. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47976. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47977. },
  47978. lambert: {
  47979. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47980. emissive: {
  47981. type: "c",
  47982. value: new Ci.Color(0)
  47983. }
  47984. }]),
  47985. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47986. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47987. },
  47988. phong: {
  47989. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47990. emissive: {
  47991. type: "c",
  47992. value: new Ci.Color(0)
  47993. },
  47994. specular: {
  47995. type: "c",
  47996. value: new Ci.Color(1118481)
  47997. },
  47998. shininess: {
  47999. type: "f",
  48000. value: 30
  48001. }
  48002. }]),
  48003. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48004. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48005. },
  48006. standard: {
  48007. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48008. emissive: {
  48009. type: "c",
  48010. value: new Ci.Color(0)
  48011. },
  48012. roughness: {
  48013. type: "f",
  48014. value: .5
  48015. },
  48016. metalness: {
  48017. type: "f",
  48018. value: 0
  48019. },
  48020. envMapIntensity: {
  48021. type: "f",
  48022. value: 1
  48023. }
  48024. }]),
  48025. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48026. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48027. },
  48028. points: {
  48029. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48030. vertexShader: Ci.ShaderChunk.points_vert,
  48031. fragmentShader: Ci.ShaderChunk.points_frag
  48032. },
  48033. dashed: {
  48034. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48035. scale: {
  48036. type: "f",
  48037. value: 1
  48038. },
  48039. dashSize: {
  48040. type: "f",
  48041. value: 1
  48042. },
  48043. totalSize: {
  48044. type: "f",
  48045. value: 2
  48046. }
  48047. }]),
  48048. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48049. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48050. },
  48051. depth: {
  48052. uniforms: {
  48053. mNear: {
  48054. type: "f",
  48055. value: 1
  48056. },
  48057. mFar: {
  48058. type: "f",
  48059. value: 2e3
  48060. },
  48061. opacity: {
  48062. type: "f",
  48063. value: 1
  48064. }
  48065. },
  48066. vertexShader: Ci.ShaderChunk.depth_vert,
  48067. fragmentShader: Ci.ShaderChunk.depth_frag
  48068. },
  48069. normal: {
  48070. uniforms: {
  48071. opacity: {
  48072. type: "f",
  48073. value: 1
  48074. }
  48075. },
  48076. vertexShader: Ci.ShaderChunk.normal_vert,
  48077. fragmentShader: Ci.ShaderChunk.normal_frag
  48078. },
  48079. cube: {
  48080. uniforms: {
  48081. tCube: {
  48082. type: "t",
  48083. value: null
  48084. },
  48085. tFlip: {
  48086. type: "f",
  48087. value: -1
  48088. }
  48089. },
  48090. vertexShader: Ci.ShaderChunk.cube_vert,
  48091. fragmentShader: Ci.ShaderChunk.cube_frag
  48092. },
  48093. equirect: {
  48094. uniforms: {
  48095. tEquirect: {
  48096. type: "t",
  48097. value: null
  48098. },
  48099. tFlip: {
  48100. type: "f",
  48101. value: -1
  48102. }
  48103. },
  48104. vertexShader: Ci.ShaderChunk.equirect_vert,
  48105. fragmentShader: Ci.ShaderChunk.equirect_frag
  48106. },
  48107. depthRGBA: {
  48108. uniforms: {},
  48109. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48110. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48111. },
  48112. distanceRGBA: {
  48113. uniforms: {
  48114. lightPos: {
  48115. type: "v3",
  48116. value: new Ci.Vector3(0,0,0)
  48117. }
  48118. },
  48119. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48120. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48121. }
  48122. },
  48123. Ci.WebGLRenderer = function(e) {
  48124. function S() {
  48125. return null === Q ? he : 1
  48126. }
  48127. function i(e, t, i, n) {
  48128. !0 === V && (e *= n,
  48129. t *= n,
  48130. i *= n),
  48131. _e.clearColor(e, t, i, n)
  48132. }
  48133. function t() {
  48134. _e.init(),
  48135. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48136. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48137. i(ae.r, ae.g, ae.b, se)
  48138. }
  48139. function n() {
  48140. te = K = null,
  48141. ee = "",
  48142. $ = -1,
  48143. _e.reset()
  48144. }
  48145. function r(e) {
  48146. e.preventDefault(),
  48147. n(),
  48148. t(),
  48149. be.clear()
  48150. }
  48151. function f(e) {
  48152. var t = e.target;
  48153. t.removeEventListener("dispose", f),
  48154. function(e) {
  48155. var t = be.get(e);
  48156. if (e.image && t.__image__webglTextureCube)
  48157. X.deleteTexture(t.__image__webglTextureCube);
  48158. else {
  48159. if (void 0 === t.__webglInit)
  48160. return;
  48161. X.deleteTexture(t.__webglTexture)
  48162. }
  48163. be.delete(e)
  48164. }(t),
  48165. ye.textures--
  48166. }
  48167. function a(e) {
  48168. var t = e.target;
  48169. t.removeEventListener("dispose", a),
  48170. function(e) {
  48171. var t = be.get(e)
  48172. , i = be.get(e.texture);
  48173. if (e && void 0 !== i.__webglTexture) {
  48174. if (X.deleteTexture(i.__webglTexture),
  48175. e instanceof Ci.WebGLRenderTargetCube)
  48176. for (var n = 0; n < 6; n++)
  48177. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48178. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48179. else
  48180. X.deleteFramebuffer(t.__webglFramebuffer),
  48181. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48182. be.delete(e.texture),
  48183. be.delete(e)
  48184. }
  48185. }(t),
  48186. ye.textures--
  48187. }
  48188. function v(e) {
  48189. var t = e.target;
  48190. t.removeEventListener("dispose", v),
  48191. function(e) {
  48192. y(e),
  48193. be.delete(e)
  48194. }(t)
  48195. }
  48196. function y(e) {
  48197. var t = be.get(e).program;
  48198. (e.program = void 0) !== t && Te.releaseProgram(t)
  48199. }
  48200. function M(e, t) {
  48201. return Math.abs(t[0]) - Math.abs(e[0])
  48202. }
  48203. function s(e, t) {
  48204. 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
  48205. }
  48206. function l(e, t) {
  48207. 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
  48208. }
  48209. function d(e, t, i, n, r) {
  48210. var o, a;
  48211. a = i.transparent ? (o = G,
  48212. ++W) : (o = H,
  48213. ++z);
  48214. var s = o[a];
  48215. void 0 !== s ? (s.id = e.id,
  48216. s.object = e,
  48217. s.geometry = t,
  48218. s.material = i,
  48219. s.z = me.z,
  48220. s.group = r) : (s = {
  48221. id: e.id,
  48222. object: e,
  48223. geometry: t,
  48224. material: i,
  48225. z: me.z,
  48226. group: r
  48227. },
  48228. o.push(s))
  48229. }
  48230. function c(e, t, i, n) {
  48231. for (var r = 0, o = e.length; r < o; r++) {
  48232. var a = e[r]
  48233. , s = a.object
  48234. , l = a.geometry
  48235. , c = void 0 === n ? a.material : n
  48236. , h = a.group;
  48237. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48238. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48239. s instanceof Ci.ImmediateRenderObject) {
  48240. R(c);
  48241. var u = P(t, i, c, s);
  48242. ee = "",
  48243. s.render(function(e) {
  48244. Z.renderBufferImmediate(e, u, c)
  48245. })
  48246. } else
  48247. Z.renderBufferDirect(t, i, l, c, s, h)
  48248. }
  48249. }
  48250. function R(e) {
  48251. (function(e) {
  48252. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48253. _e.setFlipSided(e.side === Ci.BackSide)
  48254. }
  48255. )(e),
  48256. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  48257. _e.setDepthFunc(e.depthFunc),
  48258. _e.setDepthTest(e.depthTest),
  48259. _e.setDepthWrite(e.depthWrite),
  48260. _e.setColorWrite(e.colorWrite),
  48261. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48262. }
  48263. function P(e, t, i, n) {
  48264. oe = 0;
  48265. var r = be.get(i);
  48266. void 0 === r.program && (i.needsUpdate = !0),
  48267. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48268. i.needsUpdate && (function(e, t, i) {
  48269. var n = be.get(e)
  48270. , r = Te.getParameters(e, ve, t, i)
  48271. , o = Te.getProgramCode(e, r)
  48272. , a = n.program
  48273. , s = !0;
  48274. if (void 0 === a)
  48275. e.addEventListener("dispose", v);
  48276. else if (a.code !== o)
  48277. y(e);
  48278. else {
  48279. if (void 0 !== r.shaderID)
  48280. return;
  48281. s = !1
  48282. }
  48283. if (s) {
  48284. if (r.shaderID) {
  48285. var l = Ci.ShaderLib[r.shaderID];
  48286. n.__webglShader = {
  48287. name: e.type,
  48288. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48289. vertexShader: l.vertexShader,
  48290. fragmentShader: l.fragmentShader
  48291. }
  48292. } else
  48293. n.__webglShader = {
  48294. name: e.type,
  48295. uniforms: e.uniforms,
  48296. vertexShader: e.vertexShader,
  48297. fragmentShader: e.fragmentShader
  48298. };
  48299. e.__webglShader = n.__webglShader,
  48300. a = Te.acquireProgram(e, r, o),
  48301. n.program = a,
  48302. e.program = a
  48303. }
  48304. var c = a.getAttributes();
  48305. if (e.morphTargets)
  48306. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48307. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48308. if (e.morphNormals)
  48309. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48310. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48311. n.uniformsList = [];
  48312. var u = n.__webglShader.uniforms
  48313. , d = n.program.getUniforms();
  48314. for (var p in u) {
  48315. var f = d[p];
  48316. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48317. }
  48318. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48319. u.ambientLightColor.value = ve.ambient,
  48320. u.directionalLights.value = ve.directional,
  48321. u.spotLights.value = ve.spot,
  48322. u.pointLights.value = ve.point,
  48323. u.hemisphereLights.value = ve.hemi,
  48324. u.directionalShadowMap.value = ve.directionalShadowMap,
  48325. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48326. u.spotShadowMap.value = ve.spotShadowMap,
  48327. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48328. u.pointShadowMap.value = ve.pointShadowMap,
  48329. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48330. n.hasDynamicUniforms = !1;
  48331. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48332. if (!0 === n.uniformsList[g][0].dynamic) {
  48333. n.hasDynamicUniforms = !0;
  48334. break
  48335. }
  48336. }
  48337. }(i, t, n),
  48338. i.needsUpdate = !1);
  48339. var o = !1
  48340. , a = !1
  48341. , s = !1
  48342. , l = r.program
  48343. , c = l.getUniforms()
  48344. , h = r.__webglShader.uniforms;
  48345. if (l.id !== K && (X.useProgram(l.program),
  48346. K = l.id,
  48347. s = a = o = !0),
  48348. i.id !== $ && ($ = i.id,
  48349. a = !0),
  48350. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48351. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48352. e !== te && (te = e,
  48353. s = a = !0),
  48354. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48355. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48356. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48357. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48358. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48359. i.skinning)
  48360. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48361. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48362. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48363. if (void 0 !== c.boneTexture) {
  48364. var u = A();
  48365. X.uniform1i(c.boneTexture, u),
  48366. Z.setTexture(n.skeleton.boneTexture, u)
  48367. }
  48368. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48369. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48370. } else
  48371. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48372. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48373. e.ambientLightColor.needsUpdate = t,
  48374. e.directionalLights.needsUpdate = t,
  48375. e.pointLights.needsUpdate = t,
  48376. e.spotLights.needsUpdate = t,
  48377. e.hemisphereLights.needsUpdate = t
  48378. }(h, s),
  48379. t && i.fog && function(e, t) {
  48380. e.fogColor.value = t.color,
  48381. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48382. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48383. }(h, t),
  48384. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48385. var i;
  48386. if (e.opacity.value = t.opacity,
  48387. e.diffuse.value = t.color,
  48388. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48389. e.map.value = t.map,
  48390. e.specularMap.value = t.specularMap,
  48391. e.alphaMap.value = t.alphaMap,
  48392. t.aoMap && (e.aoMap.value = t.aoMap,
  48393. e.aoMapIntensity.value = t.aoMapIntensity),
  48394. 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),
  48395. void 0 !== i) {
  48396. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48397. var n = i.offset
  48398. , r = i.repeat;
  48399. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48400. }
  48401. e.envMap.value = t.envMap,
  48402. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48403. e.reflectivity.value = t.reflectivity,
  48404. e.refractionRatio.value = t.refractionRatio
  48405. }(h, i),
  48406. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48407. function(e, t) {
  48408. e.dashSize.value = t.dashSize,
  48409. e.totalSize.value = t.dashSize + t.gapSize,
  48410. e.scale.value = t.scale
  48411. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48412. if (e.diffuse.value = t.color,
  48413. e.opacity.value = t.opacity,
  48414. e.size.value = t.size * he,
  48415. e.scale.value = O.clientHeight / 2,
  48416. e.map.value = t.map,
  48417. null !== t.map) {
  48418. var i = t.map.offset
  48419. , n = t.map.repeat;
  48420. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48421. }
  48422. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48423. t.lightMap && (e.lightMap.value = t.lightMap,
  48424. e.lightMapIntensity.value = t.lightMapIntensity),
  48425. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48426. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48427. e.specular.value = t.specular,
  48428. e.shininess.value = Math.max(t.shininess, 1e-4),
  48429. t.lightMap && (e.lightMap.value = t.lightMap,
  48430. e.lightMapIntensity.value = t.lightMapIntensity),
  48431. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48432. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48433. e.bumpScale.value = t.bumpScale),
  48434. t.normalMap && (e.normalMap.value = t.normalMap,
  48435. e.normalScale.value.copy(t.normalScale)),
  48436. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48437. e.displacementScale.value = t.displacementScale,
  48438. e.displacementBias.value = t.displacementBias)
  48439. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48440. e.roughness.value = t.roughness,
  48441. e.metalness.value = t.metalness,
  48442. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48443. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48444. t.lightMap && (e.lightMap.value = t.lightMap,
  48445. e.lightMapIntensity.value = t.lightMapIntensity),
  48446. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48447. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48448. e.bumpScale.value = t.bumpScale),
  48449. t.normalMap && (e.normalMap.value = t.normalMap,
  48450. e.normalScale.value.copy(t.normalScale)),
  48451. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48452. e.displacementScale.value = t.displacementScale,
  48453. e.displacementBias.value = t.displacementBias),
  48454. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48455. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48456. h.mFar.value = e.far,
  48457. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48458. g(r.uniformsList)),
  48459. function(e, t) {
  48460. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48461. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48462. }(c, n),
  48463. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48464. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48465. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48466. var a = e[r][0]
  48467. , s = a.onUpdateCallback;
  48468. void 0 !== s && (s.bind(a)(t, i),
  48469. n.push(e[r]))
  48470. }
  48471. g(n)
  48472. }(r.uniformsList, n, e),
  48473. l
  48474. }
  48475. function p(e, t) {
  48476. e.diffuse.value = t.color,
  48477. e.opacity.value = t.opacity
  48478. }
  48479. function A() {
  48480. var e = oe;
  48481. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48482. oe += 1,
  48483. e
  48484. }
  48485. function C(e, t, i, n) {
  48486. var r, o;
  48487. if ("1i" === t)
  48488. X.uniform1i(i, n);
  48489. else if ("1f" === t)
  48490. X.uniform1f(i, n);
  48491. else if ("2f" === t)
  48492. X.uniform2f(i, n[0], n[1]);
  48493. else if ("3f" === t)
  48494. X.uniform3f(i, n[0], n[1], n[2]);
  48495. else if ("4f" === t)
  48496. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48497. else if ("1iv" === t)
  48498. X.uniform1iv(i, n);
  48499. else if ("3iv" === t)
  48500. X.uniform3iv(i, n);
  48501. else if ("1fv" === t)
  48502. X.uniform1fv(i, n);
  48503. else if ("2fv" === t)
  48504. X.uniform2fv(i, n);
  48505. else if ("3fv" === t)
  48506. X.uniform3fv(i, n);
  48507. else if ("4fv" === t)
  48508. X.uniform4fv(i, n);
  48509. else if ("Matrix2fv" === t)
  48510. X.uniformMatrix2fv(i, !1, n);
  48511. else if ("Matrix3fv" === t)
  48512. X.uniformMatrix3fv(i, !1, n);
  48513. else if ("Matrix4fv" === t)
  48514. X.uniformMatrix4fv(i, !1, n);
  48515. else if ("i" === t)
  48516. X.uniform1i(i, n);
  48517. else if ("f" === t)
  48518. X.uniform1f(i, n);
  48519. else if ("v2" === t)
  48520. X.uniform2f(i, n.x, n.y);
  48521. else if ("v3" === t)
  48522. X.uniform3f(i, n.x, n.y, n.z);
  48523. else if ("v4" === t)
  48524. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48525. else if ("c" === t)
  48526. X.uniform3f(i, n.r, n.g, n.b);
  48527. else if ("s" === t) {
  48528. var a = e.properties;
  48529. for (var s in a) {
  48530. var l = a[s]
  48531. , c = i[s]
  48532. , h = n[s];
  48533. C(l, l.type, c, h)
  48534. }
  48535. } else if ("sa" === t) {
  48536. a = e.properties;
  48537. for (var u = 0, d = n.length; u < d; u++)
  48538. for (var s in a) {
  48539. l = a[s],
  48540. c = i[u][s],
  48541. h = n[u][s];
  48542. C(l, l.type, c, h)
  48543. }
  48544. } else if ("iv1" === t)
  48545. X.uniform1iv(i, n);
  48546. else if ("iv" === t)
  48547. X.uniform3iv(i, n);
  48548. else if ("fv1" === t)
  48549. X.uniform1fv(i, n);
  48550. else if ("fv" === t)
  48551. X.uniform3fv(i, n);
  48552. else if ("v2v" === t) {
  48553. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48554. u = 0;
  48555. for (var p = 0, f = n.length; u < f; u++,
  48556. p += 2)
  48557. e._array[p + 0] = n[u].x,
  48558. e._array[p + 1] = n[u].y;
  48559. X.uniform2fv(i, e._array)
  48560. } else if ("v3v" === t) {
  48561. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48562. u = 0;
  48563. var g = 0;
  48564. for (f = n.length; u < f; u++,
  48565. g += 3)
  48566. e._array[g + 0] = n[u].x,
  48567. e._array[g + 1] = n[u].y,
  48568. e._array[g + 2] = n[u].z;
  48569. X.uniform3fv(i, e._array)
  48570. } else if ("v4v" === t) {
  48571. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48572. u = 0;
  48573. var m = 0;
  48574. for (f = n.length; u < f; u++,
  48575. m += 4)
  48576. e._array[m + 0] = n[u].x,
  48577. e._array[m + 1] = n[u].y,
  48578. e._array[m + 2] = n[u].z,
  48579. e._array[m + 3] = n[u].w;
  48580. X.uniform4fv(i, e._array)
  48581. } else if ("m2" === t)
  48582. X.uniformMatrix2fv(i, !1, n.elements);
  48583. else if ("m3" === t)
  48584. X.uniformMatrix3fv(i, !1, n.elements);
  48585. else if ("m3v" === t) {
  48586. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48587. for (u = 0,
  48588. f = n.length; u < f; u++)
  48589. n[u].flattenToArrayOffset(e._array, 9 * u);
  48590. X.uniformMatrix3fv(i, !1, e._array)
  48591. } else if ("m4" === t)
  48592. X.uniformMatrix4fv(i, !1, n.elements);
  48593. else if ("m4v" === t) {
  48594. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48595. for (u = 0,
  48596. f = n.length; u < f; u++)
  48597. n[u].flattenToArrayOffset(e._array, 16 * u);
  48598. X.uniformMatrix4fv(i, !1, e._array)
  48599. } else if ("t" === t) {
  48600. if (r = n,
  48601. o = A(),
  48602. X.uniform1i(i, o),
  48603. !r)
  48604. return;
  48605. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  48606. } else if ("tv" === t) {
  48607. void 0 === e._array && (e._array = []);
  48608. for (u = 0,
  48609. f = e.value.length; u < f; u++)
  48610. e._array[u] = A();
  48611. X.uniform1iv(i, e._array);
  48612. for (u = 0,
  48613. f = e.value.length; u < f; u++)
  48614. r = e.value[u],
  48615. o = e._array[u],
  48616. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  48617. } else
  48618. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48619. }
  48620. function g(e) {
  48621. for (var t = 0, i = e.length; t < i; t++) {
  48622. var n = e[t][0];
  48623. if (!1 !== n.needsUpdate)
  48624. C(n, n.type, e[t][1], n.value)
  48625. }
  48626. }
  48627. function m(e, t, i) {
  48628. var n;
  48629. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48630. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48631. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48632. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48633. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48634. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  48635. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48636. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48637. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  48638. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48639. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48640. return;
  48641. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48642. return;
  48643. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48644. be.get(t).__currentAnisotropy = t.anisotropy)
  48645. }
  48646. }
  48647. function o(e, t, i) {
  48648. void 0 === e.__webglInit && (e.__webglInit = !0,
  48649. t.addEventListener("dispose", f),
  48650. e.__webglTexture = X.createTexture(),
  48651. ye.textures++),
  48652. _e.activeTexture(X.TEXTURE0 + i),
  48653. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48654. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48655. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48656. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48657. var n = I(t.image, Ee.maxTextureSize);
  48658. !function(e) {
  48659. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48660. }(t) || !1 !== E(n) || (n = function(e) {
  48661. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48662. var t = document.createElement("canvas");
  48663. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48664. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48665. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48666. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48667. t
  48668. }
  48669. return e
  48670. }(n));
  48671. var r = E(n)
  48672. , o = x(t.format)
  48673. , a = x(t.type);
  48674. m(X.TEXTURE_2D, t, r);
  48675. var s, l = t.mipmaps;
  48676. if (t instanceof Ci.DataTexture)
  48677. if (0 < l.length && r) {
  48678. for (var c = 0, h = l.length; c < h; c++)
  48679. s = l[c],
  48680. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48681. t.generateMipmaps = !1
  48682. } else
  48683. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48684. else if (t instanceof Ci.CompressedTexture)
  48685. for (c = 0,
  48686. h = l.length; c < h; c++)
  48687. s = l[c],
  48688. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48689. else if (0 < l.length && r) {
  48690. for (c = 0,
  48691. h = l.length; c < h; c++)
  48692. s = l[c],
  48693. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48694. t.generateMipmaps = !1
  48695. } else
  48696. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48697. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48698. e.__version = t.version,
  48699. t.onUpdate && t.onUpdate(t)
  48700. }
  48701. function I(e, t) {
  48702. if (e.width > t || e.height > t) {
  48703. var i = t / Math.max(e.width, e.height)
  48704. , n = document.createElement("canvas");
  48705. return n.width = Math.floor(e.width * i),
  48706. n.height = Math.floor(e.height * i),
  48707. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48708. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48709. n
  48710. }
  48711. return e
  48712. }
  48713. function E(e) {
  48714. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48715. }
  48716. function _(e, t) {
  48717. var i = be.get(e);
  48718. if (6 === e.image.length)
  48719. if (0 < e.version && i.__version !== e.version) {
  48720. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48721. i.__image__webglTextureCube = X.createTexture(),
  48722. ye.textures++),
  48723. _e.activeTexture(X.TEXTURE0 + t),
  48724. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48725. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48726. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48727. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48728. var s = E(o[0])
  48729. , l = x(e.format)
  48730. , c = x(e.type);
  48731. m(X.TEXTURE_CUBE_MAP, e, s);
  48732. for (a = 0; a < 6; a++)
  48733. if (n)
  48734. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48735. h = u[d],
  48736. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  48737. else
  48738. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  48739. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48740. i.__version = e.version,
  48741. e.onUpdate && e.onUpdate(e)
  48742. } else
  48743. _e.activeTexture(X.TEXTURE0 + t),
  48744. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48745. }
  48746. function b(e, t) {
  48747. _e.activeTexture(X.TEXTURE0 + t),
  48748. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48749. }
  48750. function h(e, t, i, n) {
  48751. var r = x(t.texture.format)
  48752. , o = x(t.texture.type);
  48753. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48754. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48755. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48756. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48757. }
  48758. function u(e, t) {
  48759. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48760. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48761. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  48762. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48763. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48764. }
  48765. function w(e) {
  48766. var t = be.get(e)
  48767. , i = be.get(e.texture);
  48768. e.addEventListener("dispose", a),
  48769. i.__webglTexture = X.createTexture(),
  48770. ye.textures++;
  48771. var n = e instanceof Ci.WebGLRenderTargetCube
  48772. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48773. if (n) {
  48774. t.__webglFramebuffer = [];
  48775. for (var o = 0; o < 6; o++)
  48776. t.__webglFramebuffer[o] = X.createFramebuffer()
  48777. } else
  48778. t.__webglFramebuffer = X.createFramebuffer();
  48779. if (n) {
  48780. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48781. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48782. for (o = 0; o < 6; o++)
  48783. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48784. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48785. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48786. } else
  48787. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48788. m(X.TEXTURE_2D, e.texture, r),
  48789. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48790. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48791. _e.bindTexture(X.TEXTURE_2D, null);
  48792. e.depthBuffer && function(e) {
  48793. var t = be.get(e);
  48794. if (e instanceof Ci.WebGLRenderTargetCube) {
  48795. t.__webglDepthbuffer = [];
  48796. for (var i = 0; i < 6; i++)
  48797. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48798. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48799. u(t.__webglDepthbuffer[i], e)
  48800. } else
  48801. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48802. t.__webglDepthbuffer = X.createRenderbuffer(),
  48803. u(t.__webglDepthbuffer, e);
  48804. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48805. }(e)
  48806. }
  48807. function T(e) {
  48808. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48809. }
  48810. function x(e) {
  48811. var t;
  48812. if (e === Ci.RepeatWrapping)
  48813. return X.REPEAT;
  48814. if (e === Ci.ClampToEdgeWrapping)
  48815. return X.CLAMP_TO_EDGE;
  48816. if (e === Ci.MirroredRepeatWrapping)
  48817. return X.MIRRORED_REPEAT;
  48818. if (e === Ci.NearestFilter)
  48819. return X.NEAREST;
  48820. if (e === Ci.NearestMipMapNearestFilter)
  48821. return X.NEAREST_MIPMAP_NEAREST;
  48822. if (e === Ci.NearestMipMapLinearFilter)
  48823. return X.NEAREST_MIPMAP_LINEAR;
  48824. if (e === Ci.LinearFilter)
  48825. return X.LINEAR;
  48826. if (e === Ci.LinearMipMapNearestFilter)
  48827. return X.LINEAR_MIPMAP_NEAREST;
  48828. if (e === Ci.LinearMipMapLinearFilter)
  48829. return X.LINEAR_MIPMAP_LINEAR;
  48830. if (e === Ci.UnsignedByteType)
  48831. return X.UNSIGNED_BYTE;
  48832. if (e === Ci.UnsignedShort4444Type)
  48833. return X.UNSIGNED_SHORT_4_4_4_4;
  48834. if (e === Ci.UnsignedShort5551Type)
  48835. return X.UNSIGNED_SHORT_5_5_5_1;
  48836. if (e === Ci.UnsignedShort565Type)
  48837. return X.UNSIGNED_SHORT_5_6_5;
  48838. if (e === Ci.ByteType)
  48839. return X.BYTE;
  48840. if (e === Ci.ShortType)
  48841. return X.SHORT;
  48842. if (e === Ci.UnsignedShortType)
  48843. return X.UNSIGNED_SHORT;
  48844. if (e === Ci.IntType)
  48845. return X.INT;
  48846. if (e === Ci.UnsignedIntType)
  48847. return X.UNSIGNED_INT;
  48848. if (e === Ci.FloatType)
  48849. return X.FLOAT;
  48850. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48851. return t.HALF_FLOAT_OES;
  48852. if (e === Ci.AlphaFormat)
  48853. return X.ALPHA;
  48854. if (e === Ci.RGBFormat)
  48855. return X.RGB;
  48856. if (e === Ci.RGBAFormat)
  48857. return X.RGBA;
  48858. if (e === Ci.LuminanceFormat)
  48859. return X.LUMINANCE;
  48860. if (e === Ci.LuminanceAlphaFormat)
  48861. return X.LUMINANCE_ALPHA;
  48862. if (e === Ci.AddEquation)
  48863. return X.FUNC_ADD;
  48864. if (e === Ci.SubtractEquation)
  48865. return X.FUNC_SUBTRACT;
  48866. if (e === Ci.ReverseSubtractEquation)
  48867. return X.FUNC_REVERSE_SUBTRACT;
  48868. if (e === Ci.ZeroFactor)
  48869. return X.ZERO;
  48870. if (e === Ci.OneFactor)
  48871. return X.ONE;
  48872. if (e === Ci.SrcColorFactor)
  48873. return X.SRC_COLOR;
  48874. if (e === Ci.OneMinusSrcColorFactor)
  48875. return X.ONE_MINUS_SRC_COLOR;
  48876. if (e === Ci.SrcAlphaFactor)
  48877. return X.SRC_ALPHA;
  48878. if (e === Ci.OneMinusSrcAlphaFactor)
  48879. return X.ONE_MINUS_SRC_ALPHA;
  48880. if (e === Ci.DstAlphaFactor)
  48881. return X.DST_ALPHA;
  48882. if (e === Ci.OneMinusDstAlphaFactor)
  48883. return X.ONE_MINUS_DST_ALPHA;
  48884. if (e === Ci.DstColorFactor)
  48885. return X.DST_COLOR;
  48886. if (e === Ci.OneMinusDstColorFactor)
  48887. return X.ONE_MINUS_DST_COLOR;
  48888. if (e === Ci.SrcAlphaSaturateFactor)
  48889. return X.SRC_ALPHA_SATURATE;
  48890. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48891. if (e === Ci.RGB_S3TC_DXT1_Format)
  48892. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48893. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48894. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48895. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48896. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48897. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48898. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48899. }
  48900. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48901. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48902. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48903. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48904. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48905. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48906. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48907. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48908. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48909. }
  48910. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48911. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48912. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48913. if (e === Ci.MinEquation)
  48914. return t.MIN_EXT;
  48915. if (e === Ci.MaxEquation)
  48916. return t.MAX_EXT
  48917. }
  48918. return 0
  48919. }
  48920. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48921. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48922. , L = void 0 !== e.context ? e.context : null
  48923. , D = void 0 !== e.alpha && e.alpha
  48924. , N = void 0 === e.depth || e.depth
  48925. , F = void 0 === e.stencil || e.stencil
  48926. , B = void 0 !== e.antialias && e.antialias
  48927. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48928. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48929. , U = []
  48930. , H = []
  48931. , z = -1
  48932. , G = []
  48933. , W = -1
  48934. , j = new Float32Array(8)
  48935. , Y = []
  48936. , q = [];
  48937. this.domElement = O,
  48938. this.context = null,
  48939. this.autoClear = !0,
  48940. this.autoClearColor = !0,
  48941. this.autoClearDepth = !0,
  48942. this.autoClearStencil = !0,
  48943. this.sortObjects = !0,
  48944. this.gammaFactor = 2,
  48945. this.gammaInput = !1,
  48946. this.gammaOutput = !1,
  48947. this.physicallyCorrectLights = !1,
  48948. this.toneMapping = Ci.LinearToneMapping,
  48949. this.toneMappingExposure = 1,
  48950. this.toneMappingWhitePoint = 1,
  48951. this.maxMorphTargets = 8,
  48952. this.maxMorphNormals = 4,
  48953. this.autoScaleCubemaps = !0;
  48954. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  48955. hash: "",
  48956. ambient: [0, 0, 0],
  48957. directional: [],
  48958. directionalShadowMap: [],
  48959. directionalShadowMatrix: [],
  48960. spot: [],
  48961. spotShadowMap: [],
  48962. spotShadowMatrix: [],
  48963. point: [],
  48964. pointShadowMap: [],
  48965. pointShadowMatrix: [],
  48966. hemi: [],
  48967. shadows: [],
  48968. shadowsPointLight: 0
  48969. }, ye = {
  48970. geometries: 0,
  48971. textures: 0
  48972. }, Ae = {
  48973. calls: 0,
  48974. vertices: 0,
  48975. faces: 0,
  48976. points: 0
  48977. };
  48978. this.info = {
  48979. render: Ae,
  48980. memory: ye,
  48981. programs: null
  48982. };
  48983. try {
  48984. var Ce = {
  48985. alpha: D,
  48986. depth: N,
  48987. stencil: F,
  48988. antialias: B,
  48989. premultipliedAlpha: V,
  48990. preserveDrawingBuffer: k
  48991. };
  48992. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48993. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48994. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48995. return {
  48996. rangeMin: 1,
  48997. rangeMax: 1,
  48998. precision: 1
  48999. }
  49000. }
  49001. ),
  49002. O.addEventListener("webglcontextlost", r, !1)
  49003. } catch (e) {
  49004. console.error("THREE.WebGLRenderer: " + e)
  49005. }
  49006. var Ie = new Ci.WebGLExtensions(X);
  49007. Ie.get("OES_texture_float"),
  49008. Ie.get("OES_texture_float_linear"),
  49009. Ie.get("OES_texture_half_float"),
  49010. Ie.get("OES_texture_half_float_linear"),
  49011. Ie.get("OES_standard_derivatives"),
  49012. Ie.get("ANGLE_instanced_arrays"),
  49013. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49014. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49015. , _e = new Ci.WebGLState(X,Ie,x)
  49016. , be = new Ci.WebGLProperties
  49017. , we = new Ci.WebGLObjects(X,be,this.info)
  49018. , Te = new Ci.WebGLPrograms(this,Ee)
  49019. , xe = new Ci.WebGLLights;
  49020. this.info.programs = Te.programs;
  49021. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49022. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49023. t(),
  49024. this.context = X,
  49025. this.capabilities = Ee,
  49026. this.extensions = Ie,
  49027. this.properties = be,
  49028. this.state = _e;
  49029. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49030. this.shadowMap = Re;
  49031. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49032. this.getContext = function() {
  49033. return X
  49034. }
  49035. ,
  49036. this.getContextAttributes = function() {
  49037. return X.getContextAttributes()
  49038. }
  49039. ,
  49040. this.forceContextLoss = function() {
  49041. Ie.get("WEBGL_lose_context").loseContext()
  49042. }
  49043. ,
  49044. this.getMaxAnisotropy = function() {
  49045. if (void 0 !== Pe)
  49046. return Pe;
  49047. var e = Ie.get("EXT_texture_filter_anisotropic");
  49048. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49049. }
  49050. ,
  49051. this.getPrecision = function() {
  49052. return Ee.precision
  49053. }
  49054. ,
  49055. this.getPixelRatio = function() {
  49056. return he
  49057. }
  49058. ,
  49059. this.setPixelRatio = function(e) {
  49060. void 0 !== e && (he = e,
  49061. this.setSize(pe.z, pe.w, !1))
  49062. }
  49063. ,
  49064. this.getSize = function() {
  49065. return {
  49066. width: le,
  49067. height: ce
  49068. }
  49069. }
  49070. ,
  49071. this.setSize = function(e, t, i, n) {
  49072. null != n && (he = n),
  49073. le = e,
  49074. ce = t,
  49075. O.width = e * he,
  49076. O.height = t * he,
  49077. !1 !== i && (O.style.width = e + "px",
  49078. O.style.height = t + "px"),
  49079. this.setViewport(0, 0, e, t)
  49080. }
  49081. ,
  49082. this.setViewport = function(e, t, i, n) {
  49083. _e.viewport(pe.set(e, t, i, n))
  49084. }
  49085. ,
  49086. this.setScissor = function(e, t, i, n) {
  49087. _e.scissor(ue.set(e, t, i, n))
  49088. }
  49089. ,
  49090. this.setScissorTest = function(e) {
  49091. _e.setScissorTest(de = e)
  49092. }
  49093. ,
  49094. this.getClearColor = function() {
  49095. return ae
  49096. }
  49097. ,
  49098. this.setClearColor = function(e, t) {
  49099. ae.set(e),
  49100. se = void 0 !== t ? t : 1,
  49101. i(ae.r, ae.g, ae.b, se)
  49102. }
  49103. ,
  49104. this.getClearAlpha = function() {
  49105. return se
  49106. }
  49107. ,
  49108. this.setClearAlpha = function(e) {
  49109. se = e,
  49110. i(ae.r, ae.g, ae.b, se)
  49111. }
  49112. ,
  49113. this.clear = function(e, t, i) {
  49114. var n = 0;
  49115. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49116. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49117. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49118. X.clear(n)
  49119. }
  49120. ,
  49121. this.clearColor = function() {
  49122. this.clear(!0, !1, !1)
  49123. }
  49124. ,
  49125. this.clearDepth = function() {
  49126. this.clear(!1, !0, !1)
  49127. }
  49128. ,
  49129. this.clearStencil = function() {
  49130. this.clear(!1, !1, !0)
  49131. }
  49132. ,
  49133. this.clearTarget = function(e, t, i, n) {
  49134. this.setRenderTarget(e),
  49135. this.clear(t, i, n)
  49136. }
  49137. ,
  49138. this.resetGLState = n,
  49139. this.dispose = function() {
  49140. O.removeEventListener("webglcontextlost", r, !1)
  49141. }
  49142. ,
  49143. this.renderBufferImmediate = function(e, t, i) {
  49144. _e.initAttributes();
  49145. var n = be.get(e);
  49146. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49147. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49148. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49149. e.hasColors && !n.color && (n.color = X.createBuffer());
  49150. var r = t.getAttributes();
  49151. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49152. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49153. _e.enableAttribute(r.position),
  49154. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49155. e.hasNormals) {
  49156. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49157. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49158. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49159. var s = e.normalArray
  49160. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49161. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49162. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49163. s[o + 0] = l,
  49164. s[o + 1] = c,
  49165. s[o + 2] = h,
  49166. s[o + 3] = l,
  49167. s[o + 4] = c,
  49168. s[o + 5] = h,
  49169. s[o + 6] = l,
  49170. s[o + 7] = c,
  49171. s[o + 8] = h
  49172. }
  49173. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49174. _e.enableAttribute(r.normal),
  49175. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49176. }
  49177. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49178. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49179. _e.enableAttribute(r.uv),
  49180. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49181. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49182. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49183. _e.enableAttribute(r.color),
  49184. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49185. _e.disableUnusedAttributes(),
  49186. X.drawArrays(X.TRIANGLES, 0, e.count),
  49187. e.count = 0
  49188. }
  49189. ,
  49190. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49191. R(n);
  49192. var a = P(e, t, n, r)
  49193. , s = !1
  49194. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49195. l !== ee && (ee = l,
  49196. s = !0);
  49197. var c = r.morphTargetInfluences;
  49198. if (void 0 !== c) {
  49199. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49200. var p = c[u];
  49201. h.push([p, u])
  49202. }
  49203. h.sort(M),
  49204. 8 < h.length && (h.length = 8);
  49205. var f = i.morphAttributes;
  49206. for (u = 0,
  49207. d = h.length; u < d; u++) {
  49208. p = h[u];
  49209. if (j[u] = p[0],
  49210. 0 !== p[0]) {
  49211. var g = p[1];
  49212. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49213. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49214. } else
  49215. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49216. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49217. }
  49218. var m = a.getUniforms();
  49219. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49220. s = !0
  49221. }
  49222. g = i.index;
  49223. var v, y = i.attributes.position;
  49224. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49225. null !== g ? (v = Me).setIndex(g) : v = Se,
  49226. s && (function(e, t, i, n) {
  49227. var r;
  49228. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49229. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49230. else {
  49231. void 0 === n && (n = 0),
  49232. _e.initAttributes();
  49233. var o = i.attributes
  49234. , a = t.getAttributes()
  49235. , s = e.defaultAttributeValues;
  49236. for (var l in a) {
  49237. var c = a[l];
  49238. if (0 <= c) {
  49239. var h = o[l];
  49240. if (void 0 !== h) {
  49241. var u = h.itemSize
  49242. , d = we.getAttributeBuffer(h);
  49243. if (h instanceof Ci.InterleavedBufferAttribute) {
  49244. var p = h.data
  49245. , f = p.stride
  49246. , g = h.offset;
  49247. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49248. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49249. X.bindBuffer(X.ARRAY_BUFFER, d),
  49250. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49251. } else
  49252. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49253. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49254. X.bindBuffer(X.ARRAY_BUFFER, d),
  49255. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49256. } else if (void 0 !== s) {
  49257. var m = s[l];
  49258. if (void 0 !== m)
  49259. switch (m.length) {
  49260. case 2:
  49261. X.vertexAttrib2fv(c, m);
  49262. break;
  49263. case 3:
  49264. X.vertexAttrib3fv(c, m);
  49265. break;
  49266. case 4:
  49267. X.vertexAttrib4fv(c, m);
  49268. break;
  49269. default:
  49270. X.vertexAttrib1fv(c, m)
  49271. }
  49272. }
  49273. }
  49274. }
  49275. _e.disableUnusedAttributes()
  49276. }
  49277. }(n, a, i),
  49278. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49279. var A = 1 / 0;
  49280. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49281. var C = i.drawRange.start
  49282. , I = i.drawRange.count
  49283. , E = null !== o ? o.start : 0
  49284. , _ = null !== o ? o.count : 1 / 0
  49285. , b = Math.max(0, C, E)
  49286. , w = Math.min(0 + A, C + I, E + _) - 1
  49287. , T = Math.max(0, w - b + 1);
  49288. if (r instanceof Ci.Mesh)
  49289. if (!0 === n.wireframe)
  49290. _e.setLineWidth(n.wireframeLinewidth * S()),
  49291. v.setMode(X.LINES);
  49292. else
  49293. switch (r.drawMode) {
  49294. case Ci.TrianglesDrawMode:
  49295. v.setMode(X.TRIANGLES);
  49296. break;
  49297. case Ci.TriangleStripDrawMode:
  49298. v.setMode(X.TRIANGLE_STRIP);
  49299. break;
  49300. case Ci.TriangleFanDrawMode:
  49301. v.setMode(X.TRIANGLE_FAN)
  49302. }
  49303. else if (r instanceof Ci.Line) {
  49304. var x = n.linewidth;
  49305. void 0 === x && (x = 1),
  49306. _e.setLineWidth(x * S()),
  49307. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49308. } else
  49309. r instanceof Ci.Points && v.setMode(X.POINTS);
  49310. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49311. }
  49312. ,
  49313. this.render = function(e, t, i, n) {
  49314. if (t instanceof Ci.Camera != 0) {
  49315. var r = e.fog;
  49316. if (ee = "",
  49317. $ = -1,
  49318. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49319. null === t.parent && t.updateMatrixWorld(),
  49320. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49321. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49322. fe.setFromMatrix(ge),
  49323. U.length = 0,
  49324. W = z = -1,
  49325. Y.length = 0,
  49326. q.length = 0,
  49327. function e(t, i) {
  49328. if (!1 !== t.visible) {
  49329. if (t.layers.test(i.layers))
  49330. if (t instanceof Ci.Light)
  49331. U.push(t);
  49332. else if (t instanceof Ci.Sprite)
  49333. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49334. else if (t instanceof Ci.LensFlare)
  49335. q.push(t);
  49336. else if (t instanceof Ci.ImmediateRenderObject)
  49337. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49338. me.applyProjection(ge)),
  49339. d(t, null, t.material, me.z, null);
  49340. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49341. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49342. var n = t.material;
  49343. if (!0 === n.visible) {
  49344. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49345. me.applyProjection(ge));
  49346. var r = we.update(t);
  49347. if (n instanceof Ci.MultiMaterial)
  49348. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49349. var c = o[s]
  49350. , h = a[c.materialIndex];
  49351. !0 === h.visible && d(t, r, h, me.z, c)
  49352. }
  49353. else
  49354. d(t, r, n, me.z, null)
  49355. }
  49356. }
  49357. var u = t.children;
  49358. for (s = 0,
  49359. l = u.length; s < l; s++)
  49360. e(u[s], i)
  49361. }
  49362. }(e, t),
  49363. H.length = z + 1,
  49364. G.length = W + 1,
  49365. !0 === Z.sortObjects && (H.sort(s),
  49366. G.sort(l)),
  49367. function(e, t) {
  49368. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49369. for (i = ve.shadowsPointLight = 0,
  49370. n = e.length; i < n; i++)
  49371. if (o = (r = e[i]).color,
  49372. a = r.intensity,
  49373. s = r.distance,
  49374. r instanceof Ci.AmbientLight)
  49375. l += o.r * a,
  49376. c += o.g * a,
  49377. h += o.b * a;
  49378. else if (r instanceof Ci.DirectionalLight) {
  49379. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49380. v.direction.setFromMatrixPosition(r.matrixWorld),
  49381. me.setFromMatrixPosition(r.target.matrixWorld),
  49382. v.direction.sub(me),
  49383. v.direction.transformDirection(u),
  49384. v.shadow = r.castShadow,
  49385. r.castShadow && (v.shadowBias = r.shadow.bias,
  49386. v.shadowRadius = r.shadow.radius,
  49387. v.shadowMapSize = r.shadow.mapSize,
  49388. ve.shadows[m++] = r),
  49389. ve.directionalShadowMap[d] = r.shadow.map,
  49390. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49391. ve.directional[d++] = v
  49392. } else if (r instanceof Ci.SpotLight) {
  49393. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49394. v.position.applyMatrix4(u),
  49395. v.color.copy(o).multiplyScalar(a),
  49396. v.distance = s,
  49397. v.direction.setFromMatrixPosition(r.matrixWorld),
  49398. me.setFromMatrixPosition(r.target.matrixWorld),
  49399. v.direction.sub(me),
  49400. v.direction.transformDirection(u),
  49401. v.coneCos = Math.cos(r.angle),
  49402. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49403. v.decay = 0 === r.distance ? 0 : r.decay,
  49404. v.shadow = r.castShadow,
  49405. r.castShadow && (v.shadowBias = r.shadow.bias,
  49406. v.shadowRadius = r.shadow.radius,
  49407. v.shadowMapSize = r.shadow.mapSize,
  49408. ve.shadows[m++] = r),
  49409. ve.spotShadowMap[f] = r.shadow.map,
  49410. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49411. ve.spot[f++] = v
  49412. } else if (r instanceof Ci.PointLight) {
  49413. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49414. v.position.applyMatrix4(u),
  49415. v.color.copy(r.color).multiplyScalar(r.intensity),
  49416. v.distance = r.distance,
  49417. v.decay = 0 === r.distance ? 0 : r.decay,
  49418. v.shadow = r.castShadow,
  49419. r.castShadow && (v.shadowBias = r.shadow.bias,
  49420. v.shadowRadius = r.shadow.radius,
  49421. v.shadowMapSize = r.shadow.mapSize,
  49422. ve.shadows[m++] = r),
  49423. ve.pointShadowMap[p] = r.shadow.map,
  49424. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49425. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49426. ve.pointShadowMatrix[p].identity().setPosition(me),
  49427. ve.point[p++] = v
  49428. } else if (r instanceof Ci.HemisphereLight) {
  49429. var v;
  49430. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49431. v.direction.transformDirection(u),
  49432. v.direction.normalize(),
  49433. v.skyColor.copy(r.color).multiplyScalar(a),
  49434. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49435. ve.hemi[g++] = v
  49436. }
  49437. ve.ambient[0] = l,
  49438. ve.ambient[1] = c,
  49439. ve.ambient[2] = h,
  49440. ve.directional.length = d,
  49441. ve.spot.length = f,
  49442. ve.point.length = p,
  49443. ve.hemi.length = g,
  49444. ve.shadows.length = m,
  49445. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49446. }(U, t),
  49447. Re.render(e, t),
  49448. Ae.calls = 0,
  49449. Ae.vertices = 0,
  49450. Ae.faces = 0,
  49451. void (Ae.points = 0) === i && (i = null),
  49452. this.setRenderTarget(i),
  49453. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49454. e.overrideMaterial) {
  49455. var o = e.overrideMaterial;
  49456. c(H, t, r, o),
  49457. c(G, t, r, o)
  49458. } else
  49459. _e.setBlending(Ci.NoBlending),
  49460. c(H, t, r),
  49461. c(G, t, r);
  49462. if (Oe.render(e, t),
  49463. Le.render(e, t, re),
  49464. i) {
  49465. var a = i.texture;
  49466. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49467. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49468. , i = be.get(e.texture).__webglTexture;
  49469. _e.bindTexture(t, i),
  49470. X.generateMipmap(t),
  49471. _e.bindTexture(t, null)
  49472. }(i)
  49473. }
  49474. _e.setDepthTest(!0),
  49475. _e.setDepthWrite(!0),
  49476. _e.setColorWrite(!0)
  49477. } else
  49478. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49479. }
  49480. ,
  49481. this.setFaceCulling = function(e, t) {
  49482. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49483. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49484. _e.enable(X.CULL_FACE))
  49485. }
  49486. ,
  49487. this.setTexture = function(e, t) {
  49488. var i = be.get(e);
  49489. if (0 < e.version && i.__version !== e.version) {
  49490. var n = e.image;
  49491. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  49492. }
  49493. _e.activeTexture(X.TEXTURE0 + t),
  49494. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49495. }
  49496. ,
  49497. this.getCurrentRenderTarget = function() {
  49498. return Q
  49499. }
  49500. ,
  49501. this.setRenderTarget = function(e) {
  49502. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49503. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49504. if (e) {
  49505. var n = be.get(e);
  49506. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49507. ie.copy(e.scissor),
  49508. ne = e.scissorTest,
  49509. re.copy(e.viewport)
  49510. } else
  49511. t = null,
  49512. ie.copy(ue).multiplyScalar(he),
  49513. ne = de,
  49514. re.copy(pe).multiplyScalar(he);
  49515. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49516. J = t),
  49517. _e.scissor(ie),
  49518. _e.setScissorTest(ne),
  49519. _e.viewport(re),
  49520. i) {
  49521. var r = be.get(e.texture);
  49522. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49523. }
  49524. }
  49525. ,
  49526. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49527. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49528. var a = be.get(e).__webglFramebuffer;
  49529. if (a) {
  49530. var s = !1;
  49531. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49532. s = !0);
  49533. try {
  49534. var l = e.texture;
  49535. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49536. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49537. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  49538. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49539. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49540. } finally {
  49541. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49542. }
  49543. }
  49544. } else
  49545. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49546. }
  49547. }
  49548. ,
  49549. Ci.WebGLRenderTarget = function(e, t, i) {
  49550. this.uuid = Ci.Math.generateUUID(),
  49551. this.width = e,
  49552. this.height = t,
  49553. this.scissor = new Ci.Vector4(0,0,e,t),
  49554. this.scissorTest = !1,
  49555. this.viewport = new Ci.Vector4(0,0,e,t),
  49556. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49557. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49558. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49559. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49560. }
  49561. ,
  49562. Ci.WebGLRenderTarget.prototype = {
  49563. constructor: Ci.WebGLRenderTarget,
  49564. setSize: function(e, t) {
  49565. this.width === e && this.height === t || (this.width = e,
  49566. this.height = t,
  49567. this.dispose()),
  49568. this.viewport.set(0, 0, e, t),
  49569. this.scissor.set(0, 0, e, t)
  49570. },
  49571. clone: function() {
  49572. return (new this.constructor).copy(this)
  49573. },
  49574. copy: function(e) {
  49575. return this.width = e.width,
  49576. this.height = e.height,
  49577. this.viewport.copy(e.viewport),
  49578. this.texture = e.texture.clone(),
  49579. this.depthBuffer = e.depthBuffer,
  49580. this.stencilBuffer = e.stencilBuffer,
  49581. this
  49582. },
  49583. dispose: function() {
  49584. this.dispatchEvent({
  49585. type: "dispose"
  49586. })
  49587. }
  49588. },
  49589. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49590. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49591. Ci.WebGLRenderTarget.call(this, e, t, i),
  49592. this.activeCubeFace = 0,
  49593. this.activeMipMapLevel = 0
  49594. }
  49595. ,
  49596. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49597. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49598. Ci.WebGLBufferRenderer = function(r, o, a) {
  49599. var s;
  49600. this.setMode = function(e) {
  49601. s = e
  49602. }
  49603. ,
  49604. this.render = function(e, t) {
  49605. r.drawArrays(s, e, t),
  49606. a.calls++,
  49607. a.vertices += t,
  49608. s === r.TRIANGLES && (a.faces += t / 3)
  49609. }
  49610. ,
  49611. this.renderInstances = function(e) {
  49612. var t = o.get("ANGLE_instanced_arrays");
  49613. if (null !== t) {
  49614. var i = e.attributes.position
  49615. , n = 0;
  49616. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49617. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49618. a.calls++,
  49619. a.vertices += n * e.maxInstancedCount,
  49620. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49621. } else
  49622. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49623. }
  49624. }
  49625. ,
  49626. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49627. var s, l, c;
  49628. this.setMode = function(e) {
  49629. s = e
  49630. }
  49631. ,
  49632. this.setIndex = function(e) {
  49633. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49634. 4) : (l = r.UNSIGNED_SHORT,
  49635. 2)
  49636. }
  49637. ,
  49638. this.render = function(e, t) {
  49639. r.drawElements(s, t, l, e * c),
  49640. a.calls++,
  49641. a.vertices += t,
  49642. s === r.TRIANGLES && (a.faces += t / 3)
  49643. }
  49644. ,
  49645. this.renderInstances = function(e, t, i) {
  49646. var n = o.get("ANGLE_instanced_arrays");
  49647. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  49648. a.calls++,
  49649. a.vertices += i * e.maxInstancedCount,
  49650. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49651. }
  49652. }
  49653. ,
  49654. Ci.WebGLExtensions = function(i) {
  49655. var n = {};
  49656. this.get = function(e) {
  49657. if (void 0 !== n[e])
  49658. return n[e];
  49659. var t;
  49660. switch (e) {
  49661. case "EXT_texture_filter_anisotropic":
  49662. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49663. break;
  49664. case "WEBGL_compressed_texture_s3tc":
  49665. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49666. break;
  49667. case "WEBGL_compressed_texture_pvrtc":
  49668. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49669. break;
  49670. case "WEBGL_compressed_texture_etc1":
  49671. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49672. break;
  49673. default:
  49674. t = i.getExtension(e)
  49675. }
  49676. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49677. n[e] = t
  49678. }
  49679. }
  49680. ,
  49681. Ci.WebGLCapabilities = function(t, e, i) {
  49682. function n(e) {
  49683. if ("highp" === e) {
  49684. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49685. return "highp";
  49686. e = "mediump"
  49687. }
  49688. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  49689. }
  49690. this.getMaxPrecision = n,
  49691. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49692. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49693. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49694. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49695. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49696. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49697. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49698. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49699. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49700. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49701. this.vertexTextures = 0 < this.maxVertexTextures,
  49702. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49703. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49704. var r = n(this.precision);
  49705. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49706. this.precision = r),
  49707. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49708. }
  49709. ,
  49710. Ci.WebGLGeometries = function(i, o, a) {
  49711. function s(e) {
  49712. var t = e.target
  49713. , i = c[t.id];
  49714. null !== i.index && l(i.index),
  49715. function(e) {
  49716. for (var t in e)
  49717. l(e[t])
  49718. }(i.attributes),
  49719. t.removeEventListener("dispose", s),
  49720. delete c[t.id];
  49721. var n = o.get(t);
  49722. n.wireframe && l(n.wireframe),
  49723. o.delete(t);
  49724. var r = o.get(i);
  49725. r.wireframe && l(r.wireframe),
  49726. o.delete(i),
  49727. a.memory.geometries--
  49728. }
  49729. function l(e) {
  49730. var t = function(e) {
  49731. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49732. }(e);
  49733. void 0 !== t && (i.deleteBuffer(t),
  49734. function(e) {
  49735. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49736. }(e))
  49737. }
  49738. var c = {};
  49739. this.get = function(e) {
  49740. var t, i = e.geometry;
  49741. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49742. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49743. t = i._bufferGeometry),
  49744. c[i.id] = t,
  49745. a.memory.geometries++,
  49746. t)
  49747. }
  49748. }
  49749. ,
  49750. Ci.WebGLLights = function() {
  49751. var i = {};
  49752. this.get = function(e) {
  49753. if (void 0 !== i[e.id])
  49754. return i[e.id];
  49755. var t;
  49756. switch (e.type) {
  49757. case "DirectionalLight":
  49758. t = {
  49759. direction: new Ci.Vector3,
  49760. color: new Ci.Color,
  49761. shadow: !1,
  49762. shadowBias: 0,
  49763. shadowRadius: 1,
  49764. shadowMapSize: new Ci.Vector2
  49765. };
  49766. break;
  49767. case "SpotLight":
  49768. t = {
  49769. position: new Ci.Vector3,
  49770. direction: new Ci.Vector3,
  49771. color: new Ci.Color,
  49772. distance: 0,
  49773. coneCos: 0,
  49774. penumbraCos: 0,
  49775. decay: 0,
  49776. shadow: !1,
  49777. shadowBias: 0,
  49778. shadowRadius: 1,
  49779. shadowMapSize: new Ci.Vector2
  49780. };
  49781. break;
  49782. case "PointLight":
  49783. t = {
  49784. position: new Ci.Vector3,
  49785. color: new Ci.Color,
  49786. distance: 0,
  49787. decay: 0,
  49788. shadow: !1,
  49789. shadowBias: 0,
  49790. shadowRadius: 1,
  49791. shadowMapSize: new Ci.Vector2
  49792. };
  49793. break;
  49794. case "HemisphereLight":
  49795. t = {
  49796. direction: new Ci.Vector3,
  49797. skyColor: new Ci.Color,
  49798. groundColor: new Ci.Color
  49799. }
  49800. }
  49801. return i[e.id] = t
  49802. }
  49803. }
  49804. ,
  49805. Ci.WebGLObjects = function(g, m, e) {
  49806. function v(e, t) {
  49807. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49808. , n = m.get(i);
  49809. void 0 === n.__webglBuffer ? function(e, t, i) {
  49810. e.__webglBuffer = g.createBuffer(),
  49811. g.bindBuffer(i, e.__webglBuffer);
  49812. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49813. g.bufferData(i, t.array, n),
  49814. e.version = t.version
  49815. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49816. g.bindBuffer(i, e.__webglBuffer),
  49817. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  49818. t.updateRange.count = 0),
  49819. e.version = t.version
  49820. }(n, i, t)
  49821. }
  49822. function y(e, t, i) {
  49823. if (i < t) {
  49824. var n = t;
  49825. t = i,
  49826. i = n
  49827. }
  49828. var r = e[t];
  49829. return void 0 === r ? (e[t] = [i],
  49830. !0) : -1 === r.indexOf(i) && (r.push(i),
  49831. !0)
  49832. }
  49833. var c = new Ci.WebGLGeometries(g,m,e);
  49834. this.getAttributeBuffer = function(e) {
  49835. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49836. }
  49837. ,
  49838. this.getWireframeAttribute = function(e) {
  49839. var t = m.get(e);
  49840. if (void 0 !== t.wireframe)
  49841. return t.wireframe;
  49842. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49843. if (null !== r)
  49844. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49845. var h = i[l + 0]
  49846. , u = i[l + 1]
  49847. , d = i[l + 2];
  49848. y(s, h, u) && n.push(h, u),
  49849. y(s, u, d) && n.push(u, d),
  49850. y(s, d, h) && n.push(d, h)
  49851. }
  49852. else
  49853. for (l = 0,
  49854. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49855. h = l + 0,
  49856. u = l + 1,
  49857. d = l + 2;
  49858. n.push(h, u, u, d, d, h)
  49859. }
  49860. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49861. , f = new Ci.BufferAttribute(new p(n),1);
  49862. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49863. t.wireframe = f
  49864. }
  49865. ,
  49866. this.update = function(e) {
  49867. var t = c.get(e);
  49868. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49869. var i = t.index
  49870. , n = t.attributes;
  49871. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49872. n)
  49873. v(n[r], g.ARRAY_BUFFER);
  49874. var o = t.morphAttributes;
  49875. for (var r in o)
  49876. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49877. v(a[s], g.ARRAY_BUFFER);
  49878. return t
  49879. }
  49880. }
  49881. ,
  49882. Ci.WebGLProgram = (Qt = 0,
  49883. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49884. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49885. ei = /^([\w\d_]+)\[0\]$/,
  49886. function(e, t, i, n) {
  49887. var r = e.context
  49888. , o = i.extensions
  49889. , a = i.defines
  49890. , s = i.__webglShader.vertexShader
  49891. , l = i.__webglShader.fragmentShader
  49892. , c = "SHADOWMAP_TYPE_BASIC";
  49893. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49894. var h = "ENVMAP_TYPE_CUBE"
  49895. , u = "ENVMAP_MODE_REFLECTION"
  49896. , d = "ENVMAP_BLENDING_MULTIPLY";
  49897. if (n.envMap) {
  49898. switch (i.envMap.mapping) {
  49899. case Ci.CubeReflectionMapping:
  49900. case Ci.CubeRefractionMapping:
  49901. h = "ENVMAP_TYPE_CUBE";
  49902. break;
  49903. case Ci.CubeUVReflectionMapping:
  49904. case Ci.CubeUVRefractionMapping:
  49905. h = "ENVMAP_TYPE_CUBE_UV";
  49906. break;
  49907. case Ci.EquirectangularReflectionMapping:
  49908. case Ci.EquirectangularRefractionMapping:
  49909. h = "ENVMAP_TYPE_EQUIREC";
  49910. break;
  49911. case Ci.SphericalReflectionMapping:
  49912. h = "ENVMAP_TYPE_SPHERE"
  49913. }
  49914. switch (i.envMap.mapping) {
  49915. case Ci.CubeRefractionMapping:
  49916. case Ci.EquirectangularRefractionMapping:
  49917. u = "ENVMAP_MODE_REFRACTION"
  49918. }
  49919. switch (i.combine) {
  49920. case Ci.MultiplyOperation:
  49921. d = "ENVMAP_BLENDING_MULTIPLY";
  49922. break;
  49923. case Ci.MixOperation:
  49924. d = "ENVMAP_BLENDING_MIX";
  49925. break;
  49926. case Ci.AddOperation:
  49927. d = "ENVMAP_BLENDING_ADD"
  49928. }
  49929. }
  49930. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49931. return [(e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(Pi).join("\n")
  49932. }(o, n, e.extensions), v = function(e) {
  49933. var t = [];
  49934. for (var i in e) {
  49935. var n = e[i];
  49936. !1 !== n && t.push("#define " + i + " " + n)
  49937. }
  49938. return t.join("\n")
  49939. }(a), y = r.createProgram();
  49940. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(Pi).join("\n"),
  49941. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  49942. var i;
  49943. switch (t) {
  49944. case Ci.LinearToneMapping:
  49945. i = "Linear";
  49946. break;
  49947. case Ci.ReinhardToneMapping:
  49948. i = "Reinhard";
  49949. break;
  49950. case Ci.Uncharted2ToneMapping:
  49951. i = "Uncharted2";
  49952. break;
  49953. case Ci.CineonToneMapping:
  49954. i = "OptimizedCineon";
  49955. break;
  49956. default:
  49957. throw new Error("unsupported toneMapping: " + t)
  49958. }
  49959. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49960. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  49961. var i = Mi(t);
  49962. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49963. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49964. s = Oi(s = Li(s), n),
  49965. l = Oi(l = Li(l), n),
  49966. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49967. l = Di(l));
  49968. var A = p + s
  49969. , C = f + l
  49970. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49971. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49972. r.attachShader(y, I),
  49973. r.attachShader(y, E),
  49974. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49975. r.linkProgram(y);
  49976. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49977. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49978. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  49979. M && (this.diagnostics = {
  49980. runnable: S,
  49981. material: i,
  49982. programLog: w,
  49983. vertexShader: {
  49984. log: T,
  49985. prefix: p
  49986. },
  49987. fragmentShader: {
  49988. log: x,
  49989. prefix: f
  49990. }
  49991. }),
  49992. r.deleteShader(I),
  49993. r.deleteShader(E),
  49994. this.getUniforms = function() {
  49995. return void 0 === _ && (_ = function(e, t) {
  49996. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49997. var o = e.getActiveUniform(t, r).name
  49998. , a = e.getUniformLocation(t, o)
  49999. , s = Jt.exec(o);
  50000. if (s) {
  50001. var l = s[1]
  50002. , c = s[2]
  50003. , h = i[l];
  50004. (h = h || (i[l] = {}))[c] = a
  50005. } else if (s = $t.exec(o)) {
  50006. var u = s[1]
  50007. , d = s[2]
  50008. , p = s[3]
  50009. , f = i[u]
  50010. , g = (f = f || (i[u] = []))[d];
  50011. (g = g || (f[d] = {}))[p] = a
  50012. } else
  50013. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50014. }
  50015. return i
  50016. }(r, y)),
  50017. _
  50018. }
  50019. ,
  50020. this.getAttributes = function() {
  50021. return void 0 === b && (b = function(e, t) {
  50022. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50023. var o = e.getActiveAttrib(t, r).name;
  50024. i[o] = e.getAttribLocation(t, o)
  50025. }
  50026. return i
  50027. }(r, y)),
  50028. b
  50029. }
  50030. ,
  50031. this.destroy = function() {
  50032. r.deleteProgram(y),
  50033. this.program = void 0
  50034. }
  50035. ,
  50036. Object.defineProperties(this, {
  50037. uniforms: {
  50038. get: function() {
  50039. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50040. this.getUniforms()
  50041. }
  50042. },
  50043. attributes: {
  50044. get: function() {
  50045. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50046. this.getAttributes()
  50047. }
  50048. }
  50049. }),
  50050. this.id = Qt++,
  50051. this.code = t,
  50052. this.usedTimes = 1,
  50053. this.program = y,
  50054. this.vertexShader = I,
  50055. this.fragmentShader = E,
  50056. this
  50057. }
  50058. ),
  50059. Ci.WebGLPrograms = function(s, l) {
  50060. function c(e, t) {
  50061. var i;
  50062. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50063. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50064. i
  50065. }
  50066. var h = []
  50067. , u = {
  50068. MeshDepthMaterial: "depth",
  50069. MeshNormalMaterial: "normal",
  50070. MeshBasicMaterial: "basic",
  50071. MeshLambertMaterial: "lambert",
  50072. MeshPhongMaterial: "phong",
  50073. MeshStandardMaterial: "standard",
  50074. LineBasicMaterial: "basic",
  50075. LineDashedMaterial: "dashed",
  50076. PointsMaterial: "points"
  50077. }
  50078. , a = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  50079. this.getParameters = function(e, t, i, n) {
  50080. var r = u[e.type]
  50081. , o = function(e) {
  50082. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50083. return 1024;
  50084. var t = l.maxVertexUniforms
  50085. , i = Math.floor((t - 20) / 4);
  50086. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  50087. i
  50088. }(n)
  50089. , a = s.getPrecision();
  50090. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50091. {
  50092. shaderID: r,
  50093. precision: a,
  50094. supportsVertexTextures: l.vertexTextures,
  50095. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50096. map: !!e.map,
  50097. mapEncoding: c(e.map, s.gammaInput),
  50098. envMap: !!e.envMap,
  50099. envMapMode: e.envMap && e.envMap.mapping,
  50100. envMapEncoding: c(e.envMap, s.gammaInput),
  50101. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50102. lightMap: !!e.lightMap,
  50103. aoMap: !!e.aoMap,
  50104. emissiveMap: !!e.emissiveMap,
  50105. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50106. bumpMap: !!e.bumpMap,
  50107. normalMap: !!e.normalMap,
  50108. displacementMap: !!e.displacementMap,
  50109. roughnessMap: !!e.roughnessMap,
  50110. metalnessMap: !!e.metalnessMap,
  50111. specularMap: !!e.specularMap,
  50112. alphaMap: !!e.alphaMap,
  50113. combine: e.combine,
  50114. vertexColors: e.vertexColors,
  50115. fog: i,
  50116. useFog: e.fog,
  50117. fogExp: i instanceof Ci.FogExp2,
  50118. flatShading: e.shading === Ci.FlatShading,
  50119. sizeAttenuation: e.sizeAttenuation,
  50120. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50121. skinning: e.skinning,
  50122. maxBones: o,
  50123. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50124. morphTargets: e.morphTargets,
  50125. morphNormals: e.morphNormals,
  50126. maxMorphTargets: s.maxMorphTargets,
  50127. maxMorphNormals: s.maxMorphNormals,
  50128. numDirLights: t.directional.length,
  50129. numPointLights: t.point.length,
  50130. numSpotLights: t.spot.length,
  50131. numHemiLights: t.hemi.length,
  50132. pointLightShadows: t.shadowsPointLight,
  50133. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50134. shadowMapType: s.shadowMap.type,
  50135. toneMapping: s.toneMapping,
  50136. physicallyCorrectLights: s.physicallyCorrectLights,
  50137. premultipliedAlpha: e.premultipliedAlpha,
  50138. alphaTest: e.alphaTest,
  50139. doubleSided: e.side === Ci.DoubleSide,
  50140. flipSided: e.side === Ci.BackSide
  50141. }
  50142. }
  50143. ,
  50144. this.getProgramCode = function(e, t) {
  50145. var i = [];
  50146. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50147. i.push(e.vertexShader)),
  50148. void 0 !== e.defines)
  50149. for (var n in e.defines)
  50150. i.push(n),
  50151. i.push(e.defines[n]);
  50152. for (var r = 0; r < a.length; r++) {
  50153. var o = a[r];
  50154. i.push(o),
  50155. i.push(t[o])
  50156. }
  50157. return i.join()
  50158. }
  50159. ,
  50160. this.acquireProgram = function(e, t, i) {
  50161. for (var n, r = 0, o = h.length; r < o; r++) {
  50162. var a = h[r];
  50163. if (a.code === i) {
  50164. ++(n = a).usedTimes;
  50165. break
  50166. }
  50167. }
  50168. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50169. h.push(n)),
  50170. n
  50171. }
  50172. ,
  50173. this.releaseProgram = function(e) {
  50174. if (0 == --e.usedTimes) {
  50175. var t = h.indexOf(e);
  50176. h[t] = h[h.length - 1],
  50177. h.pop(),
  50178. e.destroy()
  50179. }
  50180. }
  50181. ,
  50182. this.programs = h
  50183. }
  50184. ,
  50185. Ci.WebGLProperties = function() {
  50186. var n = {};
  50187. this.get = function(e) {
  50188. var t = e.uuid
  50189. , i = n[t];
  50190. return void 0 === i && (i = {},
  50191. n[t] = i),
  50192. i
  50193. }
  50194. ,
  50195. this.delete = function(e) {
  50196. delete n[e.uuid]
  50197. }
  50198. ,
  50199. this.clear = function() {
  50200. n = {}
  50201. }
  50202. }
  50203. ,
  50204. Ci.WebGLShader = function(e, t, i) {
  50205. var n = e.createShader(t);
  50206. return e.shaderSource(n, i),
  50207. e.compileShader(n),
  50208. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50209. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50210. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50211. t[i] = i + 1 + ": " + t[i];
  50212. return t.join("\n")
  50213. }(i)),
  50214. n
  50215. }
  50216. ,
  50217. Ci.WebGLShadowMap = function(P, O, L) {
  50218. function D(e, t, i, n) {
  50219. var r = e.geometry
  50220. , o = null
  50221. , a = p
  50222. , s = e.customDepthMaterial;
  50223. if (i && (a = f,
  50224. s = e.customDistanceMaterial),
  50225. s)
  50226. o = s;
  50227. else {
  50228. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50229. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50230. , h = 0;
  50231. l && (h |= u),
  50232. c && (h |= d),
  50233. o = a[h]
  50234. }
  50235. return o.visible = t.visible,
  50236. o.wireframe = t.wireframe,
  50237. o.wireframeLinewidth = t.wireframeLinewidth,
  50238. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50239. o
  50240. }
  50241. function N(e, t, i) {
  50242. if (!1 !== e.visible) {
  50243. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  50244. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50245. G.push(e));
  50246. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50247. N(n[r], t, i)
  50248. }
  50249. }
  50250. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  50251. var a = 0 != (o & u)
  50252. , s = 0 != (o & d)
  50253. , l = new Ci.ShaderMaterial({
  50254. uniforms: i,
  50255. vertexShader: t.vertexShader,
  50256. fragmentShader: t.fragmentShader,
  50257. morphTargets: a,
  50258. skinning: s
  50259. });
  50260. p[o] = l;
  50261. var c = new Ci.ShaderMaterial({
  50262. defines: {
  50263. USE_SHADOWMAP: ""
  50264. },
  50265. uniforms: r,
  50266. vertexShader: n.vertexShader,
  50267. fragmentShader: n.fragmentShader,
  50268. morphTargets: a,
  50269. skinning: s
  50270. });
  50271. f[o] = c
  50272. }
  50273. var q = this;
  50274. this.enabled = !1,
  50275. this.autoUpdate = !0,
  50276. this.needsUpdate = !1,
  50277. this.type = Ci.PCFShadowMap,
  50278. this.cullFace = Ci.CullFaceFront,
  50279. this.render = function(e, t) {
  50280. var i, n, r = O.shadows;
  50281. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50282. B.clearColor(1, 1, 1, 1),
  50283. B.disable(F.BLEND),
  50284. B.enable(F.CULL_FACE),
  50285. F.frontFace(F.CCW),
  50286. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50287. B.setDepthTest(!0),
  50288. B.setScissorTest(!1);
  50289. for (var o = 0, a = r.length; o < a; o++) {
  50290. var s = r[o]
  50291. , l = s.shadow
  50292. , c = l.camera;
  50293. if (U.copy(l.mapSize),
  50294. s instanceof Ci.PointLight) {
  50295. i = 6,
  50296. n = !0;
  50297. var h = U.x
  50298. , u = U.y;
  50299. Y[0].set(2 * h, u, h, u),
  50300. Y[1].set(0, u, h, u),
  50301. Y[2].set(3 * h, u, h, u),
  50302. Y[3].set(h, u, h, u),
  50303. Y[4].set(3 * h, 0, h, u),
  50304. Y[5].set(h, 0, h, u),
  50305. U.x *= 4,
  50306. U.y *= 2
  50307. } else
  50308. n = !(i = 1);
  50309. if (null === l.map) {
  50310. var d = {
  50311. minFilter: Ci.NearestFilter,
  50312. magFilter: Ci.NearestFilter,
  50313. format: Ci.RGBAFormat
  50314. };
  50315. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50316. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50317. c.updateProjectionMatrix()
  50318. }
  50319. var p = l.map
  50320. , f = l.matrix;
  50321. z.setFromMatrixPosition(s.matrixWorld),
  50322. c.position.copy(z),
  50323. P.setRenderTarget(p),
  50324. P.clear();
  50325. for (var g = 0; g < i; g++) {
  50326. if (n) {
  50327. H.copy(c.position),
  50328. H.add(W[g]),
  50329. c.up.copy(j[g]),
  50330. c.lookAt(H);
  50331. var m = Y[g];
  50332. B.viewport(m)
  50333. } else
  50334. H.setFromMatrixPosition(s.target.matrixWorld),
  50335. c.lookAt(H);
  50336. c.updateMatrixWorld(),
  50337. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50338. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50339. f.multiply(c.projectionMatrix),
  50340. f.multiply(c.matrixWorldInverse),
  50341. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50342. V.setFromMatrix(k),
  50343. G.length = 0,
  50344. N(e, t, c);
  50345. for (var v = 0, y = G.length; v < y; v++) {
  50346. var A = G[v]
  50347. , C = L.update(A)
  50348. , I = A.material;
  50349. if (I instanceof Ci.MultiMaterial)
  50350. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50351. var T = E[b]
  50352. , x = _[T.materialIndex];
  50353. if (!0 === x.visible) {
  50354. var S = D(A, x, n, z);
  50355. P.renderBufferDirect(c, null, C, S, A, T)
  50356. }
  50357. }
  50358. else {
  50359. S = D(A, I, n, z);
  50360. P.renderBufferDirect(c, null, C, S, A, null)
  50361. }
  50362. }
  50363. }
  50364. }
  50365. var M = P.getClearColor()
  50366. , R = P.getClearAlpha();
  50367. P.setClearColor(M, R),
  50368. B.enable(F.BLEND),
  50369. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50370. q.needsUpdate = !1
  50371. }
  50372. }
  50373. }
  50374. ,
  50375. Ci.WebGLState = function(l, i, c) {
  50376. var n = this
  50377. , r = new Ci.Vector4
  50378. , o = new Uint8Array(16)
  50379. , a = new Uint8Array(16)
  50380. , s = new Uint8Array(16)
  50381. , t = {}
  50382. , h = null
  50383. , u = null
  50384. , d = null
  50385. , p = null
  50386. , f = null
  50387. , g = null
  50388. , m = null
  50389. , v = null
  50390. , y = !1
  50391. , A = null
  50392. , C = null
  50393. , I = null
  50394. , E = null
  50395. , _ = null
  50396. , b = null
  50397. , w = null
  50398. , T = null
  50399. , x = null
  50400. , S = null
  50401. , M = null
  50402. , R = null
  50403. , P = null
  50404. , O = null
  50405. , L = null
  50406. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50407. , N = void 0
  50408. , F = {}
  50409. , B = new Ci.Vector4
  50410. , V = null
  50411. , k = null
  50412. , U = new Ci.Vector4
  50413. , H = new Ci.Vector4
  50414. , z = l.createTexture();
  50415. l.bindTexture(l.TEXTURE_2D, z),
  50416. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50417. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50418. this.init = function() {
  50419. this.clearColor(0, 0, 0, 1),
  50420. this.clearDepth(1),
  50421. this.clearStencil(0),
  50422. this.enable(l.DEPTH_TEST),
  50423. l.depthFunc(l.LEQUAL),
  50424. l.frontFace(l.CCW),
  50425. l.cullFace(l.BACK),
  50426. this.enable(l.CULL_FACE),
  50427. this.enable(l.BLEND),
  50428. l.blendEquation(l.FUNC_ADD),
  50429. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50430. }
  50431. ,
  50432. this.initAttributes = function() {
  50433. for (var e = 0, t = o.length; e < t; e++)
  50434. o[e] = 0
  50435. }
  50436. ,
  50437. this.enableAttribute = function(e) {
  50438. o[e] = 1,
  50439. 0 === a[e] && (l.enableVertexAttribArray(e),
  50440. a[e] = 1),
  50441. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50442. s[e] = 0)
  50443. }
  50444. ,
  50445. this.enableAttributeAndDivisor = function(e, t, i) {
  50446. o[e] = 1,
  50447. 0 === a[e] && (l.enableVertexAttribArray(e),
  50448. a[e] = 1),
  50449. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50450. s[e] = t)
  50451. }
  50452. ,
  50453. this.disableUnusedAttributes = function() {
  50454. for (var e = 0, t = a.length; e < t; e++)
  50455. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50456. a[e] = 0)
  50457. }
  50458. ,
  50459. this.enable = function(e) {
  50460. !0 !== t[e] && (l.enable(e),
  50461. t[e] = !0)
  50462. }
  50463. ,
  50464. this.disable = function(e) {
  50465. !1 !== t[e] && (l.disable(e),
  50466. t[e] = !1)
  50467. }
  50468. ,
  50469. this.getCompressedTextureFormats = function() {
  50470. if (null === h && (h = [],
  50471. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50472. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50473. h.push(e[t]);
  50474. return h
  50475. }
  50476. ,
  50477. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50478. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50479. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50480. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50481. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50482. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50483. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50484. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50485. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50486. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50487. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50488. u = e,
  50489. y = s),
  50490. e === Ci.CustomBlending ? (r = r || t,
  50491. o = o || i,
  50492. a = a || n,
  50493. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50494. d = t,
  50495. g = r),
  50496. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50497. p = i,
  50498. f = n,
  50499. m = o,
  50500. v = a)) : v = m = g = f = p = d = null
  50501. }
  50502. ,
  50503. this.setDepthFunc = function(e) {
  50504. if (A !== e) {
  50505. if (e)
  50506. switch (e) {
  50507. case Ci.NeverDepth:
  50508. l.depthFunc(l.NEVER);
  50509. break;
  50510. case Ci.AlwaysDepth:
  50511. l.depthFunc(l.ALWAYS);
  50512. break;
  50513. case Ci.LessDepth:
  50514. l.depthFunc(l.LESS);
  50515. break;
  50516. case Ci.LessEqualDepth:
  50517. l.depthFunc(l.LEQUAL);
  50518. break;
  50519. case Ci.EqualDepth:
  50520. l.depthFunc(l.EQUAL);
  50521. break;
  50522. case Ci.GreaterEqualDepth:
  50523. l.depthFunc(l.GEQUAL);
  50524. break;
  50525. case Ci.GreaterDepth:
  50526. l.depthFunc(l.GREATER);
  50527. break;
  50528. case Ci.NotEqualDepth:
  50529. l.depthFunc(l.NOTEQUAL);
  50530. break;
  50531. default:
  50532. l.depthFunc(l.LEQUAL)
  50533. }
  50534. else
  50535. l.depthFunc(l.LEQUAL);
  50536. A = e
  50537. }
  50538. }
  50539. ,
  50540. this.setDepthTest = function(e) {
  50541. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50542. }
  50543. ,
  50544. this.setDepthWrite = function(e) {
  50545. C !== e && (l.depthMask(e),
  50546. C = e)
  50547. }
  50548. ,
  50549. this.setColorWrite = function(e) {
  50550. I !== e && (l.colorMask(e, e, e, e),
  50551. I = e)
  50552. }
  50553. ,
  50554. this.setStencilFunc = function(e, t, i) {
  50555. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50556. _ = e,
  50557. b = t,
  50558. w = i)
  50559. }
  50560. ,
  50561. this.setStencilOp = function(e, t, i) {
  50562. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50563. T = e,
  50564. x = t,
  50565. S = i)
  50566. }
  50567. ,
  50568. this.setStencilTest = function(e) {
  50569. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50570. }
  50571. ,
  50572. this.setStencilWrite = function(e) {
  50573. E !== e && (l.stencilMask(e),
  50574. E = e)
  50575. }
  50576. ,
  50577. this.setFlipSided = function(e) {
  50578. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50579. M = e)
  50580. }
  50581. ,
  50582. this.setLineWidth = function(e) {
  50583. e !== R && (l.lineWidth(e),
  50584. R = e)
  50585. }
  50586. ,
  50587. this.setPolygonOffset = function(e, t, i) {
  50588. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50589. !e || P === t && O === i || (l.polygonOffset(t, i),
  50590. P = t,
  50591. O = i)
  50592. }
  50593. ,
  50594. this.getScissorTest = function() {
  50595. return L
  50596. }
  50597. ,
  50598. this.setScissorTest = function(e) {
  50599. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50600. }
  50601. ,
  50602. this.activeTexture = function(e) {
  50603. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50604. N !== e && (l.activeTexture(e),
  50605. N = e)
  50606. }
  50607. ,
  50608. this.bindTexture = function(e, t) {
  50609. void 0 === N && n.activeTexture();
  50610. var i = F[N];
  50611. void 0 === i && (i = {
  50612. type: void 0,
  50613. texture: void 0
  50614. },
  50615. F[N] = i),
  50616. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50617. i.type = e,
  50618. i.texture = t)
  50619. }
  50620. ,
  50621. this.compressedTexImage2D = function() {
  50622. try {
  50623. l.compressedTexImage2D.apply(l, arguments)
  50624. } catch (e) {
  50625. console.error(e)
  50626. }
  50627. }
  50628. ,
  50629. this.texImage2D = function() {
  50630. try {
  50631. l.texImage2D.apply(l, arguments)
  50632. } catch (e) {
  50633. console.error(e)
  50634. }
  50635. }
  50636. ,
  50637. this.clearColor = function(e, t, i, n) {
  50638. r.set(e, t, i, n),
  50639. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50640. B.copy(r))
  50641. }
  50642. ,
  50643. this.clearDepth = function(e) {
  50644. V !== e && (l.clearDepth(e),
  50645. V = e)
  50646. }
  50647. ,
  50648. this.clearStencil = function(e) {
  50649. k !== e && (l.clearStencil(e),
  50650. k = e)
  50651. }
  50652. ,
  50653. this.scissor = function(e) {
  50654. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50655. U.copy(e))
  50656. }
  50657. ,
  50658. this.viewport = function(e) {
  50659. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50660. H.copy(e))
  50661. }
  50662. ,
  50663. this.reset = function() {
  50664. for (var e = 0; e < a.length; e++)
  50665. 1 === a[e] && (l.disableVertexAttribArray(e),
  50666. a[e] = 0);
  50667. t = {},
  50668. N = void 0,
  50669. F = {},
  50670. M = E = C = I = u = h = null
  50671. }
  50672. }
  50673. ,
  50674. Ci.LensFlarePlugin = function(v, y) {
  50675. function A() {
  50676. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50677. C = S.createBuffer(),
  50678. I = S.createBuffer(),
  50679. S.bindBuffer(S.ARRAY_BUFFER, C),
  50680. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50681. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50682. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50683. T = S.createTexture(),
  50684. x = S.createTexture(),
  50685. M.bindTexture(S.TEXTURE_2D, T),
  50686. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50687. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50688. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50689. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50690. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50691. M.bindTexture(S.TEXTURE_2D, x),
  50692. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50693. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50694. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50695. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50696. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50697. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50698. 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"),
  50699. 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")
  50700. } : {
  50701. 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"),
  50702. 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")
  50703. },
  50704. E = function(e) {
  50705. var t = S.createProgram()
  50706. , i = S.createShader(S.FRAGMENT_SHADER)
  50707. , n = S.createShader(S.VERTEX_SHADER)
  50708. , r = "precision " + v.getPrecision() + " float;\n";
  50709. return S.shaderSource(i, r + e.fragmentShader),
  50710. S.shaderSource(n, r + e.vertexShader),
  50711. S.compileShader(i),
  50712. S.compileShader(n),
  50713. S.attachShader(t, i),
  50714. S.attachShader(t, n),
  50715. S.linkProgram(t),
  50716. t
  50717. }(e),
  50718. _ = {
  50719. vertex: S.getAttribLocation(E, "position"),
  50720. uv: S.getAttribLocation(E, "uv")
  50721. },
  50722. b = {
  50723. renderType: S.getUniformLocation(E, "renderType"),
  50724. map: S.getUniformLocation(E, "map"),
  50725. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50726. opacity: S.getUniformLocation(E, "opacity"),
  50727. color: S.getUniformLocation(E, "color"),
  50728. scale: S.getUniformLocation(E, "scale"),
  50729. rotation: S.getUniformLocation(E, "rotation"),
  50730. screenPosition: S.getUniformLocation(E, "screenPosition")
  50731. }
  50732. }
  50733. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50734. this.render = function(e, t, i) {
  50735. if (0 !== y.length) {
  50736. var n = new Ci.Vector3
  50737. , r = i.w / i.z
  50738. , o = .5 * i.z
  50739. , a = .5 * i.w
  50740. , s = 16 / i.w
  50741. , l = new Ci.Vector2(s * r,s)
  50742. , c = new Ci.Vector3(1,1,0)
  50743. , h = new Ci.Vector2(1,1);
  50744. void 0 === E && A(),
  50745. S.useProgram(E),
  50746. M.initAttributes(),
  50747. M.enableAttribute(_.vertex),
  50748. M.enableAttribute(_.uv),
  50749. M.disableUnusedAttributes(),
  50750. S.uniform1i(b.occlusionMap, 0),
  50751. S.uniform1i(b.map, 1),
  50752. S.bindBuffer(S.ARRAY_BUFFER, C),
  50753. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50754. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50755. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50756. M.disable(S.CULL_FACE),
  50757. M.setDepthWrite(!1);
  50758. for (var u = 0, d = y.length; u < d; u++) {
  50759. s = 16 / i.w,
  50760. l.set(s * r, s);
  50761. var p = y[u];
  50762. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50763. n.applyMatrix4(t.matrixWorldInverse),
  50764. n.applyProjection(t.projectionMatrix),
  50765. c.copy(n),
  50766. h.x = c.x * o + o,
  50767. h.y = c.y * a + a,
  50768. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50769. M.activeTexture(S.TEXTURE0),
  50770. M.bindTexture(S.TEXTURE_2D, null),
  50771. M.activeTexture(S.TEXTURE1),
  50772. M.bindTexture(S.TEXTURE_2D, T),
  50773. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50774. S.uniform1i(b.renderType, 0),
  50775. S.uniform2f(b.scale, l.x, l.y),
  50776. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50777. M.disable(S.BLEND),
  50778. M.enable(S.DEPTH_TEST),
  50779. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50780. M.activeTexture(S.TEXTURE0),
  50781. M.bindTexture(S.TEXTURE_2D, x),
  50782. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50783. S.uniform1i(b.renderType, 1),
  50784. M.disable(S.DEPTH_TEST),
  50785. M.activeTexture(S.TEXTURE1),
  50786. M.bindTexture(S.TEXTURE_2D, T),
  50787. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50788. p.positionScreen.copy(c),
  50789. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50790. S.uniform1i(b.renderType, 2),
  50791. M.enable(S.BLEND);
  50792. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50793. var m = p.lensFlares[f];
  50794. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50795. c.y = m.y,
  50796. c.z = m.z,
  50797. s = m.size * m.scale / i.w,
  50798. l.x = s * r,
  50799. l.y = s,
  50800. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50801. S.uniform2f(b.scale, l.x, l.y),
  50802. S.uniform1f(b.rotation, m.rotation),
  50803. S.uniform1f(b.opacity, m.opacity),
  50804. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50805. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50806. v.setTexture(m.texture, 1),
  50807. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50808. }
  50809. }
  50810. }
  50811. M.enable(S.CULL_FACE),
  50812. M.enable(S.DEPTH_TEST),
  50813. M.setDepthWrite(!0),
  50814. v.resetGLState()
  50815. }
  50816. }
  50817. }
  50818. ,
  50819. Ci.SpritePlugin = function(u, d) {
  50820. function p() {
  50821. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50822. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50823. g = I.createBuffer(),
  50824. m = I.createBuffer(),
  50825. I.bindBuffer(I.ARRAY_BUFFER, g),
  50826. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50827. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50828. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50829. v = function() {
  50830. var e = I.createProgram()
  50831. , t = I.createShader(I.VERTEX_SHADER)
  50832. , i = I.createShader(I.FRAGMENT_SHADER);
  50833. return I.shaderSource(t, ["precision " + u.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  50834. I.shaderSource(i, ["precision " + u.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  50835. I.compileShader(t),
  50836. I.compileShader(i),
  50837. I.attachShader(e, t),
  50838. I.attachShader(e, i),
  50839. I.linkProgram(e),
  50840. e
  50841. }(),
  50842. y = {
  50843. position: I.getAttribLocation(v, "position"),
  50844. uv: I.getAttribLocation(v, "uv")
  50845. },
  50846. A = {
  50847. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50848. uvScale: I.getUniformLocation(v, "uvScale"),
  50849. rotation: I.getUniformLocation(v, "rotation"),
  50850. scale: I.getUniformLocation(v, "scale"),
  50851. color: I.getUniformLocation(v, "color"),
  50852. map: I.getUniformLocation(v, "map"),
  50853. opacity: I.getUniformLocation(v, "opacity"),
  50854. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50855. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50856. fogType: I.getUniformLocation(v, "fogType"),
  50857. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50858. fogNear: I.getUniformLocation(v, "fogNear"),
  50859. fogFar: I.getUniformLocation(v, "fogFar"),
  50860. fogColor: I.getUniformLocation(v, "fogColor"),
  50861. alphaTest: I.getUniformLocation(v, "alphaTest")
  50862. };
  50863. var i = document.createElement("canvas");
  50864. i.width = 8,
  50865. i.height = 8;
  50866. var n = i.getContext("2d");
  50867. n.fillStyle = "white",
  50868. n.fillRect(0, 0, 8, 8),
  50869. (C = new Ci.Texture(i)).needsUpdate = !0
  50870. }
  50871. function f(e, t) {
  50872. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50873. }
  50874. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50875. this.render = function(e, t) {
  50876. if (0 !== d.length) {
  50877. void 0 === v && p(),
  50878. I.useProgram(v),
  50879. E.initAttributes(),
  50880. E.enableAttribute(y.position),
  50881. E.enableAttribute(y.uv),
  50882. E.disableUnusedAttributes(),
  50883. E.disable(I.CULL_FACE),
  50884. E.enable(I.BLEND),
  50885. I.bindBuffer(I.ARRAY_BUFFER, g),
  50886. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50887. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50888. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50889. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50890. E.activeTexture(I.TEXTURE0),
  50891. I.uniform1i(A.map, 0);
  50892. var i = 0
  50893. , n = 0
  50894. , r = e.fog;
  50895. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50896. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50897. I.uniform1f(A.fogFar, r.far),
  50898. I.uniform1i(A.fogType, 1),
  50899. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50900. I.uniform1i(A.fogType, 2),
  50901. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50902. n = i = 0);
  50903. for (var o = 0, a = d.length; o < a; o++) {
  50904. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50905. l.z = -l.modelViewMatrix.elements[14]
  50906. }
  50907. d.sort(f);
  50908. var s = [];
  50909. for (o = 0,
  50910. a = d.length; o < a; o++) {
  50911. var l, c = (l = d[o]).material;
  50912. I.uniform1f(A.alphaTest, c.alphaTest),
  50913. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50914. l.matrixWorld.decompose(_, b, w),
  50915. s[0] = w.x,
  50916. s[1] = w.y;
  50917. var h = 0;
  50918. e.fog && c.fog && (h = n),
  50919. i !== h && (I.uniform1i(A.fogType, h),
  50920. i = h),
  50921. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50922. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50923. I.uniform2f(A.uvScale, 1, 1)),
  50924. I.uniform1f(A.opacity, c.opacity),
  50925. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50926. I.uniform1f(A.rotation, c.rotation),
  50927. I.uniform2fv(A.scale, s),
  50928. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50929. E.setDepthTest(c.depthTest),
  50930. E.setDepthWrite(c.depthWrite),
  50931. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50932. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50933. }
  50934. E.enable(I.CULL_FACE),
  50935. u.resetGLState()
  50936. }
  50937. }
  50938. }
  50939. ,
  50940. Object.defineProperties(Ci.Box2.prototype, {
  50941. empty: {
  50942. value: function() {
  50943. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50944. this.isEmpty()
  50945. }
  50946. },
  50947. isIntersectionBox: {
  50948. value: function(e) {
  50949. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50950. this.intersectsBox(e)
  50951. }
  50952. }
  50953. }),
  50954. Object.defineProperties(Ci.Box3.prototype, {
  50955. empty: {
  50956. value: function() {
  50957. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50958. this.isEmpty()
  50959. }
  50960. },
  50961. isIntersectionBox: {
  50962. value: function(e) {
  50963. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50964. this.intersectsBox(e)
  50965. }
  50966. },
  50967. isIntersectionSphere: {
  50968. value: function(e) {
  50969. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50970. this.intersectsSphere(e)
  50971. }
  50972. }
  50973. }),
  50974. Object.defineProperties(Ci.Matrix3.prototype, {
  50975. multiplyVector3: {
  50976. value: function(e) {
  50977. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50978. e.applyMatrix3(this)
  50979. }
  50980. },
  50981. multiplyVector3Array: {
  50982. value: function(e) {
  50983. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50984. this.applyToVector3Array(e)
  50985. }
  50986. }
  50987. }),
  50988. Object.defineProperties(Ci.Matrix4.prototype, {
  50989. extractPosition: {
  50990. value: function(e) {
  50991. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50992. this.copyPosition(e)
  50993. }
  50994. },
  50995. setRotationFromQuaternion: {
  50996. value: function(e) {
  50997. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50998. this.makeRotationFromQuaternion(e)
  50999. }
  51000. },
  51001. multiplyVector3: {
  51002. value: function(e) {
  51003. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51004. e.applyProjection(this)
  51005. }
  51006. },
  51007. multiplyVector4: {
  51008. value: function(e) {
  51009. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51010. e.applyMatrix4(this)
  51011. }
  51012. },
  51013. multiplyVector3Array: {
  51014. value: function(e) {
  51015. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51016. this.applyToVector3Array(e)
  51017. }
  51018. },
  51019. rotateAxis: {
  51020. value: function(e) {
  51021. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51022. e.transformDirection(this)
  51023. }
  51024. },
  51025. crossVector: {
  51026. value: function(e) {
  51027. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51028. e.applyMatrix4(this)
  51029. }
  51030. },
  51031. translate: {
  51032. value: function(e) {
  51033. console.error("THREE.Matrix4: .translate() has been removed.")
  51034. }
  51035. },
  51036. rotateX: {
  51037. value: function(e) {
  51038. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51039. }
  51040. },
  51041. rotateY: {
  51042. value: function(e) {
  51043. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51044. }
  51045. },
  51046. rotateZ: {
  51047. value: function(e) {
  51048. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51049. }
  51050. },
  51051. rotateByAxis: {
  51052. value: function(e, t) {
  51053. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51054. }
  51055. }
  51056. }),
  51057. Object.defineProperties(Ci.Plane.prototype, {
  51058. isIntersectionLine: {
  51059. value: function(e) {
  51060. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51061. this.intersectsLine(e)
  51062. }
  51063. }
  51064. }),
  51065. Object.defineProperties(Ci.Quaternion.prototype, {
  51066. multiplyVector3: {
  51067. value: function(e) {
  51068. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51069. e.applyQuaternion(this)
  51070. }
  51071. }
  51072. }),
  51073. Object.defineProperties(Ci.Ray.prototype, {
  51074. isIntersectionBox: {
  51075. value: function(e) {
  51076. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51077. this.intersectsBox(e)
  51078. }
  51079. },
  51080. isIntersectionPlane: {
  51081. value: function(e) {
  51082. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51083. this.intersectsPlane(e)
  51084. }
  51085. },
  51086. isIntersectionSphere: {
  51087. value: function(e) {
  51088. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51089. this.intersectsSphere(e)
  51090. }
  51091. }
  51092. }),
  51093. Object.defineProperties(Ci.Vector3.prototype, {
  51094. setEulerFromRotationMatrix: {
  51095. value: function() {
  51096. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51097. }
  51098. },
  51099. setEulerFromQuaternion: {
  51100. value: function() {
  51101. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51102. }
  51103. },
  51104. getPositionFromMatrix: {
  51105. value: function(e) {
  51106. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51107. this.setFromMatrixPosition(e)
  51108. }
  51109. },
  51110. getScaleFromMatrix: {
  51111. value: function(e) {
  51112. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51113. this.setFromMatrixScale(e)
  51114. }
  51115. },
  51116. getColumnFromMatrix: {
  51117. value: function(e, t) {
  51118. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51119. this.setFromMatrixColumn(e, t)
  51120. }
  51121. }
  51122. }),
  51123. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51124. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51125. new Ci.Face3(e,t,i,r,o,a)
  51126. }
  51127. ,
  51128. Ci.Vertex = function(e, t, i) {
  51129. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51130. new Ci.Vector3(e,t,i)
  51131. }
  51132. ,
  51133. Object.defineProperties(Ci.Object3D.prototype, {
  51134. eulerOrder: {
  51135. get: function() {
  51136. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51137. this.rotation.order
  51138. },
  51139. set: function(e) {
  51140. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51141. this.rotation.order = e
  51142. }
  51143. },
  51144. getChildByName: {
  51145. value: function(e) {
  51146. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51147. this.getObjectByName(e)
  51148. }
  51149. },
  51150. renderDepth: {
  51151. set: function(e) {
  51152. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51153. }
  51154. },
  51155. translate: {
  51156. value: function(e, t) {
  51157. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51158. this.translateOnAxis(t, e)
  51159. }
  51160. },
  51161. useQuaternion: {
  51162. get: function() {
  51163. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51164. },
  51165. set: function(e) {
  51166. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51167. }
  51168. }
  51169. }),
  51170. Object.defineProperties(Ci, {
  51171. PointCloud: {
  51172. value: function(e, t) {
  51173. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51174. new Ci.Points(e,t)
  51175. }
  51176. },
  51177. ParticleSystem: {
  51178. value: function(e, t) {
  51179. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51180. new Ci.Points(e,t)
  51181. }
  51182. }
  51183. }),
  51184. Object.defineProperties(Ci.Light.prototype, {
  51185. onlyShadow: {
  51186. set: function(e) {
  51187. console.warn("THREE.Light: .onlyShadow has been removed.")
  51188. }
  51189. },
  51190. shadowCameraFov: {
  51191. set: function(e) {
  51192. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51193. this.shadow.camera.fov = e
  51194. }
  51195. },
  51196. shadowCameraLeft: {
  51197. set: function(e) {
  51198. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51199. this.shadow.camera.left = e
  51200. }
  51201. },
  51202. shadowCameraRight: {
  51203. set: function(e) {
  51204. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51205. this.shadow.camera.right = e
  51206. }
  51207. },
  51208. shadowCameraTop: {
  51209. set: function(e) {
  51210. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51211. this.shadow.camera.top = e
  51212. }
  51213. },
  51214. shadowCameraBottom: {
  51215. set: function(e) {
  51216. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51217. this.shadow.camera.bottom = e
  51218. }
  51219. },
  51220. shadowCameraNear: {
  51221. set: function(e) {
  51222. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51223. this.shadow.camera.near = e
  51224. }
  51225. },
  51226. shadowCameraFar: {
  51227. set: function(e) {
  51228. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51229. this.shadow.camera.far = e
  51230. }
  51231. },
  51232. shadowCameraVisible: {
  51233. set: function(e) {
  51234. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51235. }
  51236. },
  51237. shadowBias: {
  51238. set: function(e) {
  51239. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51240. this.shadow.bias = e
  51241. }
  51242. },
  51243. shadowDarkness: {
  51244. set: function(e) {
  51245. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51246. }
  51247. },
  51248. shadowMapWidth: {
  51249. set: function(e) {
  51250. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51251. this.shadow.mapSize.width = e
  51252. }
  51253. },
  51254. shadowMapHeight: {
  51255. set: function(e) {
  51256. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51257. this.shadow.mapSize.height = e
  51258. }
  51259. }
  51260. }),
  51261. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51262. length: {
  51263. get: function() {
  51264. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51265. this.array.length
  51266. }
  51267. }
  51268. }),
  51269. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51270. drawcalls: {
  51271. get: function() {
  51272. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51273. this.groups
  51274. }
  51275. },
  51276. offsets: {
  51277. get: function() {
  51278. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51279. this.groups
  51280. }
  51281. },
  51282. addIndex: {
  51283. value: function(e) {
  51284. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51285. this.setIndex(e)
  51286. }
  51287. },
  51288. addDrawCall: {
  51289. value: function(e, t, i) {
  51290. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51291. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51292. this.addGroup(e, t)
  51293. }
  51294. },
  51295. clearDrawCalls: {
  51296. value: function() {
  51297. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51298. this.clearGroups()
  51299. }
  51300. },
  51301. computeTangents: {
  51302. value: function() {
  51303. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51304. }
  51305. },
  51306. computeOffsets: {
  51307. value: function() {
  51308. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51309. }
  51310. }
  51311. }),
  51312. Object.defineProperties(Ci.Material.prototype, {
  51313. wrapAround: {
  51314. get: function() {
  51315. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51316. },
  51317. set: function(e) {
  51318. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51319. }
  51320. },
  51321. wrapRGB: {
  51322. get: function() {
  51323. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51324. new Ci.Color
  51325. }
  51326. }
  51327. }),
  51328. Object.defineProperties(Ci, {
  51329. PointCloudMaterial: {
  51330. value: function(e) {
  51331. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51332. new Ci.PointsMaterial(e)
  51333. }
  51334. },
  51335. ParticleBasicMaterial: {
  51336. value: function(e) {
  51337. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51338. new Ci.PointsMaterial(e)
  51339. }
  51340. },
  51341. ParticleSystemMaterial: {
  51342. value: function(e) {
  51343. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51344. new Ci.PointsMaterial(e)
  51345. }
  51346. }
  51347. }),
  51348. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51349. metal: {
  51350. get: function() {
  51351. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51352. !1
  51353. },
  51354. set: function(e) {
  51355. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51356. }
  51357. }
  51358. }),
  51359. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51360. derivatives: {
  51361. get: function() {
  51362. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51363. this.extensions.derivatives
  51364. },
  51365. set: function(e) {
  51366. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51367. this.extensions.derivatives = e
  51368. }
  51369. }
  51370. }),
  51371. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51372. supportsFloatTextures: {
  51373. value: function() {
  51374. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51375. this.extensions.get("OES_texture_float")
  51376. }
  51377. },
  51378. supportsHalfFloatTextures: {
  51379. value: function() {
  51380. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51381. this.extensions.get("OES_texture_half_float")
  51382. }
  51383. },
  51384. supportsStandardDerivatives: {
  51385. value: function() {
  51386. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51387. this.extensions.get("OES_standard_derivatives")
  51388. }
  51389. },
  51390. supportsCompressedTextureS3TC: {
  51391. value: function() {
  51392. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51393. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51394. }
  51395. },
  51396. supportsCompressedTexturePVRTC: {
  51397. value: function() {
  51398. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51399. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51400. }
  51401. },
  51402. supportsBlendMinMax: {
  51403. value: function() {
  51404. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51405. this.extensions.get("EXT_blend_minmax")
  51406. }
  51407. },
  51408. supportsVertexTextures: {
  51409. value: function() {
  51410. return this.capabilities.vertexTextures
  51411. }
  51412. },
  51413. supportsInstancedArrays: {
  51414. value: function() {
  51415. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51416. this.extensions.get("ANGLE_instanced_arrays")
  51417. }
  51418. },
  51419. enableScissorTest: {
  51420. value: function(e) {
  51421. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51422. this.setScissorTest(e)
  51423. }
  51424. },
  51425. initMaterial: {
  51426. value: function() {
  51427. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51428. }
  51429. },
  51430. addPrePlugin: {
  51431. value: function() {
  51432. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51433. }
  51434. },
  51435. addPostPlugin: {
  51436. value: function() {
  51437. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51438. }
  51439. },
  51440. updateShadowMap: {
  51441. value: function() {
  51442. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51443. }
  51444. },
  51445. shadowMapEnabled: {
  51446. get: function() {
  51447. return this.shadowMap.enabled
  51448. },
  51449. set: function(e) {
  51450. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51451. this.shadowMap.enabled = e
  51452. }
  51453. },
  51454. shadowMapType: {
  51455. get: function() {
  51456. return this.shadowMap.type
  51457. },
  51458. set: function(e) {
  51459. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51460. this.shadowMap.type = e
  51461. }
  51462. },
  51463. shadowMapCullFace: {
  51464. get: function() {
  51465. return this.shadowMap.cullFace
  51466. },
  51467. set: function(e) {
  51468. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51469. this.shadowMap.cullFace = e
  51470. }
  51471. }
  51472. }),
  51473. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51474. wrapS: {
  51475. get: function() {
  51476. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51477. this.texture.wrapS
  51478. },
  51479. set: function(e) {
  51480. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51481. this.texture.wrapS = e
  51482. }
  51483. },
  51484. wrapT: {
  51485. get: function() {
  51486. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51487. this.texture.wrapT
  51488. },
  51489. set: function(e) {
  51490. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51491. this.texture.wrapT = e
  51492. }
  51493. },
  51494. magFilter: {
  51495. get: function() {
  51496. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51497. this.texture.magFilter
  51498. },
  51499. set: function(e) {
  51500. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51501. this.texture.magFilter = e
  51502. }
  51503. },
  51504. minFilter: {
  51505. get: function() {
  51506. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51507. this.texture.minFilter
  51508. },
  51509. set: function(e) {
  51510. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51511. this.texture.minFilter = e
  51512. }
  51513. },
  51514. anisotropy: {
  51515. get: function() {
  51516. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51517. this.texture.anisotropy
  51518. },
  51519. set: function(e) {
  51520. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51521. this.texture.anisotropy = e
  51522. }
  51523. },
  51524. offset: {
  51525. get: function() {
  51526. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51527. this.texture.offset
  51528. },
  51529. set: function(e) {
  51530. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51531. this.texture.offset = e
  51532. }
  51533. },
  51534. repeat: {
  51535. get: function() {
  51536. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51537. this.texture.repeat
  51538. },
  51539. set: function(e) {
  51540. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51541. this.texture.repeat = e
  51542. }
  51543. },
  51544. format: {
  51545. get: function() {
  51546. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51547. this.texture.format
  51548. },
  51549. set: function(e) {
  51550. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51551. this.texture.format = e
  51552. }
  51553. },
  51554. type: {
  51555. get: function() {
  51556. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51557. this.texture.type
  51558. },
  51559. set: function(e) {
  51560. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51561. this.texture.type = e
  51562. }
  51563. },
  51564. generateMipmaps: {
  51565. get: function() {
  51566. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51567. this.texture.generateMipmaps
  51568. },
  51569. set: function(e) {
  51570. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51571. this.texture.generateMipmaps = e
  51572. }
  51573. }
  51574. }),
  51575. Ci.GeometryUtils = {
  51576. merge: function(e, t, i) {
  51577. var n;
  51578. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51579. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51580. n = t.matrix,
  51581. t = t.geometry),
  51582. e.merge(t, n, i)
  51583. },
  51584. center: function(e) {
  51585. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51586. e.center()
  51587. }
  51588. },
  51589. Ci.ImageUtils = {
  51590. crossOrigin: void 0,
  51591. loadTexture: function(e, t, i, n) {
  51592. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51593. var r = new Ci.TextureLoader;
  51594. r.setCrossOrigin(this.crossOrigin);
  51595. var o = r.load(e, i, void 0, n);
  51596. return t && (o.mapping = t),
  51597. o
  51598. },
  51599. loadTextureCube: function(e, t, i, n) {
  51600. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51601. var r = new Ci.CubeTextureLoader;
  51602. r.setCrossOrigin(this.crossOrigin);
  51603. var o = r.load(e, i, void 0, n);
  51604. return t && (o.mapping = t),
  51605. o
  51606. },
  51607. loadCompressedTexture: function() {
  51608. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51609. },
  51610. loadCompressedTextureCube: function() {
  51611. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51612. }
  51613. },
  51614. Ci.Projector = function() {
  51615. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51616. this.projectVector = function(e, t) {
  51617. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51618. e.project(t)
  51619. }
  51620. ,
  51621. this.unprojectVector = function(e, t) {
  51622. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51623. e.unproject(t)
  51624. }
  51625. ,
  51626. this.pickingRay = function(e, t) {
  51627. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51628. }
  51629. }
  51630. ,
  51631. Ci.CanvasRenderer = function() {
  51632. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51633. this.domElement = document.createElement("canvas"),
  51634. this.clear = function() {}
  51635. ,
  51636. this.render = function() {}
  51637. ,
  51638. this.setClearColor = function() {}
  51639. ,
  51640. this.setSize = function() {}
  51641. }
  51642. ,
  51643. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51644. Ci.CurveUtils = {
  51645. tangentQuadraticBezier: function(e, t, i, n) {
  51646. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51647. },
  51648. tangentCubicBezier: function(e, t, i, n, r) {
  51649. 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
  51650. },
  51651. tangentSpline: function(e, t, i, n, r) {
  51652. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51653. },
  51654. interpolate: function(e, t, i, n, r) {
  51655. var o = .5 * (i - e)
  51656. , a = .5 * (n - t)
  51657. , s = r * r;
  51658. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51659. }
  51660. },
  51661. Ci.SceneUtils = {
  51662. createMultiMaterialObject: function(e, t) {
  51663. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51664. i.add(new Ci.Mesh(e,t[n]));
  51665. return i
  51666. },
  51667. detach: function(e, t, i) {
  51668. e.applyMatrix(t.matrixWorld),
  51669. t.remove(e),
  51670. i.add(e)
  51671. },
  51672. attach: function(e, t, i) {
  51673. var n = new Ci.Matrix4;
  51674. n.getInverse(i.matrixWorld),
  51675. e.applyMatrix(n),
  51676. t.remove(e),
  51677. i.add(e)
  51678. }
  51679. },
  51680. Ci.ShapeUtils = {
  51681. area: function(e) {
  51682. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51683. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51684. return .5 * i
  51685. },
  51686. triangulate: function(e, t) {
  51687. var i = e.length;
  51688. if (i < 3)
  51689. return null;
  51690. var n, r, o, a = [], s = [], l = [];
  51691. if (0 < Ci.ShapeUtils.area(e))
  51692. for (r = 0; r < i; r++)
  51693. s[r] = r;
  51694. else
  51695. for (r = 0; r < i; r++)
  51696. s[r] = i - 1 - r;
  51697. var c = i
  51698. , h = 2 * c;
  51699. for (r = c - 1; 2 < c; ) {
  51700. if (h-- <= 0)
  51701. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51702. t ? l : a;
  51703. if (c <= (n = r) && (n = 0),
  51704. c <= (r = n + 1) && (r = 0),
  51705. c <= (o = r + 1) && (o = 0),
  51706. Si(e, n, r, o, c, s)) {
  51707. var u, d, p, f, g;
  51708. for (u = s[n],
  51709. d = s[r],
  51710. p = s[o],
  51711. a.push([e[u], e[d], e[p]]),
  51712. l.push([s[n], s[r], s[o]]),
  51713. g = (f = r) + 1; g < c; f++,
  51714. g++)
  51715. s[f] = s[g];
  51716. h = 2 * --c
  51717. }
  51718. }
  51719. return t ? l : a
  51720. },
  51721. triangulateShape: function(e, t) {
  51722. function w(e, t, i) {
  51723. 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
  51724. }
  51725. function b(e, t, i, n, r) {
  51726. var o = t.x - e.x
  51727. , a = t.y - e.y
  51728. , s = n.x - i.x
  51729. , l = n.y - i.y
  51730. , c = e.x - i.x
  51731. , h = e.y - i.y
  51732. , u = a * s - o * l
  51733. , d = a * c - o * h;
  51734. if (Math.abs(u) > Number.EPSILON) {
  51735. var p;
  51736. if (0 < u) {
  51737. if (d < 0 || u < d)
  51738. return [];
  51739. if ((p = l * c - s * h) < 0 || u < p)
  51740. return []
  51741. } else {
  51742. if (0 < d || d < u)
  51743. return [];
  51744. if (0 < (p = l * c - s * h) || p < u)
  51745. return []
  51746. }
  51747. if (0 === p)
  51748. return !r || 0 != d && d != u ? [e] : [];
  51749. if (p === u)
  51750. return !r || 0 != d && d != u ? [t] : [];
  51751. if (0 == d)
  51752. return [i];
  51753. if (d == u)
  51754. return [n];
  51755. var f = p / u;
  51756. return [{
  51757. x: e.x + f * o,
  51758. y: e.y + f * a
  51759. }]
  51760. }
  51761. if (0 != d || l * c != s * h)
  51762. return [];
  51763. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51764. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  51765. (m = t).x) : (v = (g = t).x,
  51766. (m = e).x),
  51767. i.x < n.x ? (I = (A = i).x,
  51768. (C = n).x) : (I = (A = n).x,
  51769. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51770. (m = t).y) : (v = (g = t).y,
  51771. (m = e).y),
  51772. i.y < n.y ? (I = (A = i).y,
  51773. (C = n).y) : (I = (A = n).y,
  51774. (C = i).y)),
  51775. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  51776. }
  51777. function T(e, t, i, n) {
  51778. var r = t.x - e.x
  51779. , o = t.y - e.y
  51780. , a = i.x - e.x
  51781. , s = i.y - e.y
  51782. , l = n.x - e.x
  51783. , c = n.y - e.y
  51784. , h = r * s - o * a
  51785. , u = r * c - o * l;
  51786. if (Math.abs(h) > Number.EPSILON) {
  51787. var d = l * s - c * a;
  51788. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51789. }
  51790. return 0 < u
  51791. }
  51792. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51793. Array.prototype.push.apply(c, t[h]);
  51794. for (i = 0,
  51795. n = c.length; i < n; i++)
  51796. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51797. l[a] = i;
  51798. var d = function(e, a) {
  51799. function t(e, t) {
  51800. var i = m.length - 1
  51801. , n = e - 1;
  51802. n < 0 && (n = i);
  51803. var r = e + 1;
  51804. i < r && (r = 0);
  51805. var o = T(m[e], m[n], m[r], c[t]);
  51806. if (!o)
  51807. return !1;
  51808. var a = c.length - 1
  51809. , s = t - 1;
  51810. s < 0 && (s = a);
  51811. var l = t + 1;
  51812. return a < l && (l = 0),
  51813. !!(o = T(c[t], c[s], c[l], m[e]))
  51814. }
  51815. function i(e, t) {
  51816. var i, n;
  51817. for (i = 0; i < m.length; i++)
  51818. if (n = i + 1,
  51819. n %= m.length,
  51820. 0 < b(e, t, m[i], m[n], !0).length)
  51821. return !0;
  51822. return !1
  51823. }
  51824. function n(e, t) {
  51825. var i, n, r, o;
  51826. for (i = 0; i < v.length; i++)
  51827. for (n = a[v[i]],
  51828. r = 0; r < n.length; r++)
  51829. if (o = r + 1,
  51830. o %= n.length,
  51831. 0 < b(e, t, n[r], n[o], !0).length)
  51832. return !0;
  51833. return !1
  51834. }
  51835. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  51836. v.push(A);
  51837. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51838. if (--E < 0) {
  51839. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51840. break
  51841. }
  51842. for (o = I; o < m.length; o++) {
  51843. s = m[o],
  51844. r = -1;
  51845. for (A = 0; A < v.length; A++)
  51846. if (h = v[A],
  51847. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51848. c = a[h];
  51849. for (var _ = 0; _ < c.length; _++)
  51850. if (l = c[_],
  51851. t(o, _) && !i(s, l) && !n(s, l)) {
  51852. r = _,
  51853. v.splice(A, 1),
  51854. d = m.slice(0, o + 1),
  51855. p = m.slice(o),
  51856. f = c.slice(r),
  51857. g = c.slice(0, r + 1),
  51858. m = d.concat(f).concat(g).concat(p),
  51859. I = o;
  51860. break
  51861. }
  51862. if (0 <= r)
  51863. break;
  51864. y[u] = !0
  51865. }
  51866. if (0 <= r)
  51867. break
  51868. }
  51869. }
  51870. return m
  51871. }(e, t)
  51872. , p = Ci.ShapeUtils.triangulate(d, !1);
  51873. for (i = 0,
  51874. n = p.length; i < n; i++)
  51875. for (o = p[i],
  51876. r = 0; r < 3; r++)
  51877. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51878. return p.concat()
  51879. },
  51880. isClockWise: function(e) {
  51881. return Ci.ShapeUtils.area(e) < 0
  51882. },
  51883. b2: function(e, t, i, n) {
  51884. return function(e, t) {
  51885. var i = 1 - e;
  51886. return i * i * t
  51887. }(e, t) + function(e, t) {
  51888. return 2 * (1 - e) * e * t
  51889. }(e, i) + function(e, t) {
  51890. return e * e * t
  51891. }(e, n)
  51892. },
  51893. b3: function(e, t, i, n, r) {
  51894. return function(e, t) {
  51895. var i = 1 - e;
  51896. return i * i * i * t
  51897. }(e, t) + function(e, t) {
  51898. var i = 1 - e;
  51899. return 3 * i * i * e * t
  51900. }(e, i) + function(e, t) {
  51901. return 3 * (1 - e) * e * e * t
  51902. }(e, n) + function(e, t) {
  51903. return e * e * e * t
  51904. }(e, r)
  51905. }
  51906. },
  51907. Ci.Curve = function() {}
  51908. ,
  51909. Ci.Curve.prototype = {
  51910. constructor: Ci.Curve,
  51911. getPoint: function(e) {
  51912. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51913. null
  51914. },
  51915. getPointAt: function(e) {
  51916. var t = this.getUtoTmapping(e);
  51917. return this.getPoint(t)
  51918. },
  51919. getPoints: function(e) {
  51920. e = e || 5;
  51921. var t, i = [];
  51922. for (t = 0; t <= e; t++)
  51923. i.push(this.getPoint(t / e));
  51924. return i
  51925. },
  51926. getSpacedPoints: function(e) {
  51927. e = e || 5;
  51928. var t, i = [];
  51929. for (t = 0; t <= e; t++)
  51930. i.push(this.getPointAt(t / e));
  51931. return i
  51932. },
  51933. getLength: function() {
  51934. var e = this.getLengths();
  51935. return e[e.length - 1]
  51936. },
  51937. getLengths: function(e) {
  51938. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51939. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51940. return this.cacheArcLengths;
  51941. this.needsUpdate = !1;
  51942. var t, i, n = [], r = this.getPoint(0), o = 0;
  51943. for (n.push(0),
  51944. i = 1; i <= e; i++)
  51945. o += (t = this.getPoint(i / e)).distanceTo(r),
  51946. n.push(o),
  51947. r = t;
  51948. return this.cacheArcLengths = n
  51949. },
  51950. updateArcLengths: function() {
  51951. this.needsUpdate = !0,
  51952. this.getLengths()
  51953. },
  51954. getUtoTmapping: function(e, t) {
  51955. var i, n = this.getLengths(), r = 0, o = n.length;
  51956. i = t || e * n[o - 1];
  51957. for (var a, s = 0, l = o - 1; s <= l; )
  51958. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51959. s = r + 1;
  51960. else {
  51961. if (!(0 < a)) {
  51962. l = r;
  51963. break
  51964. }
  51965. l = r - 1
  51966. }
  51967. if (n[r = l] === i)
  51968. return r / (o - 1);
  51969. var c = n[r];
  51970. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51971. },
  51972. getTangent: function(e) {
  51973. var t = e - 1e-4
  51974. , i = e + 1e-4;
  51975. t < 0 && (t = 0),
  51976. 1 < i && (i = 1);
  51977. var n = this.getPoint(t);
  51978. return this.getPoint(i).clone().sub(n).normalize()
  51979. },
  51980. getTangentAt: function(e) {
  51981. var t = this.getUtoTmapping(e);
  51982. return this.getTangent(t)
  51983. }
  51984. },
  51985. Ci.Curve.create = function(e, t) {
  51986. return e.prototype = Object.create(Ci.Curve.prototype),
  51987. (e.prototype.constructor = e).prototype.getPoint = t,
  51988. e
  51989. }
  51990. ,
  51991. Ci.CurvePath = function() {
  51992. this.curves = [],
  51993. this.autoClose = !1
  51994. }
  51995. ,
  51996. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51997. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51998. Ci.CurvePath.prototype.add = function(e) {
  51999. this.curves.push(e)
  52000. }
  52001. ,
  52002. Ci.CurvePath.prototype.closePath = function() {
  52003. var e = this.curves[0].getPoint(0)
  52004. , t = this.curves[this.curves.length - 1].getPoint(1);
  52005. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52006. }
  52007. ,
  52008. Ci.CurvePath.prototype.getPoint = function(e) {
  52009. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52010. if (i[n] >= t) {
  52011. var r = i[n] - t
  52012. , o = this.curves[n]
  52013. , a = 1 - r / o.getLength();
  52014. return o.getPointAt(a)
  52015. }
  52016. n++
  52017. }
  52018. return null
  52019. }
  52020. ,
  52021. Ci.CurvePath.prototype.getLength = function() {
  52022. var e = this.getCurveLengths();
  52023. return e[e.length - 1]
  52024. }
  52025. ,
  52026. Ci.CurvePath.prototype.getCurveLengths = function() {
  52027. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52028. return this.cacheLengths;
  52029. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52030. t += this.curves[i].getLength(),
  52031. e.push(t);
  52032. return this.cacheLengths = e
  52033. }
  52034. ,
  52035. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52036. var t = this.getPoints(e);
  52037. return this.createGeometry(t)
  52038. }
  52039. ,
  52040. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52041. var t = this.getSpacedPoints(e);
  52042. return this.createGeometry(t)
  52043. }
  52044. ,
  52045. Ci.CurvePath.prototype.createGeometry = function(e) {
  52046. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52047. var r = e[i];
  52048. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52049. }
  52050. return t
  52051. }
  52052. ,
  52053. Ci.Font = function(e) {
  52054. this.data = e
  52055. }
  52056. ,
  52057. Ci.Font.prototype = {
  52058. constructor: Ci.Font,
  52059. generateShapes: function(e, s, b) {
  52060. function l(e, t, i) {
  52061. var n = w.glyphs[e] || w.glyphs["?"];
  52062. if (n) {
  52063. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  52064. if (n.o)
  52065. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52066. switch (A[C++]) {
  52067. case "m":
  52068. r = A[C++] * t + i,
  52069. o = A[C++] * t,
  52070. g.moveTo(r, o);
  52071. break;
  52072. case "l":
  52073. r = A[C++] * t + i,
  52074. o = A[C++] * t,
  52075. g.lineTo(r, o);
  52076. break;
  52077. case "q":
  52078. if (a = A[C++] * t + i,
  52079. s = A[C++] * t,
  52080. h = A[C++] * t + i,
  52081. u = A[C++] * t,
  52082. g.quadraticCurveTo(h, u, a, s),
  52083. f = m[m.length - 1]) {
  52084. l = f.x,
  52085. c = f.y;
  52086. for (var E = 1; E <= b; E++) {
  52087. v(_ = E / b, l, h, a),
  52088. v(_, c, u, s)
  52089. }
  52090. }
  52091. break;
  52092. case "b":
  52093. if (a = A[C++] * t + i,
  52094. s = A[C++] * t,
  52095. h = A[C++] * t + i,
  52096. u = A[C++] * t,
  52097. d = A[C++] * t + i,
  52098. p = A[C++] * t,
  52099. g.bezierCurveTo(h, u, d, p, a, s),
  52100. f = m[m.length - 1]) {
  52101. l = f.x,
  52102. c = f.y;
  52103. for (E = 1; E <= b; E++) {
  52104. var _;
  52105. y(_ = E / b, l, h, d, a),
  52106. y(_, c, u, p, s)
  52107. }
  52108. }
  52109. }
  52110. }
  52111. return {
  52112. offset: n.ha * t,
  52113. path: g
  52114. }
  52115. }
  52116. }
  52117. void 0 === s && (s = 100),
  52118. void 0 === b && (b = 4);
  52119. for (var w = this.data, t = function(e) {
  52120. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52121. var a = l(t[o], i, n);
  52122. n += a.offset,
  52123. r.push(a.path)
  52124. }
  52125. return r
  52126. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52127. Array.prototype.push.apply(i, t[n].toShapes());
  52128. return i
  52129. }
  52130. },
  52131. Ci.Path = function(e) {
  52132. Ci.CurvePath.call(this),
  52133. this.actions = [],
  52134. e && this.fromPoints(e)
  52135. }
  52136. ,
  52137. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52138. Ci.Path.prototype.constructor = Ci.Path,
  52139. Ci.Path.prototype.fromPoints = function(e) {
  52140. this.moveTo(e[0].x, e[0].y);
  52141. for (var t = 1, i = e.length; t < i; t++)
  52142. this.lineTo(e[t].x, e[t].y)
  52143. }
  52144. ,
  52145. Ci.Path.prototype.moveTo = function(e, t) {
  52146. this.actions.push({
  52147. action: "moveTo",
  52148. args: [e, t]
  52149. })
  52150. }
  52151. ,
  52152. Ci.Path.prototype.lineTo = function(e, t) {
  52153. var i = this.actions[this.actions.length - 1].args
  52154. , n = i[i.length - 2]
  52155. , r = i[i.length - 1]
  52156. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52157. this.curves.push(o),
  52158. this.actions.push({
  52159. action: "lineTo",
  52160. args: [e, t]
  52161. })
  52162. }
  52163. ,
  52164. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52165. var r = this.actions[this.actions.length - 1].args
  52166. , o = r[r.length - 2]
  52167. , a = r[r.length - 1]
  52168. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52169. this.curves.push(s),
  52170. this.actions.push({
  52171. action: "quadraticCurveTo",
  52172. args: [e, t, i, n]
  52173. })
  52174. }
  52175. ,
  52176. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52177. var a = this.actions[this.actions.length - 1].args
  52178. , s = a[a.length - 2]
  52179. , l = a[a.length - 1]
  52180. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52181. this.curves.push(c),
  52182. this.actions.push({
  52183. action: "bezierCurveTo",
  52184. args: [e, t, i, n, r, o]
  52185. })
  52186. }
  52187. ,
  52188. Ci.Path.prototype.splineThru = function(e) {
  52189. var t = Array.prototype.slice.call(arguments)
  52190. , i = this.actions[this.actions.length - 1].args
  52191. , n = i[i.length - 2]
  52192. , r = i[i.length - 1]
  52193. , o = [new Ci.Vector2(n,r)];
  52194. Array.prototype.push.apply(o, e);
  52195. var a = new Ci.SplineCurve(o);
  52196. this.curves.push(a),
  52197. this.actions.push({
  52198. action: "splineThru",
  52199. args: t
  52200. })
  52201. }
  52202. ,
  52203. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52204. var a = this.actions[this.actions.length - 1].args
  52205. , s = a[a.length - 2]
  52206. , l = a[a.length - 1];
  52207. this.absarc(e + s, t + l, i, n, r, o)
  52208. }
  52209. ,
  52210. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52211. this.absellipse(e, t, i, i, n, r, o)
  52212. }
  52213. ,
  52214. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52215. var l = this.actions[this.actions.length - 1].args
  52216. , c = l[l.length - 2]
  52217. , h = l[l.length - 1];
  52218. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52219. }
  52220. ,
  52221. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52222. var l = [e, t, i, n, r, o, a, s || 0]
  52223. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52224. this.curves.push(c);
  52225. var h = c.getPoint(1);
  52226. l.push(h.x),
  52227. l.push(h.y),
  52228. this.actions.push({
  52229. action: "ellipse",
  52230. args: l
  52231. })
  52232. }
  52233. ,
  52234. Ci.Path.prototype.getSpacedPoints = function(e) {
  52235. e = e || 40;
  52236. for (var t = [], i = 0; i < e; i++)
  52237. t.push(this.getPoint(i / e));
  52238. return this.autoClose && t.push(t[0]),
  52239. t
  52240. }
  52241. ,
  52242. Ci.Path.prototype.getPoints = function(e) {
  52243. e = e || 12;
  52244. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  52245. var v = this.actions[g]
  52246. , y = v.action
  52247. , A = v.args;
  52248. switch (y) {
  52249. case "moveTo":
  52250. case "lineTo":
  52251. f.push(new Ci.Vector2(A[0],A[1]));
  52252. break;
  52253. case "quadraticCurveTo":
  52254. t = A[2],
  52255. i = A[3],
  52256. o = A[0],
  52257. a = A[1],
  52258. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52259. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52260. c[c.length - 1]);
  52261. for (var C = 1; C <= e; C++) {
  52262. h = d(O = C / e, s, o, t),
  52263. u = d(O, l, a, i),
  52264. f.push(new Ci.Vector2(h,u))
  52265. }
  52266. break;
  52267. case "bezierCurveTo":
  52268. t = A[4],
  52269. i = A[5],
  52270. o = A[0],
  52271. a = A[1],
  52272. n = A[2],
  52273. r = A[3],
  52274. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52275. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52276. c[c.length - 1]);
  52277. for (C = 1; C <= e; C++) {
  52278. h = p(O = C / e, s, o, n, t),
  52279. u = p(O, l, a, r, i),
  52280. f.push(new Ci.Vector2(h,u))
  52281. }
  52282. break;
  52283. case "splineThru":
  52284. c = this.actions[g - 1].args;
  52285. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52286. , E = e * A[0].length;
  52287. I = I.concat(A[0]);
  52288. var _ = new Ci.SplineCurve(I);
  52289. for (C = 1; C <= E; C++)
  52290. f.push(_.getPointAt(C / E));
  52291. break;
  52292. case "arc":
  52293. var b = A[0]
  52294. , w = A[1]
  52295. , T = A[2]
  52296. , x = A[3]
  52297. , S = A[4]
  52298. , M = !!A[5]
  52299. , R = S - x
  52300. , P = 2 * e;
  52301. for (C = 1; C <= P; C++) {
  52302. var O = C / P;
  52303. M || (O = 1 - O),
  52304. L = x + O * R,
  52305. h = b + T * Math.cos(L),
  52306. u = w + T * Math.sin(L),
  52307. f.push(new Ci.Vector2(h,u))
  52308. }
  52309. break;
  52310. case "ellipse":
  52311. b = A[0],
  52312. w = A[1];
  52313. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52314. S = A[5],
  52315. M = !!A[6],
  52316. A[7]);
  52317. R = S - x,
  52318. P = 2 * e;
  52319. 0 !== V && (D = Math.cos(V),
  52320. N = Math.sin(V));
  52321. for (C = 1; C <= P; C++) {
  52322. O = C / P;
  52323. if (M || (O = 1 - O),
  52324. L = x + O * R,
  52325. h = b + F * Math.cos(L),
  52326. u = w + B * Math.sin(L),
  52327. 0 !== V) {
  52328. var k = h;
  52329. h = (k - b) * D - (u - w) * N + b,
  52330. u = (k - b) * N + (u - w) * D + w
  52331. }
  52332. f.push(new Ci.Vector2(h,u))
  52333. }
  52334. }
  52335. }
  52336. var U = f[f.length - 1];
  52337. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52338. this.autoClose && f.push(f[0]),
  52339. f
  52340. }
  52341. ,
  52342. Ci.Path.prototype.toShapes = function(e, t) {
  52343. function i(e) {
  52344. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52345. var r = e[i]
  52346. , o = new Ci.Shape;
  52347. o.actions = r.actions,
  52348. o.curves = r.curves,
  52349. t.push(o)
  52350. }
  52351. return t
  52352. }
  52353. function n(e, t) {
  52354. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52355. var a = t[r]
  52356. , s = t[o]
  52357. , l = s.x - a.x
  52358. , c = s.y - a.y;
  52359. if (Math.abs(c) > Number.EPSILON) {
  52360. if (c < 0 && (a = t[o],
  52361. l = -l,
  52362. s = t[r],
  52363. c = -c),
  52364. e.y < a.y || e.y > s.y)
  52365. continue;
  52366. if (e.y === a.y) {
  52367. if (e.x === a.x)
  52368. return !0
  52369. } else {
  52370. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52371. if (0 == h)
  52372. return !0;
  52373. if (h < 0)
  52374. continue;
  52375. n = !n
  52376. }
  52377. } else {
  52378. if (e.y !== a.y)
  52379. continue;
  52380. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52381. return !0
  52382. }
  52383. }
  52384. return n
  52385. }
  52386. var r = Ci.ShapeUtils.isClockWise
  52387. , o = function(e) {
  52388. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52389. var o = e[n]
  52390. , a = o.args
  52391. , s = o.action;
  52392. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52393. i = new Ci.Path),
  52394. i[s].apply(i, a)
  52395. }
  52396. return 0 !== i.actions.length && t.push(i),
  52397. t
  52398. }(this.actions);
  52399. if (0 === o.length)
  52400. return [];
  52401. if (!0 === t)
  52402. return i(o);
  52403. var a, s, l, c = [];
  52404. if (1 === o.length)
  52405. return s = o[0],
  52406. (l = new Ci.Shape).actions = s.actions,
  52407. l.curves = s.curves,
  52408. c.push(l),
  52409. c;
  52410. var h = !r(o[0].getPoints());
  52411. h = e ? !h : h;
  52412. var u, d = [], p = [], f = [], g = 0;
  52413. p[g] = void 0,
  52414. f[g] = [];
  52415. for (var m = 0, v = o.length; m < v; m++)
  52416. a = r(u = (s = o[m]).getPoints()),
  52417. (a = e ? !a : a) ? (!h && p[g] && g++,
  52418. p[g] = {
  52419. s: new Ci.Shape,
  52420. p: u
  52421. },
  52422. p[g].s.actions = s.actions,
  52423. p[g].s.curves = s.curves,
  52424. h && g++,
  52425. f[g] = []) : f[g].push({
  52426. h: s,
  52427. p: u[0]
  52428. });
  52429. if (!p[0])
  52430. return i(o);
  52431. if (1 < p.length) {
  52432. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52433. d[C] = [];
  52434. for (C = 0,
  52435. I = p.length; C < I; C++)
  52436. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52437. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52438. n(b.p, p[T].p) && (C !== T && A.push({
  52439. froms: C,
  52440. tos: T,
  52441. hole: _
  52442. }),
  52443. w ? (w = !1,
  52444. d[T].push(b)) : y = !0);
  52445. w && d[C].push(b)
  52446. }
  52447. 0 < A.length && (y || (f = d))
  52448. }
  52449. m = 0;
  52450. for (var x, S = p.length; m < S; m++) {
  52451. l = p[m].s,
  52452. c.push(l);
  52453. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52454. l.holes.push(x[M].h)
  52455. }
  52456. return c
  52457. }
  52458. ,
  52459. Ci.Shape = function() {
  52460. Ci.Path.apply(this, arguments),
  52461. this.holes = []
  52462. }
  52463. ,
  52464. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52465. Ci.Shape.prototype.constructor = Ci.Shape,
  52466. Ci.Shape.prototype.extrude = function(e) {
  52467. return new Ci.ExtrudeGeometry(this,e)
  52468. }
  52469. ,
  52470. Ci.Shape.prototype.makeGeometry = function(e) {
  52471. return new Ci.ShapeGeometry(this,e)
  52472. }
  52473. ,
  52474. Ci.Shape.prototype.getPointsHoles = function(e) {
  52475. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52476. t[i] = this.holes[i].getPoints(e);
  52477. return t
  52478. }
  52479. ,
  52480. Ci.Shape.prototype.extractAllPoints = function(e) {
  52481. return {
  52482. shape: this.getPoints(e),
  52483. holes: this.getPointsHoles(e)
  52484. }
  52485. }
  52486. ,
  52487. Ci.Shape.prototype.extractPoints = function(e) {
  52488. return this.extractAllPoints(e)
  52489. }
  52490. ,
  52491. Ci.LineCurve = function(e, t) {
  52492. this.v1 = e,
  52493. this.v2 = t
  52494. }
  52495. ,
  52496. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52497. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52498. Ci.LineCurve.prototype.getPoint = function(e) {
  52499. var t = this.v2.clone().sub(this.v1);
  52500. return t.multiplyScalar(e).add(this.v1),
  52501. t
  52502. }
  52503. ,
  52504. Ci.LineCurve.prototype.getPointAt = function(e) {
  52505. return this.getPoint(e)
  52506. }
  52507. ,
  52508. Ci.LineCurve.prototype.getTangent = function(e) {
  52509. return this.v2.clone().sub(this.v1).normalize()
  52510. }
  52511. ,
  52512. Ci.QuadraticBezierCurve = function(e, t, i) {
  52513. this.v0 = e,
  52514. this.v1 = t,
  52515. this.v2 = i
  52516. }
  52517. ,
  52518. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52519. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52520. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52521. var t = Ci.ShapeUtils.b2;
  52522. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52523. }
  52524. ,
  52525. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52526. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52527. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52528. }
  52529. ,
  52530. Ci.CubicBezierCurve = function(e, t, i, n) {
  52531. this.v0 = e,
  52532. this.v1 = t,
  52533. this.v2 = i,
  52534. this.v3 = n
  52535. }
  52536. ,
  52537. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52538. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52539. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52540. var t = Ci.ShapeUtils.b3;
  52541. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52542. }
  52543. ,
  52544. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52545. var t = Ci.CurveUtils.tangentCubicBezier;
  52546. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  52547. }
  52548. ,
  52549. Ci.SplineCurve = function(e) {
  52550. this.points = null == e ? [] : e
  52551. }
  52552. ,
  52553. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52554. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52555. Ci.SplineCurve.prototype.getPoint = function(e) {
  52556. var t = this.points
  52557. , i = (t.length - 1) * e
  52558. , n = Math.floor(i)
  52559. , r = i - n
  52560. , o = t[0 === n ? n : n - 1]
  52561. , a = t[n]
  52562. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52563. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52564. , c = Ci.CurveUtils.interpolate;
  52565. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52566. }
  52567. ,
  52568. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52569. this.aX = e,
  52570. this.aY = t,
  52571. this.xRadius = i,
  52572. this.yRadius = n,
  52573. this.aStartAngle = r,
  52574. this.aEndAngle = o,
  52575. this.aClockwise = a,
  52576. this.aRotation = s || 0
  52577. }
  52578. ,
  52579. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52580. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52581. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52582. var t, i = this.aEndAngle - this.aStartAngle;
  52583. i < 0 && (i += 2 * Math.PI),
  52584. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52585. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52586. var n = this.aX + this.xRadius * Math.cos(t)
  52587. , r = this.aY + this.yRadius * Math.sin(t);
  52588. if (0 !== this.aRotation) {
  52589. var o = Math.cos(this.aRotation)
  52590. , a = Math.sin(this.aRotation)
  52591. , s = n
  52592. , l = r;
  52593. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52594. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52595. }
  52596. return new Ci.Vector2(n,r)
  52597. }
  52598. ,
  52599. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52600. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52601. }
  52602. ,
  52603. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52604. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52605. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52606. this.v1 = e,
  52607. this.v2 = t
  52608. }, function(e) {
  52609. var t = new Ci.Vector3;
  52610. return t.subVectors(this.v2, this.v1),
  52611. t.multiplyScalar(e),
  52612. t.add(this.v1),
  52613. t
  52614. }),
  52615. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52616. this.v0 = e,
  52617. this.v1 = t,
  52618. this.v2 = i
  52619. }, function(e) {
  52620. var t = Ci.ShapeUtils.b2;
  52621. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  52622. }),
  52623. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52624. this.v0 = e,
  52625. this.v1 = t,
  52626. this.v2 = i,
  52627. this.v3 = n
  52628. }, function(e) {
  52629. var t = Ci.ShapeUtils.b3;
  52630. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  52631. }),
  52632. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52633. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52634. this.points = null == e ? [] : e
  52635. }, function(e) {
  52636. var t = this.points
  52637. , i = (t.length - 1) * e
  52638. , n = Math.floor(i)
  52639. , r = i - n
  52640. , o = t[0 == n ? n : n - 1]
  52641. , a = t[n]
  52642. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52643. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52644. , c = Ci.CurveUtils.interpolate;
  52645. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  52646. }),
  52647. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52648. Xt = new xi,
  52649. Zt = new xi,
  52650. Kt = new xi,
  52651. xi.prototype.init = function(e, t, i, n) {
  52652. this.c0 = e,
  52653. this.c1 = i,
  52654. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52655. this.c3 = 2 * e - 2 * t + i + n
  52656. }
  52657. ,
  52658. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52659. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52660. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52661. s *= o,
  52662. l *= o,
  52663. this.init(t, i, s, l)
  52664. }
  52665. ,
  52666. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52667. this.init(t, i, r * (i - e), r * (n - t))
  52668. }
  52669. ,
  52670. xi.prototype.calc = function(e) {
  52671. var t = e * e
  52672. , i = t * e;
  52673. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52674. }
  52675. ,
  52676. Ci.Curve.create(function(e) {
  52677. this.points = e || [],
  52678. this.closed = !1
  52679. }, function(e) {
  52680. var t, i, n, r, o, a, s, l, c = this.points;
  52681. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52682. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52683. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52684. n = 1),
  52685. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52686. qt),
  52687. a = c[i % r],
  52688. s = c[(i + 1) % r],
  52689. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52690. qt),
  52691. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52692. var h = "chordal" === this.type ? .5 : .25
  52693. , u = Math.pow(o.distanceToSquared(a), h)
  52694. , d = Math.pow(a.distanceToSquared(s), h)
  52695. , p = Math.pow(s.distanceToSquared(l), h);
  52696. d < 1e-4 && (d = 1),
  52697. u < 1e-4 && (u = d),
  52698. p < 1e-4 && (p = d),
  52699. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52700. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52701. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52702. } else if ("catmullrom" === this.type) {
  52703. var f = void 0 !== this.tension ? this.tension : .5;
  52704. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52705. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52706. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52707. }
  52708. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52709. })),
  52710. Ci.ClosedSplineCurve3 = function(e) {
  52711. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52712. Ci.CatmullRomCurve3.call(this, e),
  52713. this.type = "catmullrom",
  52714. this.closed = !0
  52715. }
  52716. ,
  52717. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52718. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52719. Ci.Geometry.call(this),
  52720. this.type = "BoxGeometry",
  52721. this.parameters = {
  52722. width: e,
  52723. height: t,
  52724. depth: i,
  52725. widthSegments: n,
  52726. heightSegments: r,
  52727. depthSegments: o
  52728. },
  52729. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52730. this.mergeVertices()
  52731. }
  52732. ,
  52733. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52734. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52735. Ci.CubeGeometry = Ci.BoxGeometry,
  52736. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52737. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52738. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  52739. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52740. var b = _ * u - p;
  52741. C[e] = b * n,
  52742. C[t] = E * r,
  52743. C[i] = g,
  52744. P[D] = C.x,
  52745. P[D + 1] = C.y,
  52746. P[D + 2] = C.z,
  52747. C[e] = 0,
  52748. C[t] = 0,
  52749. C[i] = 0 < s ? 1 : -1,
  52750. O[D] = C.x,
  52751. O[D + 1] = C.y,
  52752. O[D + 2] = C.z,
  52753. L[N] = _ / l,
  52754. L[N + 1] = 1 - I / c,
  52755. D += 3,
  52756. N += 2,
  52757. y += 1
  52758. }
  52759. for (I = 0; I < c; I++)
  52760. for (_ = 0; _ < l; _++) {
  52761. var w = B + _ + m * I
  52762. , T = B + _ + m * (I + 1)
  52763. , x = B + (_ + 1) + m * (I + 1)
  52764. , S = B + (_ + 1) + m * I;
  52765. R[F] = w,
  52766. R[F + 1] = T,
  52767. R[F + 2] = S,
  52768. R[F + 3] = T,
  52769. R[F + 4] = x,
  52770. R[F + 5] = S,
  52771. F += 6,
  52772. A += 6
  52773. }
  52774. M.addGroup(V, A, h),
  52775. V += A,
  52776. B += y
  52777. }
  52778. Ci.BufferGeometry.call(this),
  52779. this.type = "BoxBufferGeometry",
  52780. this.parameters = {
  52781. width: e,
  52782. height: t,
  52783. depth: i,
  52784. widthSegments: n,
  52785. heightSegments: r,
  52786. depthSegments: o
  52787. };
  52788. var M = this;
  52789. n = Math.floor(n) || 1,
  52790. r = Math.floor(r) || 1,
  52791. o = Math.floor(o) || 1;
  52792. var s, l, c, h, u = (h = 0,
  52793. h += (s = n) * (l = r) * 2,
  52794. h += s * (c = o) * 2,
  52795. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  52796. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52797. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52798. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52799. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52800. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52801. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52802. this.setIndex(new Ci.BufferAttribute(R,1)),
  52803. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52804. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52805. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52806. }
  52807. ,
  52808. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52809. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52810. Ci.CircleGeometry = function(e, t, i, n) {
  52811. Ci.Geometry.call(this),
  52812. this.type = "CircleGeometry",
  52813. this.parameters = {
  52814. radius: e,
  52815. segments: t,
  52816. thetaStart: i,
  52817. thetaLength: n
  52818. },
  52819. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52820. }
  52821. ,
  52822. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52823. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52824. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52825. Ci.BufferGeometry.call(this),
  52826. this.type = "CircleBufferGeometry",
  52827. this.parameters = {
  52828. radius: e,
  52829. segments: t,
  52830. thetaStart: i,
  52831. thetaLength: n
  52832. },
  52833. e = e || 50,
  52834. t = void 0 !== t ? Math.max(3, t) : 8,
  52835. i = void 0 !== i ? i : 0,
  52836. n = void 0 !== n ? n : 2 * Math.PI;
  52837. var r = t + 2
  52838. , o = new Float32Array(3 * r)
  52839. , a = new Float32Array(3 * r)
  52840. , s = new Float32Array(2 * r);
  52841. a[2] = 1,
  52842. s[0] = .5,
  52843. s[1] = .5;
  52844. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52845. c += 3,
  52846. h += 2) {
  52847. var u = i + l / t * n;
  52848. o[c] = e * Math.cos(u),
  52849. o[c + 1] = e * Math.sin(u),
  52850. a[c + 2] = 1,
  52851. s[h] = (o[c] / e + 1) / 2,
  52852. s[h + 1] = (o[c + 1] / e + 1) / 2
  52853. }
  52854. var d = [];
  52855. for (c = 1; c <= t; c++)
  52856. d.push(c, c + 1, 0);
  52857. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52858. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52859. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52860. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52861. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52862. }
  52863. ,
  52864. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52865. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52866. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52867. function t(e) {
  52868. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52869. for (i = b,
  52870. t = 1; t <= m; t++)
  52871. I.setXYZ(b, 0, x * s, 0),
  52872. E.setXYZ(b, 0, s, 0),
  52873. !0 === e ? (r.x = t / m,
  52874. r.y = 0) : (r.x = (t - 1) / m,
  52875. r.y = 1),
  52876. _.setXY(b, r.x, r.y),
  52877. b++;
  52878. for (n = b,
  52879. t = 0; t <= m; t++) {
  52880. var l = t / m;
  52881. o.x = a * Math.sin(l * A + y),
  52882. o.y = x * s,
  52883. o.z = a * Math.cos(l * A + y),
  52884. I.setXYZ(b, o.x, o.y, o.z),
  52885. E.setXYZ(b, 0, s, 0),
  52886. _.setXY(b, l, !0 === e ? 1 : 0),
  52887. b++
  52888. }
  52889. for (t = 0; t < m; t++) {
  52890. var c = i + t
  52891. , h = n + t;
  52892. !0 === e ? (C.setX(w, h),
  52893. w++,
  52894. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52895. w++,
  52896. C.setX(w, h)),
  52897. w++,
  52898. C.setX(w, c),
  52899. w++
  52900. }
  52901. }
  52902. Ci.BufferGeometry.call(this),
  52903. this.type = "CylinderBufferGeometry",
  52904. this.parameters = {
  52905. radiusTop: p,
  52906. radiusBottom: f,
  52907. height: g,
  52908. radialSegments: m,
  52909. heightSegments: v,
  52910. openEnded: e,
  52911. thetaStart: y,
  52912. thetaLength: A
  52913. },
  52914. p = void 0 !== p ? p : 20,
  52915. f = void 0 !== f ? f : 20,
  52916. g = void 0 !== g ? g : 100,
  52917. m = Math.floor(m) || 8,
  52918. v = Math.floor(v) || 1,
  52919. e = void 0 !== e && e,
  52920. y = void 0 !== y ? y : 0,
  52921. A = void 0 !== A ? A : 2 * Math.PI;
  52922. var i, n, r = (n = (m + 1) * (v + 1),
  52923. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52924. n), o = (i = m * v * 2 * 3,
  52925. !1 === e && (i += 2 * m * 3),
  52926. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  52927. (function() {
  52928. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52929. for (t = 0; t <= v; t++) {
  52930. var o = []
  52931. , a = t / v
  52932. , s = a * (f - p) + p;
  52933. for (e = 0; e <= m; e++) {
  52934. var l = e / m;
  52935. n.x = s * Math.sin(l * A + y),
  52936. n.y = -a * g + x,
  52937. n.z = s * Math.cos(l * A + y),
  52938. I.setXYZ(b, n.x, n.y, n.z),
  52939. i.copy(n),
  52940. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52941. i.z = Math.cos(l * A + y)),
  52942. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52943. E.setXYZ(b, i.x, i.y, i.z),
  52944. _.setXY(b, l, 1 - a),
  52945. o.push(b),
  52946. b++
  52947. }
  52948. T.push(o)
  52949. }
  52950. for (e = 0; e < m; e++)
  52951. for (t = 0; t < v; t++) {
  52952. var c = T[t][e]
  52953. , h = T[t + 1][e]
  52954. , u = T[t + 1][e + 1]
  52955. , d = T[t][e + 1];
  52956. C.setX(w, c),
  52957. w++,
  52958. C.setX(w, h),
  52959. w++,
  52960. C.setX(w, d),
  52961. w++,
  52962. C.setX(w, h),
  52963. w++,
  52964. C.setX(w, u),
  52965. w++,
  52966. C.setX(w, d),
  52967. w++
  52968. }
  52969. }
  52970. )(),
  52971. !1 === e && (0 < p && t(!0),
  52972. 0 < f && t(!1)),
  52973. this.setIndex(C),
  52974. this.addAttribute("position", I),
  52975. this.addAttribute("normal", E),
  52976. this.addAttribute("uv", _)
  52977. }
  52978. ,
  52979. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52980. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52981. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52982. Ci.Geometry.call(this),
  52983. this.type = "CylinderGeometry",
  52984. this.parameters = {
  52985. radiusTop: e,
  52986. radiusBottom: t,
  52987. height: i,
  52988. radialSegments: n,
  52989. heightSegments: r,
  52990. openEnded: o,
  52991. thetaStart: a,
  52992. thetaLength: s
  52993. },
  52994. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52995. this.mergeVertices()
  52996. }
  52997. ,
  52998. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52999. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53000. Ci.EdgesGeometry = function(e, t) {
  53001. function i(e, t) {
  53002. return e - t
  53003. }
  53004. Ci.BufferGeometry.call(this),
  53005. t = void 0 !== t ? t : 1;
  53006. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53007. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53008. n.mergeVertices(),
  53009. n.computeFaceNormals();
  53010. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53011. for (var d = c[h], p = 0; p < 3; p++) {
  53012. o[0] = d[s[p]],
  53013. o[1] = d[s[(p + 1) % 3]],
  53014. o.sort(i),
  53015. void 0 === a[g = o.toString()] ? a[g] = {
  53016. vert1: o[0],
  53017. vert2: o[1],
  53018. face1: h,
  53019. face2: void 0
  53020. } : a[g].face2 = h
  53021. }
  53022. var f = [];
  53023. for (var g in a) {
  53024. var m = a[g];
  53025. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53026. var v = l[m.vert1];
  53027. f.push(v.x),
  53028. f.push(v.y),
  53029. f.push(v.z),
  53030. v = l[m.vert2],
  53031. f.push(v.x),
  53032. f.push(v.y),
  53033. f.push(v.z)
  53034. }
  53035. }
  53036. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53037. }
  53038. ,
  53039. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53040. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53041. Ci.ExtrudeGeometry = function(e, t) {
  53042. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53043. this.type = "ExtrudeGeometry",
  53044. e = Array.isArray(e) ? e : [e],
  53045. this.addShapeList(e, t),
  53046. void this.computeFaceNormals())
  53047. }
  53048. ;
  53049. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53050. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53051. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53052. for (var i = e.length, n = 0; n < i; n++) {
  53053. var r = e[n];
  53054. this.addShape(r, t)
  53055. }
  53056. }
  53057. ,
  53058. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53059. function i(e, t, i) {
  53060. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53061. t.clone().multiplyScalar(i).add(e)
  53062. }
  53063. function n(e, t, i) {
  53064. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  53065. if (Math.abs(u) > Number.EPSILON) {
  53066. var d = Math.sqrt(h)
  53067. , p = Math.sqrt(l * l + c * c)
  53068. , f = t.x - s / d
  53069. , g = t.y + a / d
  53070. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53071. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53072. if (v <= 2)
  53073. return new Ci.Vector2(n,r);
  53074. o = Math.sqrt(v / 2)
  53075. } else {
  53076. var y = !1;
  53077. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53078. o = y ? (n = -s,
  53079. r = a,
  53080. Math.sqrt(h)) : (n = a,
  53081. r = s,
  53082. Math.sqrt(h / 2))
  53083. }
  53084. return new Ci.Vector2(n / o,r / o)
  53085. }
  53086. function r(e, t) {
  53087. var i, n;
  53088. for (G = e.length; 0 <= --G; ) {
  53089. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53090. var r = 0
  53091. , o = A + 2 * m;
  53092. for (r = 0; r < o; r++) {
  53093. var a = U * r
  53094. , s = U * (r + 1);
  53095. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53096. }
  53097. }
  53098. }
  53099. function o(e, t, i) {
  53100. T.vertices.push(new Ci.Vector3(e,t,i))
  53101. }
  53102. function a(e, t, i) {
  53103. e += x,
  53104. t += x,
  53105. i += x,
  53106. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53107. var n = E.generateTopUV(T, e, t, i);
  53108. T.faceVertexUvs[0].push(n)
  53109. }
  53110. function l(e, t, i, n) {
  53111. e += x,
  53112. t += x,
  53113. i += x,
  53114. n += x,
  53115. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53116. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53117. var r = E.generateSideWallUV(T, e, t, i, n);
  53118. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53119. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53120. }
  53121. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  53122. C && (s = C.getSpacedPoints(A),
  53123. v = !(I = !0),
  53124. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53125. h = new Ci.Vector3,
  53126. u = new Ci.Vector3,
  53127. d = new Ci.Vector3),
  53128. v || (g = f = m = 0);
  53129. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53130. if (P) {
  53131. for (M = M.reverse(),
  53132. b = 0,
  53133. w = R.length; b < w; b++)
  53134. _ = R[b],
  53135. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53136. P = !1
  53137. }
  53138. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53139. , L = M;
  53140. for (b = 0,
  53141. w = R.length; b < w; b++)
  53142. _ = R[b],
  53143. M = M.concat(_);
  53144. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  53145. j++,
  53146. Y++)
  53147. j === W && (j = 0),
  53148. Y === W && (Y = 0),
  53149. z[G] = n(L[G], L[j], L[Y]);
  53150. var q, X, Z = [], K = z.concat();
  53151. for (b = 0,
  53152. w = R.length; b < w; b++) {
  53153. for (_ = R[b],
  53154. q = [],
  53155. G = 0,
  53156. j = (W = _.length) - 1,
  53157. Y = G + 1; G < W; G++,
  53158. j++,
  53159. Y++)
  53160. j === W && (j = 0),
  53161. Y === W && (Y = 0),
  53162. q[G] = n(_[G], _[j], _[Y]);
  53163. Z.push(q),
  53164. K = K.concat(q)
  53165. }
  53166. for (D = 0; D < m; D++) {
  53167. for (B = f * (1 - (F = D / m)),
  53168. N = g * Math.sin(F * Math.PI / 2),
  53169. G = 0,
  53170. W = L.length; G < W; G++)
  53171. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53172. for (b = 0,
  53173. w = R.length; b < w; b++)
  53174. for (_ = R[b],
  53175. q = Z[b],
  53176. G = 0,
  53177. W = _.length; G < W; G++)
  53178. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53179. }
  53180. for (N = g,
  53181. G = 0; G < U; G++)
  53182. V = v ? i(M[G], K[G], N) : M[G],
  53183. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53184. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53185. d.copy(s[0]).add(u).add(h),
  53186. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53187. for (X = 1; X <= A; X++)
  53188. for (G = 0; G < U; G++)
  53189. V = v ? i(M[G], K[G], N) : M[G],
  53190. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53191. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53192. d.copy(s[X]).add(u).add(h),
  53193. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53194. for (D = m - 1; 0 <= D; D--) {
  53195. for (B = f * (1 - (F = D / m)),
  53196. N = g * Math.sin(F * Math.PI / 2),
  53197. G = 0,
  53198. W = L.length; G < W; G++)
  53199. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53200. for (b = 0,
  53201. w = R.length; b < w; b++)
  53202. for (_ = R[b],
  53203. q = Z[b],
  53204. G = 0,
  53205. W = _.length; G < W; G++)
  53206. V = i(_[G], q[G], N),
  53207. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53208. }
  53209. (function() {
  53210. if (v) {
  53211. var e = 0
  53212. , t = U * e;
  53213. for (G = 0; G < H; G++)
  53214. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53215. for (t = U * (e = A + 2 * m),
  53216. G = 0; G < H; G++)
  53217. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53218. } else {
  53219. for (G = 0; G < H; G++)
  53220. a((k = O[G])[2], k[1], k[0]);
  53221. for (G = 0; G < H; G++)
  53222. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53223. }
  53224. }
  53225. )(),
  53226. function() {
  53227. var e = 0;
  53228. for (r(L, e),
  53229. e += L.length,
  53230. b = 0,
  53231. w = R.length; b < w; b++)
  53232. r(_ = R[b], e),
  53233. e += _.length
  53234. }()
  53235. }
  53236. ,
  53237. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53238. generateTopUV: function(e, t, i, n) {
  53239. var r = e.vertices
  53240. , o = r[t]
  53241. , a = r[i]
  53242. , s = r[n];
  53243. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53244. },
  53245. generateSideWallUV: function(e, t, i, n, r) {
  53246. var o = e.vertices
  53247. , a = o[t]
  53248. , s = o[i]
  53249. , l = o[n]
  53250. , c = o[r];
  53251. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  53252. }
  53253. },
  53254. Ci.ShapeGeometry = function(e, t) {
  53255. Ci.Geometry.call(this),
  53256. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53257. this.addShapeList(e, t),
  53258. this.computeFaceNormals()
  53259. }
  53260. ,
  53261. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53262. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53263. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53264. for (var i = 0, n = e.length; i < n; i++)
  53265. this.addShape(e[i], t);
  53266. return this
  53267. }
  53268. ,
  53269. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53270. void 0 === t && (t = {});
  53271. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  53272. if (d) {
  53273. for (h = h.reverse(),
  53274. i = 0,
  53275. n = u.length; i < n; i++)
  53276. r = u[i],
  53277. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53278. d = !1
  53279. }
  53280. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53281. for (i = 0,
  53282. n = u.length; i < n; i++)
  53283. r = u[i],
  53284. h = h.concat(r);
  53285. var f, g, m = h.length, v = p.length;
  53286. for (i = 0; i < m; i++)
  53287. f = h[i],
  53288. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53289. for (i = 0; i < v; i++) {
  53290. var y = (g = p[i])[0] + l
  53291. , A = g[1] + l
  53292. , C = g[2] + l;
  53293. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53294. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53295. }
  53296. }
  53297. ,
  53298. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53299. Ci.BufferGeometry.call(this),
  53300. this.type = "LatheBufferGeometry",
  53301. this.parameters = {
  53302. points: e,
  53303. segments: t,
  53304. phiStart: i,
  53305. phiLength: n
  53306. },
  53307. t = Math.floor(t) || 12,
  53308. i = i || 0,
  53309. n = n || 2 * Math.PI,
  53310. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53311. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  53312. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53313. for (o = 0; o <= t; o++) {
  53314. var v = i + o * f * n
  53315. , y = Math.sin(v)
  53316. , A = Math.cos(v);
  53317. for (a = 0; a <= e.length - 1; a++)
  53318. g.x = e[a].x * y,
  53319. g.y = e[a].y,
  53320. g.z = e[a].x * A,
  53321. h.setXYZ(d, g.x, g.y, g.z),
  53322. m.x = o / t,
  53323. m.y = a / (e.length - 1),
  53324. u.setXY(d, m.x, m.y),
  53325. d++
  53326. }
  53327. for (o = 0; o < t; o++)
  53328. for (a = 0; a < e.length - 1; a++) {
  53329. var C = r = a + o * e.length
  53330. , I = r + e.length
  53331. , E = r + e.length + 1
  53332. , _ = r + 1;
  53333. c.setX(p, C),
  53334. p++,
  53335. c.setX(p, I),
  53336. p++,
  53337. c.setX(p, _),
  53338. p++,
  53339. c.setX(p, I),
  53340. p++,
  53341. c.setX(p, E),
  53342. p++,
  53343. c.setX(p, _),
  53344. p++
  53345. }
  53346. if (this.setIndex(c),
  53347. this.addAttribute("position", h),
  53348. this.addAttribute("uv", u),
  53349. this.computeVertexNormals(),
  53350. n === 2 * Math.PI) {
  53351. var b = this.attributes.normal.array
  53352. , w = new Ci.Vector3
  53353. , T = new Ci.Vector3
  53354. , x = new Ci.Vector3;
  53355. for (r = t * e.length * 3,
  53356. a = o = 0; o < e.length; o++,
  53357. a += 3)
  53358. w.x = b[a + 0],
  53359. w.y = b[a + 1],
  53360. w.z = b[a + 2],
  53361. T.x = b[r + a + 0],
  53362. T.y = b[r + a + 1],
  53363. T.z = b[r + a + 2],
  53364. x.addVectors(w, T).normalize(),
  53365. b[a + 0] = b[r + a + 0] = x.x,
  53366. b[a + 1] = b[r + a + 1] = x.y,
  53367. b[a + 2] = b[r + a + 2] = x.z
  53368. }
  53369. }
  53370. ,
  53371. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53372. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53373. Ci.LatheGeometry = function(e, t, i, n) {
  53374. Ci.Geometry.call(this),
  53375. this.type = "LatheGeometry",
  53376. this.parameters = {
  53377. points: e,
  53378. segments: t,
  53379. phiStart: i,
  53380. phiLength: n
  53381. },
  53382. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53383. this.mergeVertices()
  53384. }
  53385. ,
  53386. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53387. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53388. Ci.PlaneGeometry = function(e, t, i, n) {
  53389. Ci.Geometry.call(this),
  53390. this.type = "PlaneGeometry",
  53391. this.parameters = {
  53392. width: e,
  53393. height: t,
  53394. widthSegments: i,
  53395. heightSegments: n
  53396. },
  53397. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53398. }
  53399. ,
  53400. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53401. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53402. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53403. Ci.BufferGeometry.call(this),
  53404. this.type = "PlaneBufferGeometry",
  53405. this.parameters = {
  53406. width: e,
  53407. height: t,
  53408. widthSegments: i,
  53409. heightSegments: n
  53410. };
  53411. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53412. for (var y = v * u - o, A = 0; A < l; A++) {
  53413. var C = A * h - r;
  53414. d[g] = C,
  53415. d[g + 1] = -y,
  53416. p[g + 2] = 1,
  53417. f[m] = A / a,
  53418. f[m + 1] = 1 - v / s,
  53419. g += 3,
  53420. m += 2
  53421. }
  53422. g = 0;
  53423. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53424. for (v = 0; v < s; v++)
  53425. for (A = 0; A < a; A++) {
  53426. var E = A + l * v
  53427. , _ = A + l * (v + 1)
  53428. , b = A + 1 + l * (v + 1)
  53429. , w = A + 1 + l * v;
  53430. I[g] = E,
  53431. I[g + 1] = _,
  53432. I[g + 2] = w,
  53433. I[g + 3] = _,
  53434. I[g + 4] = b,
  53435. I[g + 5] = w,
  53436. g += 6
  53437. }
  53438. this.setIndex(new Ci.BufferAttribute(I,1)),
  53439. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53440. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53441. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53442. }
  53443. ,
  53444. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53445. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53446. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53447. Ci.BufferGeometry.call(this),
  53448. this.type = "RingBufferGeometry",
  53449. this.parameters = {
  53450. innerRadius: e,
  53451. outerRadius: t,
  53452. thetaSegments: i,
  53453. phiSegments: n,
  53454. thetaStart: r,
  53455. thetaLength: o
  53456. },
  53457. e = e || 20,
  53458. t = t || 50,
  53459. r = void 0 !== r ? r : 0,
  53460. o = void 0 !== o ? o : 2 * Math.PI;
  53461. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  53462. for (s = 0; s <= n; s++) {
  53463. for (l = 0; l <= i; l++)
  53464. a = r + l / i * o,
  53465. A.x = v * Math.cos(a),
  53466. A.y = v * Math.sin(a),
  53467. d.setXYZ(g, A.x, A.y, A.z),
  53468. p.setXYZ(g, 0, 0, 1),
  53469. C.x = (A.x / t + 1) / 2,
  53470. C.y = (A.y / t + 1) / 2,
  53471. f.setXY(g, C.x, C.y),
  53472. g++;
  53473. v += y
  53474. }
  53475. for (s = 0; s < n; s++) {
  53476. var I = s * (i + 1);
  53477. for (l = 0; l < i; l++) {
  53478. var E = a = l + I
  53479. , _ = a + i + 1
  53480. , b = a + i + 2
  53481. , w = a + 1;
  53482. u.setX(m, E),
  53483. m++,
  53484. u.setX(m, _),
  53485. m++,
  53486. u.setX(m, b),
  53487. m++,
  53488. u.setX(m, E),
  53489. m++,
  53490. u.setX(m, b),
  53491. m++,
  53492. u.setX(m, w),
  53493. m++
  53494. }
  53495. }
  53496. this.setIndex(u),
  53497. this.addAttribute("position", d),
  53498. this.addAttribute("normal", p),
  53499. this.addAttribute("uv", f)
  53500. }
  53501. ,
  53502. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53503. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53504. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53505. Ci.Geometry.call(this),
  53506. this.type = "RingGeometry",
  53507. this.parameters = {
  53508. innerRadius: e,
  53509. outerRadius: t,
  53510. thetaSegments: i,
  53511. phiSegments: n,
  53512. thetaStart: r,
  53513. thetaLength: o
  53514. },
  53515. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53516. }
  53517. ,
  53518. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53519. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53520. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53521. Ci.Geometry.call(this),
  53522. this.type = "SphereGeometry",
  53523. this.parameters = {
  53524. radius: e,
  53525. widthSegments: t,
  53526. heightSegments: i,
  53527. phiStart: n,
  53528. phiLength: r,
  53529. thetaStart: o,
  53530. thetaLength: a
  53531. },
  53532. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53533. }
  53534. ,
  53535. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53536. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53537. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53538. Ci.BufferGeometry.call(this),
  53539. this.type = "SphereBufferGeometry",
  53540. this.parameters = {
  53541. radius: e,
  53542. widthSegments: t,
  53543. heightSegments: i,
  53544. phiStart: n,
  53545. phiLength: r,
  53546. thetaStart: o,
  53547. thetaLength: a
  53548. },
  53549. e = e || 50,
  53550. t = Math.max(3, Math.floor(t) || 8),
  53551. i = Math.max(2, Math.floor(i) || 6),
  53552. n = void 0 !== n ? n : 0,
  53553. r = void 0 !== r ? r : 2 * Math.PI;
  53554. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  53555. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53556. var A = y / t
  53557. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53558. , I = e * Math.cos(o + v * a)
  53559. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53560. f.set(C, I, E).normalize(),
  53561. c.setXYZ(d, C, I, E),
  53562. h.setXYZ(d, f.x, f.y, f.z),
  53563. u.setXY(d, A, 1 - v),
  53564. m.push(d),
  53565. d++
  53566. }
  53567. p.push(m)
  53568. }
  53569. var _ = [];
  53570. for (g = 0; g < i; g++)
  53571. for (y = 0; y < t; y++) {
  53572. var b = p[g][y + 1]
  53573. , w = p[g][y]
  53574. , T = p[g + 1][y]
  53575. , x = p[g + 1][y + 1];
  53576. (0 !== g || 0 < o) && _.push(b, w, x),
  53577. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53578. }
  53579. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53580. this.addAttribute("position", c),
  53581. this.addAttribute("normal", h),
  53582. this.addAttribute("uv", u),
  53583. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53584. }
  53585. ,
  53586. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53587. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53588. Ci.TextGeometry = function(e, t) {
  53589. var i = (t = t || {}).font;
  53590. if (i instanceof Ci.Font == 0)
  53591. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53592. new Ci.Geometry;
  53593. var n = i.generateShapes(e, t.size, t.curveSegments);
  53594. t.amount = void 0 !== t.height ? t.height : 50,
  53595. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53596. void 0 === t.bevelSize && (t.bevelSize = 8),
  53597. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53598. Ci.ExtrudeGeometry.call(this, n, t),
  53599. this.type = "TextGeometry"
  53600. }
  53601. ,
  53602. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53603. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53604. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53605. Ci.BufferGeometry.call(this),
  53606. this.type = "TorusBufferGeometry",
  53607. this.parameters = {
  53608. radius: e,
  53609. tube: t,
  53610. radialSegments: i,
  53611. tubularSegments: n,
  53612. arc: r
  53613. },
  53614. e = e || 100,
  53615. t = t || 40,
  53616. i = Math.floor(i) || 8,
  53617. n = Math.floor(n) || 6,
  53618. r = r || 2 * Math.PI;
  53619. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  53620. for (o = 0; o <= i; o++)
  53621. for (a = 0; a <= n; a++) {
  53622. var A = a / n * r
  53623. , C = o / i * Math.PI * 2;
  53624. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53625. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53626. v.z = t * Math.sin(C),
  53627. h[p] = v.x,
  53628. h[p + 1] = v.y,
  53629. h[p + 2] = v.z,
  53630. m.x = e * Math.cos(A),
  53631. m.y = e * Math.sin(A),
  53632. y.subVectors(v, m).normalize(),
  53633. u[p] = y.x,
  53634. u[p + 1] = y.y,
  53635. u[p + 2] = y.z,
  53636. d[f] = a / n,
  53637. d[f + 1] = o / i,
  53638. p += 3,
  53639. f += 2
  53640. }
  53641. for (o = 1; o <= i; o++)
  53642. for (a = 1; a <= n; a++) {
  53643. var I = (n + 1) * o + a - 1
  53644. , E = (n + 1) * (o - 1) + a - 1
  53645. , _ = (n + 1) * (o - 1) + a
  53646. , b = (n + 1) * o + a;
  53647. c[g] = I,
  53648. c[g + 1] = E,
  53649. c[g + 2] = b,
  53650. c[g + 3] = E,
  53651. c[g + 4] = _,
  53652. c[g + 5] = b,
  53653. g += 6
  53654. }
  53655. this.setIndex(new Ci.BufferAttribute(c,1)),
  53656. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53657. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53658. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53659. }
  53660. ,
  53661. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53662. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53663. Ci.TorusGeometry = function(e, t, i, n, r) {
  53664. Ci.Geometry.call(this),
  53665. this.type = "TorusGeometry",
  53666. this.parameters = {
  53667. radius: e,
  53668. tube: t,
  53669. radialSegments: i,
  53670. tubularSegments: n,
  53671. arc: r
  53672. },
  53673. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53674. }
  53675. ,
  53676. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53677. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53678. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53679. function a(e, t, i, n, r) {
  53680. var o = Math.cos(e)
  53681. , a = Math.sin(e)
  53682. , s = i / t * e
  53683. , l = Math.cos(s);
  53684. r.x = n * (2 + l) * .5 * o,
  53685. r.y = n * (2 + l) * a * .5,
  53686. r.z = n * Math.sin(s) * .5
  53687. }
  53688. Ci.BufferGeometry.call(this),
  53689. this.type = "TorusKnotBufferGeometry",
  53690. this.parameters = {
  53691. radius: e,
  53692. tube: t,
  53693. tubularSegments: i,
  53694. radialSegments: n,
  53695. p: r,
  53696. q: o
  53697. },
  53698. e = e || 100,
  53699. t = t || 40,
  53700. i = Math.floor(i) || 64,
  53701. r = r || 2,
  53702. o = o || 3;
  53703. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  53704. for (s = 0; s <= i; ++s) {
  53705. var w = s / i * r * Math.PI * 2;
  53706. for (a(w, r, o, e, C),
  53707. a(.01 + w, r, o, e, I),
  53708. _.subVectors(I, C),
  53709. b.addVectors(I, C),
  53710. E.crossVectors(_, b),
  53711. b.crossVectors(E, _),
  53712. E.normalize(),
  53713. b.normalize(),
  53714. l = 0; l <= n; ++l) {
  53715. var T = l / n * Math.PI * 2
  53716. , x = -t * Math.cos(T)
  53717. , S = t * Math.sin(T);
  53718. v.x = C.x + (x * b.x + S * E.x),
  53719. v.y = C.y + (x * b.y + S * E.y),
  53720. v.z = C.z + (x * b.z + S * E.z),
  53721. d.setXYZ(g, v.x, v.y, v.z),
  53722. y.subVectors(v, C).normalize(),
  53723. p.setXYZ(g, y.x, y.y, y.z),
  53724. A.x = s / i,
  53725. A.y = l / n,
  53726. f.setXY(g, A.x, A.y),
  53727. g++
  53728. }
  53729. }
  53730. for (l = 1; l <= i; l++)
  53731. for (s = 1; s <= n; s++) {
  53732. var M = (n + 1) * (l - 1) + (s - 1)
  53733. , R = (n + 1) * l + (s - 1)
  53734. , P = (n + 1) * l + s
  53735. , O = (n + 1) * (l - 1) + s;
  53736. u.setX(m, M),
  53737. m++,
  53738. u.setX(m, R),
  53739. m++,
  53740. u.setX(m, O),
  53741. m++,
  53742. u.setX(m, R),
  53743. m++,
  53744. u.setX(m, P),
  53745. m++,
  53746. u.setX(m, O),
  53747. m++
  53748. }
  53749. this.setIndex(u),
  53750. this.addAttribute("position", d),
  53751. this.addAttribute("normal", p),
  53752. this.addAttribute("uv", f)
  53753. }
  53754. ,
  53755. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53756. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53757. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53758. Ci.Geometry.call(this),
  53759. this.type = "TorusKnotGeometry",
  53760. this.parameters = {
  53761. radius: e,
  53762. tube: t,
  53763. tubularSegments: i,
  53764. radialSegments: n,
  53765. p: r,
  53766. q: o
  53767. },
  53768. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53769. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53770. this.mergeVertices()
  53771. }
  53772. ,
  53773. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53774. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53775. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53776. Ci.Geometry.call(this),
  53777. this.type = "TubeGeometry",
  53778. this.parameters = {
  53779. path: e,
  53780. segments: t,
  53781. radius: i,
  53782. radialSegments: n,
  53783. closed: r,
  53784. taper: o
  53785. },
  53786. t = t || 64,
  53787. i = i || 1,
  53788. n = n || 8,
  53789. r = r || !1,
  53790. o = o || Ci.TubeGeometry.NoTaper;
  53791. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  53792. for (this.tangents = D,
  53793. this.normals = N,
  53794. this.binormals = F,
  53795. f = 0; f < P; f++)
  53796. for (M[f] = [],
  53797. l = f / (P - 1),
  53798. p = e.getPointAt(l),
  53799. D[f],
  53800. a = N[f],
  53801. s = F[f],
  53802. h = i * o(l),
  53803. g = 0; g < n; g++)
  53804. c = g / n * 2 * Math.PI,
  53805. u = -h * Math.cos(c),
  53806. d = h * Math.sin(c),
  53807. O.copy(p),
  53808. O.x += u * a.x + d * s.x,
  53809. O.y += u * a.y + d * s.y,
  53810. O.z += u * a.z + d * s.z,
  53811. M[f][g] = (T = O.x,
  53812. x = O.y,
  53813. S = O.z,
  53814. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53815. for (f = 0; f < t; f++)
  53816. for (g = 0; g < n; g++)
  53817. m = r ? (f + 1) % t : f + 1,
  53818. v = (g + 1) % n,
  53819. y = M[f][g],
  53820. A = M[m][g],
  53821. C = M[m][v],
  53822. I = M[f][v],
  53823. E = new Ci.Vector2(f / t,g / n),
  53824. _ = new Ci.Vector2((f + 1) / t,g / n),
  53825. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53826. w = new Ci.Vector2(f / t,(g + 1) / n),
  53827. this.faces.push(new Ci.Face3(y,A,I)),
  53828. this.faceVertexUvs[0].push([E, _, w]),
  53829. this.faces.push(new Ci.Face3(A,C,I)),
  53830. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53831. this.computeFaceNormals(),
  53832. this.computeVertexNormals()
  53833. }
  53834. ,
  53835. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53836. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53837. Ci.TubeGeometry.NoTaper = function(e) {
  53838. return 1
  53839. }
  53840. ,
  53841. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53842. return Math.sin(Math.PI * e)
  53843. }
  53844. ,
  53845. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53846. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  53847. for (this.tangents = u,
  53848. this.normals = d,
  53849. this.binormals = p,
  53850. l = 0; l < m; l++)
  53851. c = l / (m - 1),
  53852. u[l] = e.getTangentAt(c),
  53853. u[l].normalize();
  53854. for (d[0] = new Ci.Vector3,
  53855. p[0] = new Ci.Vector3,
  53856. r = Number.MAX_VALUE,
  53857. o = Math.abs(u[0].x),
  53858. a = Math.abs(u[0].y),
  53859. s = Math.abs(u[0].z),
  53860. o <= r && (r = o,
  53861. h.set(1, 0, 0)),
  53862. a <= r && (r = a,
  53863. h.set(0, 1, 0)),
  53864. s <= r && h.set(0, 0, 1),
  53865. f.crossVectors(u[0], h).normalize(),
  53866. d[0].crossVectors(u[0], f),
  53867. p[0].crossVectors(u[0], d[0]),
  53868. l = 1; l < m; l++)
  53869. d[l] = d[l - 1].clone(),
  53870. p[l] = p[l - 1].clone(),
  53871. f.crossVectors(u[l - 1], u[l]),
  53872. f.length() > Number.EPSILON && (f.normalize(),
  53873. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53874. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53875. p[l].crossVectors(u[l], d[l]);
  53876. if (i)
  53877. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53878. n /= m - 1,
  53879. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53880. l = 1; l < m; l++)
  53881. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53882. p[l].crossVectors(u[l], d[l])
  53883. }
  53884. ,
  53885. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53886. function f(e) {
  53887. var t = e.normalize().clone();
  53888. t.index = m.vertices.push(t) - 1;
  53889. var i = a(e) / 2 / Math.PI + .5
  53890. , n = function(e) {
  53891. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53892. }(e) / Math.PI + .5;
  53893. return t.uv = new Ci.Vector2(i,1 - n),
  53894. t
  53895. }
  53896. function g(e, t, i, n) {
  53897. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53898. m.faces.push(r),
  53899. y.copy(e).add(t).add(i).divideScalar(3);
  53900. var o = a(y);
  53901. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53902. }
  53903. function r(e, t) {
  53904. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  53905. a[l] = [];
  53906. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  53907. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53908. }
  53909. for (l = 0; l < i; l++)
  53910. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53911. var p = Math.floor(d / 2);
  53912. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  53913. }
  53914. }
  53915. function a(e) {
  53916. return Math.atan2(e.z, -e.x)
  53917. }
  53918. function s(e, t, i) {
  53919. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53920. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53921. e.clone()
  53922. }
  53923. Ci.Geometry.call(this),
  53924. this.type = "PolyhedronGeometry",
  53925. this.parameters = {
  53926. vertices: e,
  53927. indices: t,
  53928. radius: i,
  53929. detail: n
  53930. },
  53931. i = i || 1,
  53932. n = n || 0;
  53933. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53934. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53935. var c = this.vertices
  53936. , h = []
  53937. , u = (o = 0,
  53938. 0);
  53939. for (l = t.length; o < l; o += 3,
  53940. u++) {
  53941. var d = c[t[o]]
  53942. , p = c[t[o + 1]]
  53943. , v = c[t[o + 2]];
  53944. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53945. }
  53946. var y = new Ci.Vector3;
  53947. for (o = 0,
  53948. l = h.length; o < l; o++)
  53949. r(h[o], n);
  53950. for (o = 0,
  53951. l = this.faceVertexUvs[0].length; o < l; o++) {
  53952. var A = this.faceVertexUvs[0][o]
  53953. , C = A[0].x
  53954. , I = A[1].x
  53955. , E = A[2].x
  53956. , _ = Math.max(C, I, E)
  53957. , b = Math.min(C, I, E);
  53958. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53959. I < .2 && (A[1].x += 1),
  53960. E < .2 && (A[2].x += 1))
  53961. }
  53962. for (o = 0,
  53963. l = this.vertices.length; o < l; o++)
  53964. this.vertices[o].multiplyScalar(i);
  53965. this.mergeVertices(),
  53966. this.computeFaceNormals(),
  53967. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53968. }
  53969. ,
  53970. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53971. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53972. Ci.DodecahedronGeometry = function(e, t) {
  53973. var i = (1 + Math.sqrt(5)) / 2
  53974. , n = 1 / i
  53975. , r = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  53976. Ci.PolyhedronGeometry.call(this, r, [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], e, t),
  53977. this.type = "DodecahedronGeometry",
  53978. this.parameters = {
  53979. radius: e,
  53980. detail: t
  53981. }
  53982. }
  53983. ,
  53984. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53985. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53986. Ci.IcosahedronGeometry = function(e, t) {
  53987. var i = (1 + Math.sqrt(5)) / 2
  53988. , n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1];
  53989. Ci.PolyhedronGeometry.call(this, n, [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1], e, t),
  53990. this.type = "IcosahedronGeometry",
  53991. this.parameters = {
  53992. radius: e,
  53993. detail: t
  53994. }
  53995. }
  53996. ,
  53997. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53998. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53999. Ci.OctahedronGeometry = function(e, t) {
  54000. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  54001. this.type = "OctahedronGeometry",
  54002. this.parameters = {
  54003. radius: e,
  54004. detail: t
  54005. }
  54006. }
  54007. ,
  54008. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54009. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54010. Ci.TetrahedronGeometry = function(e, t) {
  54011. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  54012. this.type = "TetrahedronGeometry",
  54013. this.parameters = {
  54014. radius: e,
  54015. detail: t
  54016. }
  54017. }
  54018. ,
  54019. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54020. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54021. Ci.ParametricGeometry = function(e, t, i) {
  54022. Ci.Geometry.call(this),
  54023. this.type = "ParametricGeometry",
  54024. this.parameters = {
  54025. func: e,
  54026. slices: t,
  54027. stacks: i
  54028. };
  54029. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  54030. for (n = 0; n <= i; n++)
  54031. for (a = n / i,
  54032. r = 0; r <= t; r++)
  54033. o = e(r / t, a),
  54034. g.push(o);
  54035. for (n = 0; n < i; n++)
  54036. for (r = 0; r < t; r++)
  54037. l = (s = n * y + r) + 1,
  54038. c = (n + 1) * y + r + 1,
  54039. h = (n + 1) * y + r,
  54040. u = new Ci.Vector2(r / t,n / i),
  54041. d = new Ci.Vector2((r + 1) / t,n / i),
  54042. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54043. f = new Ci.Vector2(r / t,(n + 1) / i),
  54044. m.push(new Ci.Face3(s,l,h)),
  54045. v.push([u, d, f]),
  54046. m.push(new Ci.Face3(l,c,h)),
  54047. v.push([d.clone(), p, f.clone()]);
  54048. this.computeFaceNormals(),
  54049. this.computeVertexNormals()
  54050. }
  54051. ,
  54052. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54053. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54054. Ci.WireframeGeometry = function(e) {
  54055. function t(e, t) {
  54056. return e - t
  54057. }
  54058. Ci.BufferGeometry.call(this);
  54059. var i = [0, 0]
  54060. , n = {}
  54061. , r = ["a", "b", "c"];
  54062. if (e instanceof Ci.Geometry) {
  54063. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54064. for (var u = a[c], d = 0; d < 3; d++) {
  54065. i[0] = u[r[d]],
  54066. i[1] = u[r[(d + 1) % 3]],
  54067. i.sort(t),
  54068. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54069. l[2 * s + 1] = i[1],
  54070. n[E] = !0,
  54071. s++)
  54072. }
  54073. var p = new Float32Array(2 * s * 3);
  54074. for (c = 0,
  54075. h = s; c < h; c++)
  54076. for (d = 0; d < 2; d++) {
  54077. var f = o[l[2 * c + d]];
  54078. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54079. p[_ + 1] = f.y,
  54080. p[_ + 2] = f.z
  54081. }
  54082. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54083. } else if (e instanceof Ci.BufferGeometry)
  54084. if (null !== e.index) {
  54085. var g = e.index.array
  54086. , m = (o = e.attributes.position,
  54087. e.groups);
  54088. s = 0;
  54089. 0 === m.length && e.addGroup(0, g.length);
  54090. l = new Uint32Array(2 * g.length);
  54091. for (var v = 0, y = m.length; v < y; ++v)
  54092. for (var A = m[v], C = A.start, I = (c = C,
  54093. C + A.count); c < I; c += 3)
  54094. for (d = 0; d < 3; d++) {
  54095. var E;
  54096. i[0] = g[c + d],
  54097. i[1] = g[c + (d + 1) % 3],
  54098. i.sort(t),
  54099. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54100. l[2 * s + 1] = i[1],
  54101. n[E] = !0,
  54102. s++)
  54103. }
  54104. for (p = new Float32Array(2 * s * 3),
  54105. c = 0,
  54106. h = s; c < h; c++)
  54107. for (d = 0; d < 2; d++) {
  54108. var _ = 6 * c + 3 * d
  54109. , b = l[2 * c + d];
  54110. p[_ + 0] = o.getX(b),
  54111. p[_ + 1] = o.getY(b),
  54112. p[_ + 2] = o.getZ(b)
  54113. }
  54114. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54115. } else {
  54116. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54117. for (p = new Float32Array(2 * s * 3),
  54118. c = 0,
  54119. h = w; c < h; c++)
  54120. for (d = 0; d < 3; d++) {
  54121. var T = 9 * c + 3 * d;
  54122. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54123. p[_ + 1] = o[1 + T],
  54124. p[_ + 2] = o[2 + T];
  54125. b = 9 * c + (d + 1) % 3 * 3;
  54126. p[_ + 3] = o[b],
  54127. p[_ + 4] = o[b + 1],
  54128. p[_ + 5] = o[b + 2]
  54129. }
  54130. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54131. }
  54132. }
  54133. ,
  54134. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54135. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54136. Ci.AxisHelper = function(e) {
  54137. e = e || 1;
  54138. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54139. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54140. , n = new Ci.BufferGeometry;
  54141. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54142. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54143. var r = new Ci.LineBasicMaterial({
  54144. vertexColors: Ci.VertexColors
  54145. });
  54146. Ci.LineSegments.call(this, n, r)
  54147. }
  54148. ,
  54149. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54150. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54151. Ci.ArrowHelper = function() {
  54152. var a = new Ci.Geometry;
  54153. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54154. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54155. return s.translate(0, -.5, 0),
  54156. function(e, t, i, n, r, o) {
  54157. Ci.Object3D.call(this),
  54158. void 0 === n && (n = 16776960),
  54159. void 0 === i && (i = 1),
  54160. void 0 === r && (r = .2 * i),
  54161. void 0 === o && (o = .2 * r),
  54162. this.position.copy(t),
  54163. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54164. color: n
  54165. })),
  54166. this.line.matrixAutoUpdate = !1,
  54167. this.add(this.line),
  54168. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54169. color: n
  54170. })),
  54171. this.cone.matrixAutoUpdate = !1,
  54172. this.add(this.cone),
  54173. this.setDirection(e),
  54174. this.setLength(i, r, o)
  54175. }
  54176. }(),
  54177. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54178. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54179. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54180. function(e) {
  54181. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  54182. yi = Math.acos(e.y),
  54183. this.quaternion.setFromAxisAngle(Ai, yi))
  54184. }
  54185. ),
  54186. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54187. void 0 === t && (t = .2 * e),
  54188. void 0 === i && (i = .2 * t),
  54189. this.line.scale.set(1, Math.max(0, e - t), 1),
  54190. this.line.updateMatrix(),
  54191. this.cone.scale.set(i, t, i),
  54192. this.cone.position.y = e,
  54193. this.cone.updateMatrix()
  54194. }
  54195. ,
  54196. Ci.ArrowHelper.prototype.setColor = function(e) {
  54197. this.line.material.color.set(e),
  54198. this.cone.material.color.set(e)
  54199. }
  54200. ,
  54201. Ci.BoxHelper = function(e) {
  54202. 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])
  54203. , i = new Float32Array(24)
  54204. , n = new Ci.BufferGeometry;
  54205. n.setIndex(new Ci.BufferAttribute(t,1)),
  54206. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54207. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54208. color: 16776960
  54209. })),
  54210. void 0 !== e && this.update(e)
  54211. }
  54212. ,
  54213. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54214. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54215. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54216. function(e) {
  54217. if (vi.setFromObject(e),
  54218. !vi.isEmpty()) {
  54219. var t = vi.min
  54220. , i = vi.max
  54221. , n = this.geometry.attributes.position
  54222. , r = n.array;
  54223. r[0] = i.x,
  54224. r[1] = i.y,
  54225. r[2] = i.z,
  54226. r[3] = t.x,
  54227. r[4] = i.y,
  54228. r[5] = i.z,
  54229. r[6] = t.x,
  54230. r[7] = t.y,
  54231. r[8] = i.z,
  54232. r[9] = i.x,
  54233. r[10] = t.y,
  54234. r[11] = i.z,
  54235. r[12] = i.x,
  54236. r[13] = i.y,
  54237. r[14] = t.z,
  54238. r[15] = t.x,
  54239. r[16] = i.y,
  54240. r[17] = t.z,
  54241. r[18] = t.x,
  54242. r[19] = t.y,
  54243. r[20] = t.z,
  54244. r[21] = i.x,
  54245. r[22] = t.y,
  54246. r[23] = t.z,
  54247. n.needsUpdate = !0,
  54248. this.geometry.computeBoundingSphere()
  54249. }
  54250. }
  54251. ),
  54252. Ci.BoundingBoxHelper = function(e, t) {
  54253. var i = void 0 !== t ? t : 8947848;
  54254. this.object = e,
  54255. this.box = new Ci.Box3,
  54256. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54257. color: i,
  54258. wireframe: !0
  54259. }))
  54260. }
  54261. ,
  54262. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54263. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54264. Ci.BoundingBoxHelper.prototype.update = function() {
  54265. this.box.setFromObject(this.object),
  54266. this.box.size(this.scale),
  54267. this.box.center(this.position)
  54268. }
  54269. ,
  54270. Ci.CameraHelper = function(e) {
  54271. function t(e, t, i) {
  54272. n(e, i),
  54273. n(t, i)
  54274. }
  54275. function n(e, t) {
  54276. i.vertices.push(new Ci.Vector3),
  54277. i.colors.push(new Ci.Color(t)),
  54278. void 0 === o[e] && (o[e] = []),
  54279. o[e].push(i.vertices.length - 1)
  54280. }
  54281. var i = new Ci.Geometry
  54282. , r = new Ci.LineBasicMaterial({
  54283. color: 16777215,
  54284. vertexColors: Ci.FaceColors
  54285. })
  54286. , o = {}
  54287. , a = 16755200
  54288. , s = 16711680
  54289. , l = 3355443;
  54290. t("n1", "n2", a),
  54291. t("n2", "n4", a),
  54292. t("n4", "n3", a),
  54293. t("n3", "n1", a),
  54294. t("f1", "f2", a),
  54295. t("f2", "f4", a),
  54296. t("f4", "f3", a),
  54297. t("f3", "f1", a),
  54298. t("n1", "f1", a),
  54299. t("n2", "f2", a),
  54300. t("n3", "f3", a),
  54301. t("n4", "f4", a),
  54302. t("p", "n1", s),
  54303. t("p", "n2", s),
  54304. t("p", "n3", s),
  54305. t("p", "n4", s),
  54306. t("u1", "u2", 43775),
  54307. t("u2", "u3", 43775),
  54308. t("u3", "u1", 43775),
  54309. t("c", "t", 16777215),
  54310. t("p", "c", l),
  54311. t("cn1", "cn2", l),
  54312. t("cn3", "cn4", l),
  54313. t("cf1", "cf2", l),
  54314. t("cf3", "cf4", l),
  54315. Ci.LineSegments.call(this, i, r),
  54316. this.camera = e,
  54317. this.camera.updateProjectionMatrix(),
  54318. this.matrix = e.matrixWorld,
  54319. this.matrixAutoUpdate = !1,
  54320. this.pointMap = o,
  54321. this.update()
  54322. }
  54323. ,
  54324. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54325. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54326. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54327. mi = new Ci.Camera,
  54328. function() {
  54329. pi = this.geometry,
  54330. fi = this.pointMap,
  54331. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54332. Ni("c", 0, 0, -1),
  54333. Ni("t", 0, 0, 1),
  54334. Ni("n1", -1, -1, -1),
  54335. Ni("n2", 1, -1, -1),
  54336. Ni("n3", -1, 1, -1),
  54337. Ni("n4", 1, 1, -1),
  54338. Ni("f1", -1, -1, 1),
  54339. Ni("f2", 1, -1, 1),
  54340. Ni("f3", -1, 1, 1),
  54341. Ni("f4", 1, 1, 1),
  54342. Ni("u1", .7, 1.1, -1),
  54343. Ni("u2", -.7, 1.1, -1),
  54344. Ni("u3", 0, 2, -1),
  54345. Ni("cf1", -1, 0, 1),
  54346. Ni("cf2", 1, 0, 1),
  54347. Ni("cf3", 0, -1, 1),
  54348. Ni("cf4", 0, 1, 1),
  54349. Ni("cn1", -1, 0, -1),
  54350. Ni("cn2", 1, 0, -1),
  54351. Ni("cn3", 0, -1, -1),
  54352. Ni("cn4", 0, 1, -1),
  54353. pi.verticesNeedUpdate = !0
  54354. }
  54355. ),
  54356. Ci.DirectionalLightHelper = function(e, t) {
  54357. Ci.Object3D.call(this),
  54358. this.light = e,
  54359. this.light.updateMatrixWorld(),
  54360. this.matrix = e.matrixWorld,
  54361. this.matrixAutoUpdate = !1,
  54362. t = t || 1;
  54363. var i = new Ci.Geometry;
  54364. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54365. var n = new Ci.LineBasicMaterial({
  54366. fog: !1
  54367. });
  54368. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54369. this.lightPlane = new Ci.Line(i,n),
  54370. this.add(this.lightPlane),
  54371. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54372. (n = new Ci.LineBasicMaterial({
  54373. fog: !1
  54374. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54375. this.targetLine = new Ci.Line(i,n),
  54376. this.add(this.targetLine),
  54377. this.update()
  54378. }
  54379. ,
  54380. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54381. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54382. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54383. this.lightPlane.geometry.dispose(),
  54384. this.lightPlane.material.dispose(),
  54385. this.targetLine.geometry.dispose(),
  54386. this.targetLine.material.dispose()
  54387. }
  54388. ,
  54389. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54390. ui = new Ci.Vector3,
  54391. di = new Ci.Vector3,
  54392. function() {
  54393. hi.setFromMatrixPosition(this.light.matrixWorld),
  54394. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54395. di.subVectors(ui, hi),
  54396. this.lightPlane.lookAt(di),
  54397. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54398. this.targetLine.geometry.vertices[1].copy(di),
  54399. this.targetLine.geometry.verticesNeedUpdate = !0,
  54400. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54401. }
  54402. ),
  54403. Ci.EdgesHelper = function(e, t, i) {
  54404. var n = void 0 !== t ? t : 16777215;
  54405. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54406. color: n
  54407. })),
  54408. this.matrix = e.matrixWorld,
  54409. this.matrixAutoUpdate = !1
  54410. }
  54411. ,
  54412. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54413. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54414. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54415. this.object = e,
  54416. this.size = void 0 !== t ? t : 1;
  54417. var r = void 0 !== i ? i : 16776960
  54418. , o = void 0 !== n ? n : 1
  54419. , a = 0
  54420. , s = this.object.geometry;
  54421. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54422. var l = new Ci.BufferGeometry
  54423. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54424. l.addAttribute("position", c),
  54425. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54426. color: r,
  54427. linewidth: o
  54428. })),
  54429. this.matrixAutoUpdate = !1,
  54430. this.update()
  54431. }
  54432. ,
  54433. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54434. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54435. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54436. li = new Ci.Vector3,
  54437. ci = new Ci.Matrix3,
  54438. function() {
  54439. this.object.updateMatrixWorld(!0),
  54440. ci.getNormalMatrix(this.object.matrixWorld);
  54441. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  54442. var l = r[a]
  54443. , c = l.normal;
  54444. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54445. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54446. t.setXYZ(o, si.x, si.y, si.z),
  54447. o += 1,
  54448. t.setXYZ(o, li.x, li.y, li.z),
  54449. o += 1
  54450. }
  54451. return t.needsUpdate = !0,
  54452. this
  54453. }
  54454. ),
  54455. Ci.GridHelper = function(e, t) {
  54456. var i = new Ci.Geometry
  54457. , n = new Ci.LineBasicMaterial({
  54458. vertexColors: Ci.VertexColors
  54459. });
  54460. this.color1 = new Ci.Color(4473924),
  54461. this.color2 = new Ci.Color(8947848);
  54462. for (var r = -e; r <= e; r += t) {
  54463. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  54464. var o = 0 === r ? this.color1 : this.color2;
  54465. i.colors.push(o, o, o, o)
  54466. }
  54467. Ci.LineSegments.call(this, i, n)
  54468. }
  54469. ,
  54470. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54471. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54472. Ci.GridHelper.prototype.setColors = function(e, t) {
  54473. this.color1.set(e),
  54474. this.color2.set(t),
  54475. this.geometry.colorsNeedUpdate = !0
  54476. }
  54477. ,
  54478. Ci.HemisphereLightHelper = function(e, t) {
  54479. Ci.Object3D.call(this),
  54480. this.light = e,
  54481. this.light.updateMatrixWorld(),
  54482. this.matrix = e.matrixWorld,
  54483. this.matrixAutoUpdate = !1,
  54484. this.colors = [new Ci.Color, new Ci.Color];
  54485. var i = new Ci.SphereGeometry(t,4,2);
  54486. i.rotateX(-Math.PI / 2);
  54487. for (var n = 0; n < 8; n++)
  54488. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54489. var r = new Ci.MeshBasicMaterial({
  54490. vertexColors: Ci.FaceColors,
  54491. wireframe: !0
  54492. });
  54493. this.lightSphere = new Ci.Mesh(i,r),
  54494. this.add(this.lightSphere),
  54495. this.update()
  54496. }
  54497. ,
  54498. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54499. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54500. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54501. this.lightSphere.geometry.dispose(),
  54502. this.lightSphere.material.dispose()
  54503. }
  54504. ,
  54505. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54506. function() {
  54507. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54508. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54509. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54510. this.lightSphere.geometry.colorsNeedUpdate = !0
  54511. }
  54512. ),
  54513. Ci.PointLightHelper = function(e, t) {
  54514. this.light = e,
  54515. this.light.updateMatrixWorld();
  54516. var i = new Ci.SphereGeometry(t,4,2)
  54517. , n = new Ci.MeshBasicMaterial({
  54518. wireframe: !0,
  54519. fog: !1
  54520. });
  54521. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54522. Ci.Mesh.call(this, i, n),
  54523. this.matrix = this.light.matrixWorld,
  54524. this.matrixAutoUpdate = !1
  54525. }
  54526. ,
  54527. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54528. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54529. Ci.PointLightHelper.prototype.dispose = function() {
  54530. this.geometry.dispose(),
  54531. this.material.dispose()
  54532. }
  54533. ,
  54534. Ci.PointLightHelper.prototype.update = function() {
  54535. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54536. }
  54537. ,
  54538. Ci.SkeletonHelper = function(e) {
  54539. this.bones = this.getBoneList(e);
  54540. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54541. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54542. t.vertices.push(new Ci.Vector3),
  54543. t.colors.push(new Ci.Color(0,0,1)),
  54544. t.colors.push(new Ci.Color(0,1,0)))
  54545. }
  54546. t.dynamic = !0;
  54547. var n = new Ci.LineBasicMaterial({
  54548. vertexColors: Ci.VertexColors,
  54549. depthTest: !1,
  54550. depthWrite: !1,
  54551. transparent: !0
  54552. });
  54553. Ci.LineSegments.call(this, t, n),
  54554. this.root = e,
  54555. this.matrix = e.matrixWorld,
  54556. this.matrixAutoUpdate = !1,
  54557. this.update()
  54558. }
  54559. ,
  54560. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54561. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54562. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54563. var t = [];
  54564. e instanceof Ci.Bone && t.push(e);
  54565. for (var i = 0; i < e.children.length; i++)
  54566. t.push.apply(t, this.getBoneList(e.children[i]));
  54567. return t
  54568. }
  54569. ,
  54570. Ci.SkeletonHelper.prototype.update = function() {
  54571. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  54572. var o = this.bones[r];
  54573. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54574. e.vertices[n].setFromMatrixPosition(i),
  54575. i.multiplyMatrices(t, o.parent.matrixWorld),
  54576. e.vertices[n + 1].setFromMatrixPosition(i),
  54577. n += 2)
  54578. }
  54579. e.verticesNeedUpdate = !0,
  54580. e.computeBoundingSphere()
  54581. }
  54582. ,
  54583. Ci.SpotLightHelper = function(e) {
  54584. Ci.Object3D.call(this),
  54585. this.light = e,
  54586. this.light.updateMatrixWorld(),
  54587. this.matrix = e.matrixWorld,
  54588. this.matrixAutoUpdate = !1;
  54589. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54590. t.translate(0, -.5, 0),
  54591. t.rotateX(-Math.PI / 2);
  54592. var i = new Ci.MeshBasicMaterial({
  54593. wireframe: !0,
  54594. fog: !1
  54595. });
  54596. this.cone = new Ci.Mesh(t,i),
  54597. this.add(this.cone),
  54598. this.update()
  54599. }
  54600. ,
  54601. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54602. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54603. Ci.SpotLightHelper.prototype.dispose = function() {
  54604. this.cone.geometry.dispose(),
  54605. this.cone.material.dispose()
  54606. }
  54607. ,
  54608. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54609. oi = new Ci.Vector3,
  54610. function() {
  54611. var e = this.light.distance ? this.light.distance : 1e4
  54612. , t = e * Math.tan(this.light.angle);
  54613. this.cone.scale.set(t, t, e),
  54614. ri.setFromMatrixPosition(this.light.matrixWorld),
  54615. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54616. this.cone.lookAt(oi.sub(ri)),
  54617. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54618. }
  54619. ),
  54620. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54621. this.object = e,
  54622. this.size = void 0 !== t ? t : 1;
  54623. var r = void 0 !== i ? i : 16711680
  54624. , o = void 0 !== n ? n : 1
  54625. , a = 0
  54626. , s = this.object.geometry;
  54627. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54628. var l = new Ci.BufferGeometry
  54629. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54630. l.addAttribute("position", c),
  54631. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54632. color: r,
  54633. linewidth: o
  54634. })),
  54635. this.matrixAutoUpdate = !1,
  54636. this.update()
  54637. }
  54638. ,
  54639. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54640. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54641. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54642. ii = new Ci.Vector3,
  54643. ni = new Ci.Matrix3,
  54644. function() {
  54645. var e = ["a", "b", "c"];
  54646. this.object.updateMatrixWorld(!0),
  54647. ni.getNormalMatrix(this.object.matrixWorld);
  54648. var t = this.object.matrixWorld
  54649. , i = this.geometry.attributes.position
  54650. , n = this.object.geometry;
  54651. if (n instanceof Ci.Geometry)
  54652. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54653. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54654. var d = r[c[e[h]]]
  54655. , p = c.vertexNormals[h];
  54656. ti.copy(d).applyMatrix4(t),
  54657. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54658. i.setXYZ(a, ti.x, ti.y, ti.z),
  54659. a += 1,
  54660. i.setXYZ(a, ii.x, ii.y, ii.z),
  54661. a += 1
  54662. }
  54663. else if (n instanceof Ci.BufferGeometry) {
  54664. var f = n.attributes.position
  54665. , g = n.attributes.normal;
  54666. for (h = a = 0,
  54667. u = f.count; h < u; h++)
  54668. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54669. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54670. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54671. i.setXYZ(a, ti.x, ti.y, ti.z),
  54672. a += 1,
  54673. i.setXYZ(a, ii.x, ii.y, ii.z),
  54674. a += 1
  54675. }
  54676. return i.needsUpdate = !0,
  54677. this
  54678. }
  54679. ),
  54680. Ci.WireframeHelper = function(e, t) {
  54681. var i = void 0 !== t ? t : 16777215;
  54682. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54683. color: i
  54684. })),
  54685. this.matrix = e.matrixWorld,
  54686. this.matrixAutoUpdate = !1
  54687. }
  54688. ,
  54689. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54690. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54691. Ci.ImmediateRenderObject = function(e) {
  54692. Ci.Object3D.call(this),
  54693. this.material = e,
  54694. this.render = function(e) {}
  54695. }
  54696. ,
  54697. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54698. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54699. Ci.MorphBlendMesh = function(e, t) {
  54700. Ci.Mesh.call(this, e, t),
  54701. this.animationsMap = {},
  54702. this.animationsList = [];
  54703. var i = this.geometry.morphTargets.length
  54704. , n = i - 1
  54705. , r = i / 1;
  54706. this.createAnimation("__default", 0, n, r),
  54707. this.setAnimationWeight("__default", 1)
  54708. }
  54709. ,
  54710. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54711. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54712. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54713. var r = {
  54714. start: t,
  54715. end: i,
  54716. length: i - t + 1,
  54717. fps: n,
  54718. duration: (i - t) / n,
  54719. lastFrame: 0,
  54720. currentFrame: 0,
  54721. active: !1,
  54722. time: 0,
  54723. direction: 1,
  54724. weight: 1,
  54725. directionBackwards: !1,
  54726. mirroredLoop: !1
  54727. };
  54728. this.animationsMap[e] = r,
  54729. this.animationsList.push(r)
  54730. }
  54731. ,
  54732. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54733. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54734. var s = r.morphTargets[o].name.match(i);
  54735. if (s && 1 < s.length)
  54736. n[l = s[1]] || (n[l] = {
  54737. start: 1 / 0,
  54738. end: -1 / 0
  54739. }),
  54740. o < (c = n[l]).start && (c.start = o),
  54741. o > c.end && (c.end = o),
  54742. t = t || l
  54743. }
  54744. for (var l in n) {
  54745. var c = n[l];
  54746. this.createAnimation(l, c.start, c.end, e)
  54747. }
  54748. this.firstAnimation = t
  54749. }
  54750. ,
  54751. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54752. var t = this.animationsMap[e];
  54753. t && (t.direction = 1,
  54754. t.directionBackwards = !1)
  54755. }
  54756. ,
  54757. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54758. var t = this.animationsMap[e];
  54759. t && (t.direction = -1,
  54760. t.directionBackwards = !0)
  54761. }
  54762. ,
  54763. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54764. var i = this.animationsMap[e];
  54765. i && (i.fps = t,
  54766. i.duration = (i.end - i.start) / i.fps)
  54767. }
  54768. ,
  54769. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54770. var i = this.animationsMap[e];
  54771. i && (i.duration = t,
  54772. i.fps = (i.end - i.start) / i.duration)
  54773. }
  54774. ,
  54775. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54776. var i = this.animationsMap[e];
  54777. i && (i.weight = t)
  54778. }
  54779. ,
  54780. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54781. var i = this.animationsMap[e];
  54782. i && (i.time = t)
  54783. }
  54784. ,
  54785. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54786. var t = 0
  54787. , i = this.animationsMap[e];
  54788. return i && (t = i.time),
  54789. t
  54790. }
  54791. ,
  54792. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54793. var t = -1
  54794. , i = this.animationsMap[e];
  54795. return i && (t = i.duration),
  54796. t
  54797. }
  54798. ,
  54799. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54800. var t = this.animationsMap[e];
  54801. t ? (t.time = 0,
  54802. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54803. }
  54804. ,
  54805. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54806. var t = this.animationsMap[e];
  54807. t && (t.active = !1)
  54808. }
  54809. ,
  54810. Ci.MorphBlendMesh.prototype.update = function(e) {
  54811. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54812. var n = this.animationsList[t];
  54813. if (n.active) {
  54814. var r = n.duration / n.length;
  54815. n.time += n.direction * e,
  54816. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54817. n.time > n.duration && (n.time = n.duration,
  54818. n.directionBackwards = !0),
  54819. n.time < 0 && (n.time = 0,
  54820. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54821. n.time < 0 && (n.time += n.duration));
  54822. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54823. , a = n.weight;
  54824. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54825. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54826. this.morphTargetInfluences[o] = 0,
  54827. n.lastFrame = n.currentFrame,
  54828. n.currentFrame = o);
  54829. var s = n.time % r / r;
  54830. n.directionBackwards && (s = 1 - s),
  54831. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54832. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54833. }
  54834. }
  54835. }
  54836. ,
  54837. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54838. i.THREE = Ci) : this.THREE = Ci
  54839. }
  54840. , {}]
  54841. }, {}, [116]);